From 23c0e1b9ba1ac73bbe43389b541b4e9465bea987 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 14 Oct 2019 13:01:58 -0400 Subject: [PATCH 001/173] add revinclude provenance tests --- generator/uscore/metadata_extractor.rb | 5 ++++ generator/uscore/uscore_generator.rb | 23 +++++++++++++++ .../pediatric_bmi_for_age_sequence.rb | 25 +++++++++++++++-- .../pediatric_weight_for_height_sequence.rb | 25 +++++++++++++++-- .../us_core_allergyintolerance_sequence.rb | 27 ++++++++++++++++-- .../us_core_careplan_sequence.rb | 25 +++++++++++++++-- .../us_core_careteam_sequence.rb | 25 +++++++++++++++-- .../us_core_condition_sequence.rb | 27 ++++++++++++++++-- .../us_core_diagnosticreport_lab_sequence.rb | 25 +++++++++++++++-- .../us_core_diagnosticreport_note_sequence.rb | 25 +++++++++++++++-- .../us_core_documentreference_sequence.rb | 27 ++++++++++++++++-- .../us_core_encounter_sequence.rb | 27 ++++++++++++++++-- .../uscore_v3.0.1/us_core_goal_sequence.rb | 27 ++++++++++++++++-- .../us_core_immunization_sequence.rb | 27 ++++++++++++++++-- .../us_core_implantable_device_sequence.rb | 27 ++++++++++++++++-- .../us_core_location_sequence.rb | 27 ++++++++++++++++-- .../us_core_medication_sequence.rb | 24 ++++++++++++++-- .../us_core_medicationrequest_sequence.rb | 28 +++++++++++++++++-- .../us_core_observation_lab_sequence.rb | 25 +++++++++++++++-- .../us_core_organization_sequence.rb | 27 ++++++++++++++++-- .../uscore_v3.0.1/us_core_patient_sequence.rb | 25 +++++++++++++++-- .../us_core_practitioner_sequence.rb | 27 ++++++++++++++++-- .../us_core_practitionerrole_sequence.rb | 27 ++++++++++++++++-- .../us_core_procedure_sequence.rb | 27 ++++++++++++++++-- .../us_core_pulse_oximetry_sequence.rb | 28 +++++++++++++++++-- .../us_core_smokingstatus_sequence.rb | 25 +++++++++++++++-- .../CapabilityStatement-us-core-server.json | 2 +- 27 files changed, 586 insertions(+), 73 deletions(-) diff --git a/generator/uscore/metadata_extractor.rb b/generator/uscore/metadata_extractor.rb index 264a2784a..56640a5bb 100644 --- a/generator/uscore/metadata_extractor.rb +++ b/generator/uscore/metadata_extractor.rb @@ -94,6 +94,7 @@ def add_metadata_from_resources(metadata, resources) add_basic_searches(resource, new_sequence) add_combo_searches(resource, new_sequence) add_interactions(resource, new_sequence) + add_revinclude_targets(resource, new_sequence) base_path = new_sequence[:profile].split('us/core/').last profile_definition = @resource_by_path[base_path] @@ -150,6 +151,10 @@ def add_interactions(resource, sequence) end end + def add_revinclude_targets(resource, sequence) + sequence[:revincludes] = resource['searchRevInclude'] || [] + end + def add_must_support_elements(profile_definition, sequence) profile_definition['snapshot']['element'].select { |el| el['mustSupport'] }.each do |element| if element['path'].end_with? 'extension' diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index f0215065e..390816f83 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -66,6 +66,7 @@ def generate_tests(metadata) create_interaction_test(sequence, interaction) end + create_revinclude_test(sequence) if sequence[:revincludes].any? create_resource_profile_test(sequence) create_must_support_test(sequence) create_references_resolved_test(sequence) @@ -131,6 +132,28 @@ def create_authorization_test(sequence) sequence[:tests] << authorization_test end + def create_revinclude_test(sequence) + revinclude_test = { + tests_that: "A Server SHALL be capable of supporting the following _revincludes: #{sequence[:revincludes].join(',')}", + index: sequence[:tests].length + 1, + link: 'https://www.hl7.org/fhir/search.html#revinclude' + } + first_search = find_first_search(sequence) + search_params = first_search.nil? ? 'search_params = {}' : get_search_params(first_search[:names], sequence) + sequence[:revincludes].each do |revinclude| + revinclude_test[:test_code] = %( + #{search_params} + search_params['_revinclude'] = '#{revinclude}' + reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == '#{revinclude.split(':').first}' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + ) + end + sequence[:tests] << revinclude_test + end + def create_search_test(sequence, search_param) search_test = { tests_that: "Server returns expected results from #{sequence[:resource]} search by #{search_param[:names].join('+')}", diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb index cd3726180..54368edc8 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb @@ -232,9 +232,28 @@ def validate_resource_item(resource, property, value) validate_history_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '59576-9' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age' description %( ) @@ -247,7 +266,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Observation for this patient.' do metadata do - id '11' + id '12' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -302,7 +321,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '12' + id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb index 8fa14fbf7..807917187 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb @@ -232,9 +232,28 @@ def validate_resource_item(resource, property, value) validate_history_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '77606-2' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height' description %( ) @@ -247,7 +266,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Observation for this patient.' do metadata do - id '11' + id '12' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -302,7 +321,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '12' + id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb index 50ae6e28a..dad55ecd9 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb @@ -152,9 +152,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) end - test 'AllergyIntolerance resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '07' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'AllergyIntolerance resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance' description %( ) @@ -167,7 +188,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any AllergyIntolerance for this patient.' do metadata do - id '08' + id '09' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -197,7 +218,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '09' + id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb index 1562aaa8a..0ad40826e 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb @@ -224,9 +224,28 @@ def validate_resource_item(resource, property, value) validate_history_reply(@careplan, versioned_resource_class('CarePlan')) end - test 'CarePlan resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '09' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, category: 'assess-plan' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'CarePlan resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '10' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan' description %( ) @@ -239,7 +258,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any CarePlan for this patient.' do metadata do - id '10' + id '11' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -272,7 +291,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '11' + id '12' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb index 132a5d32a..aa807ebeb 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb @@ -125,9 +125,28 @@ def validate_resource_item(resource, property, value) validate_history_reply(@careteam, versioned_resource_class('CareTeam')) end - test 'CareTeam resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '06' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, status: 'active' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'CareTeam resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '07' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam' description %( ) @@ -140,7 +159,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any CareTeam for this patient.' do metadata do - id '07' + id '08' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -171,7 +190,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '08' + id '09' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb index 0af46fcd4..e025515e3 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb @@ -243,9 +243,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@condition, versioned_resource_class('Condition')) end - test 'Condition resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Condition resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition' description %( ) @@ -258,7 +279,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Condition for this patient.' do metadata do - id '11' + id '12' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -289,7 +310,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '12' + id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb index 876a0d7d5..f7227431c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb @@ -335,9 +335,28 @@ def validate_resource_item(resource, property, value) validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) end - test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '14' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, category: 'LAB' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '15' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab' description %( ) @@ -350,7 +369,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do metadata do - id '15' + id '16' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -388,7 +407,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '16' + id '17' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb index c506d26f2..752b9a45c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb @@ -335,9 +335,28 @@ def validate_resource_item(resource, property, value) validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) end - test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '14' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: 'LP29684-5' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '15' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note' description %( ) @@ -350,7 +369,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do metadata do - id '15' + id '16' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -387,7 +406,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '16' + id '17' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb index 0f4f47123..cd4a6ff1e 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb @@ -301,9 +301,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@documentreference, versioned_resource_class('DocumentReference')) end - test 'DocumentReference resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '13' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'DocumentReference resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '14' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference' description %( ) @@ -316,7 +337,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any DocumentReference for this patient.' do metadata do - id '14' + id '15' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -359,7 +380,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '15' + id '16' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb index eeffc66d5..0a9954c44 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb @@ -293,9 +293,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@encounter, versioned_resource_class('Encounter')) end - test 'Encounter resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '12' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Encounter resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '13' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter' description %( ) @@ -308,7 +329,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Encounter for this patient.' do metadata do - id '13' + id '14' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -351,7 +372,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '14' + id '15' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb index 70353d054..7d6a5a935 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb @@ -189,9 +189,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@goal, versioned_resource_class('Goal')) end - test 'Goal resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '08' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Goal resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '09' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal' description %( ) @@ -204,7 +225,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Goal for this patient.' do metadata do - id '09' + id '10' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -235,7 +256,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '10' + id '11' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb index 5e9b5c2fd..11d95049d 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb @@ -189,9 +189,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@immunization, versioned_resource_class('Immunization')) end - test 'Immunization resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '08' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Immunization resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '09' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization' description %( ) @@ -204,7 +225,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Immunization for this patient.' do metadata do - id '09' + id '10' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -237,7 +258,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '10' + id '11' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb index 61be439ea..6b5eadaf1 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb @@ -152,9 +152,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@device, versioned_resource_class('Device')) end - test 'Device resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '07' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Device'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Device resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device' description %( ) @@ -167,7 +188,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Device for this patient.' do metadata do - id '08' + id '09' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -204,7 +225,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '09' + id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb index a25990781..ab65d58a3 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb @@ -229,9 +229,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@location, versioned_resource_class('Location')) end - test 'Location resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + name_val = resolve_element_from_path(@location, 'name') + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Location resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-location' description %( ) @@ -244,7 +265,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Location for this patient.' do metadata do - id '11' + id '12' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -279,7 +300,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '12' + id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb index 421711bc6..6321cbf61 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb @@ -66,9 +66,27 @@ class USCore301MedicationSequence < SequenceBase validate_history_reply(@medication, versioned_resource_class('Medication')) end - test 'Medication resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '04' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = {} + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Medication'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Medication resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '05' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication' description %( ) @@ -81,7 +99,7 @@ class USCore301MedicationSequence < SequenceBase test 'At least one of every must support element is provided in any Medication for this patient.' do metadata do - id '05' + id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -108,7 +126,7 @@ class USCore301MedicationSequence < SequenceBase test 'All references can be resolved' do metadata do - id '06' + id '07' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb index ef33c0ba2..741202f12 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb @@ -214,9 +214,31 @@ def validate_resource_item(resource, property, value) validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) end - test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '09' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + intent_val = resolve_element_from_path(@medicationrequest, 'intent') + search_params = { 'patient': patient_val, 'intent': intent_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '10' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest' description %( ) @@ -229,7 +251,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any MedicationRequest for this patient.' do metadata do - id '10' + id '11' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -267,7 +289,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '11' + id '12' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb index aba3d0adf..61471e687 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb @@ -232,9 +232,28 @@ def validate_resource_item(resource, property, value) validate_history_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, category: 'laboratory' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab' description %( ) @@ -247,7 +266,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Observation for this patient.' do metadata do - id '11' + id '12' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -292,7 +311,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '12' + id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb index 74d74da66..0361fd766 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb @@ -151,9 +151,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@organization, versioned_resource_class('Organization')) end - test 'Organization resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '07' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + name_val = resolve_element_from_path(@organization, 'name') + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Organization resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization' description %( ) @@ -166,7 +187,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Organization for this patient.' do metadata do - id '08' + id '09' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -207,7 +228,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '09' + id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb index d8188b0b2..e88f48c27 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb @@ -286,9 +286,28 @@ def validate_resource_item(resource, property, value) validate_history_reply(@patient, versioned_resource_class('Patient')) end - test 'Patient resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '12' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { '_id': @instance.patient_id } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Patient resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '13' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient' description %( ) @@ -301,7 +320,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Patient for this patient.' do metadata do - id '13' + id '14' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -361,7 +380,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '14' + id '15' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb index 50230e705..baeea02fd 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb @@ -158,9 +158,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@practitioner, versioned_resource_class('Practitioner')) end - test 'Practitioner resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '07' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + name_val = resolve_element_from_path(@practitioner, 'name.family') + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Practitioner resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner' description %( ) @@ -173,7 +194,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Practitioner for this patient.' do metadata do - id '08' + id '09' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -205,7 +226,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '09' + id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb index fb78e46f5..52de5d2fd 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb @@ -151,9 +151,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) end - test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '07' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + specialty_val = resolve_element_from_path(@practitionerrole, 'specialty.coding.code') + search_params = { 'specialty': specialty_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole' description %( ) @@ -166,7 +187,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any PractitionerRole for this patient.' do metadata do - id '08' + id '09' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -201,7 +222,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '09' + id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb index be14016c2..70d4cb3bb 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb @@ -208,9 +208,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@procedure, versioned_resource_class('Procedure')) end - test 'Procedure resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '09' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Procedure resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '10' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure' description %( ) @@ -223,7 +244,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Procedure for this patient.' do metadata do - id '10' + id '11' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -254,7 +275,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '11' + id '12' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb index 83f56566a..6632cb990 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb @@ -238,9 +238,31 @@ def validate_resource_item(resource, property, value) validate_history_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + code_val = resolve_element_from_path(@observation, 'code.coding.code') + search_params = { 'patient': patient_val, 'code': code_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry' description %( ) @@ -253,7 +275,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Observation for this patient.' do metadata do - id '11' + id '12' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -429,7 +451,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '12' + id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb index 0b1f4da15..4a6ed0561 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb @@ -232,9 +232,28 @@ def validate_resource_item(resource, property, value) validate_history_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do metadata do id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '72166-2' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } + assert provenance_results.any?, 'No provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus' description %( ) @@ -247,7 +266,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Observation for this patient.' do metadata do - id '11' + id '12' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -278,7 +297,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '12' + id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/resources/uscore_v3.0.1/CapabilityStatement-us-core-server.json b/resources/uscore_v3.0.1/CapabilityStatement-us-core-server.json index 57d4e99e9..98d6ccabf 100644 --- a/resources/uscore_v3.0.1/CapabilityStatement-us-core-server.json +++ b/resources/uscore_v3.0.1/CapabilityStatement-us-core-server.json @@ -1 +1 @@ -{"resourceType":"CapabilityStatement","id":"us-core-server","text":{"status":"generated","div":"

US Core Server CapabilityStatement

This Section describes the expected capabilities of the US Core Server actor which is responsible for providing responses to the queries submitted by the US Core Requestors. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined. Systems implementing this capability statement should meet the ONC 2015 Common Clinical Data Set (CCDS) access requirement for Patient Selection 170.315(g)(7) and Application Access - Data Category Request 170.315(g)(8) and and the latest proposed ONC [U.S. Core Data for Interoperability (USCDI)]. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.

FHIR RESTful Capabilities

The US Core Server SHALL:

  1. Support the US Core Patient resource profile.
  2. Support at least one additional resource profile from the list of US Core Profiles.
  3. Implement the RESTful behavior according to the FHIR specification.
  4. Return the following response classes:\n
    • (Status 400): invalid parameter
    • (Status 401/4xx): unauthorized request
    • (Status 403): insufficient scope
    • (Status 404): unknown resource
    • (Status 410): deleted resource.
    \n
  5. Support json source formats for all US Core interactions.

The US Core Server SHOULD:

  1. Support xml source formats for all US Core interactions.
  2. Identify the US Core profiles supported as part of the FHIR meta.profile attribute for each instance.
  3. Support xml resource formats for all Argonaut questionnaire interactions.

Security:

  1. See the General Security Considerations section for requirements and recommendations.
  2. A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code.

Summary of System Wide Interactions

  • MAY support the\ttransaction interaction.
  • MAY support the\tbatch interaction.
  • MAY support the\tsearch-system interaction.
  • MAY support the\thistory-system interaction.
  • RESTful Capabilities by Resource/Profile:

    Summary of Search Criteria

    Resource TypeSupported ProfilesSupported SearchesSupported _includesSupported _revincludesSupported Operations
    AllergyIntoleranceUS Core AllergyIntolerance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+clinical-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CarePlanUS Core CarePlan Profile\n\t\t\t\t\t\t\t, patient+category+status, patient+category+date, patient+category, patient+category+status+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CareTeamUS Core CareTeam Profile\n\t\t\t\t\t\t\t, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ConditionUS Core Condition Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+clinical-status, patient+onset-date, patient+code, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DeviceUS Core Implantable Device Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DiagnosticReportUS Core DiagnosticReport Profile for Report and Note exchange, \n\n\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+code+date, patient+code, patient+status, patient+category+date, patient+category, patient+category, patient+category+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DocumentReferenceUS Core DocumentReference Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tpatient, patient+status, patient+category+date, patient+category, patient+type+period, patient+type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$docref\n\t\t\t\t\t\t
    EncounterUS Core Encounter Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tpatient, patient+status, patient+type, class+patient, date+patient\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    GoalUS Core Goal Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+target-date, patient+lifecycle-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ImmunizationUS Core Immunization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+status, patient+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    LocationUS Core Location Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress, \n\t\t\t\t\t\t\taddress-city, \n\t\t\t\t\t\t\taddress-state, \n\t\t\t\t\t\t\taddress-postalcode\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationUS Core Medication Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationRequestUS Core MedicationRequest Profile\n\t\t\t\t\t\t\t, patient+intent, patient+intent+encounter, patient+intent+status, patient+intent+authoredon\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tMedicationRequest:medication\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ObservationUS Core Smoking Status Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\n\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\n\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\t\t\t, patient+category+status, patient+code+date, patient+code, patient+category+date, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    OrganizationUS Core Organization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PatientUS Core Patient Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tname, birthdate+name, gender+name, family+gender, birthdate+family\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerUS Core Practitioner Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerRoleUS Core PractitionerRole Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tspecialty, \n\t\t\t\t\t\t\tpractitioner\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tPractitionerRole:endpoint, PractitionerRole:practitioner\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProcedureUS Core Procedure Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+code+date, patient+status, patient+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProvenanceUS Core Provenance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ValueSet\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$expand\n\t\t\t\t\t\t

    AllergyIntolerance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core AllergyIntolerance Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?clinical-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]&clinical-status=[system]|[code]

    CarePlan

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CarePlan Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?category=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/CarePlan?date=[date]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]
    SHOULDpatient+category+status+date\n\t\t\t\t\t\treference+token+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]&date=[date]

    CareTeam

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CareTeam Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CareTeam?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]&status=[status]

    Condition

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Condition Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?category=[system]|[code]
    MAYclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?clinical-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]
    MAYonset-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Condition?onset-date=[onset-date]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&clinical-status=[system]|[code]
    SHOULDpatient+onset-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&onset-date=[onset-date]
    SHOULDpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&code=[system]|[code]
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&category=[system]|[code]

    Device

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Implantable Device Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Device?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]&type=[system]|[code]

    DiagnosticReport

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Report and Note exchange, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    create

    This conformance expectation applies only to the US Core DiagnosticReport Profile for Report and Note exchange profile. The conformance expectation for the US Core DiagnosticReport Profile for Laboratory Results Reporting is MAY.

    \n
    search-type

    The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations.

    \n

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?category=[system]|[code]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?code=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DiagnosticReport?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]&date=[date]
    SHALLpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&status=[status]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]&date=[date]

    DocumentReference

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DocumentReference Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The DocumentReference.type binding SHALL support at a minimum the 5 Common Clinical Notes and may extend to the full US Core DocumentReference Type Value Set

    Reference Policy: resolves

    Profile Interaction Summary:

    Operation Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?_id=[id]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?category=[system]|[code]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?type=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?date=[date]
    MAYperiod\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?period=[period]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&status=[status]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]
    SHOULDpatient+type+period\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]&period=[period]
    SHALLpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]

    Encounter

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Encounter Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?_id=[id]
    MAYclass\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]
    SHOULDidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?identifier=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?status=[status]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&status=[status]
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&type=[system]|[code]
    SHOULDclass+patient\n\t\t\t\t\t\ttoken+reference\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]&patient=[patient]
    SHALLdate+patient\n\t\t\t\t\t\tdate+reference\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]&patient=[patient]

    Goal

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Goal Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYlifecycle-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Goal?lifecycle-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]
    MAYtarget-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Goal?target-date=[target-date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+target-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&target-date=[target-date]
    SHOULDpatient+lifecycle-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&lifecycle-status=[system]|[code]

    Immunization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Immunization Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Immunization?status=[status]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Immunization?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&status=[status]
    SHOULDpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&date=[date]

    Location

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Location Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?name=[name]
    SHALLaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address=[address]
    SHOULDaddress-city\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-city=[address-city]
    SHOULDaddress-state\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-state=[address-state]
    SHOULDaddress-postalcode\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-postalcode=[address-postalcode]

    Medication

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Medication Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria SHALL be supported.

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:


    MedicationRequest

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core MedicationRequest Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be contained or an external resource. The server application MAY choose any one way or more than one method, but if an external reference to Medication is used, the server SHALL support the _include` parameter for searching this element. The client application must support all methods.

    For example, A server SHALL be capable of returning all medications for a patient using one of or both:

    GET /MedicationRequest?patient=[id]

    GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?status=[status]
    MAYintent\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?intent=[system]|[code]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]
    MAYencounter\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?encounter=[encounter]
    MAYauthoredon\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/MedicationRequest?authoredon=[authoredon]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+intent\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]
    SHOULDpatient+intent+encounter\n\t\t\t\t\t\treference+token+reference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&encounter=[encounter]
    SHALLpatient+intent+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&status=[status]
    SHOULDpatient+intent+authoredon\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&authoredon=[authoredon]

    Observation

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Smoking Status Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    search-type

    The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations.

    \n

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?status=[status]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?category=[system]|[code]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?code=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Observation?date=[date]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&status=[status]
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]&date=[date]
    SHALLpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]

    Organization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Organization Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?name=[name]
    SHALLaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?address=[address]

    Patient

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Patient Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?_id=[id]
    MAYbirthdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]
    MAYfamily\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?family=[family]
    MAYgender\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]
    MAYgiven\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?given=[given]
    SHALLidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?identifier=[system]|[code]
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?name=[name]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLbirthdate+name\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&name=[name]
    SHALLgender+name\n\t\t\t\t\t\ttoken+string\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]&name=[name]
    SHOULDfamily+gender\n\t\t\t\t\t\tstring+token\n\t\t\t\t\t\tGET [base]/Patient?family=[family]&gender=[system]|[code]
    SHOULDbirthdate+family\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&family=[family]

    Practitioner

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Practitioner Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Practitioner?name=[name]
    SHALLidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Practitioner?identifier=[system]|[code]

    PractitionerRole

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core PractitionerRole Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLspecialty\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/PractitionerRole?specialty=[system]|[code]
    SHALLpractitioner\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/PractitionerRole?practitioner=[practitioner]

    Procedure

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Procedure Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Procedure?date=[date]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&code=[system]|[code]&date=[date]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&status=[status]
    SHALLpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&date=[date]

    Provenance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Provenance Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    If a system receives a provider in Provenance.agent.who as free text they must capture who sent them the information as the organization. On request they SHALL provide this organization as the source and MAY include the free text provider.

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:


    ValueSet

    Operation Summary:



    "},"url":"http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server","version":"3.0.1","name":"UsCoreServerCapabilityStatement","title":"US Core Server CapabilityStatement","status":"active","experimental":false,"date":"2019-09-12T00:00:00+00:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"This Section describes the expected capabilities of the US Core Server actor which is responsible for providing responses to the queries submitted by the US Core Requestors. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined. Systems implementing this capability statement should meet the ONC 2015 Common Clinical Data Set (CCDS) access requirement for Patient Selection 170.315(g)(7) and Application Access - Data Category Request 170.315(g)(8) and and the latest proposed ONC [U.S. Core Data for Interoperability (USCDI)]. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"kind":"requirements","fhirVersion":"4.0.0","format":["xml","json"],"patchFormat":["application/json-patch+json"],"implementationGuide":["http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core-3.0.1"],"rest":[{"mode":"server","documentation":"The US Core Server **SHALL**:\n\n1. Support the US Core Patient resource profile.\n1. Support at least one additional resource profile from the list of US Core Profiles.\n1. Implement the RESTful behavior according to the FHIR specification.\n1. Return the following response classes:\n - (Status 400): invalid parameter\n - (Status 401/4xx): unauthorized request\n - (Status 403): insufficient scope\n - (Status 404): unknown resource\n - (Status 410): deleted resource.\n1. Support json source formats for all US Core interactions.\n\nThe US Core Server **SHOULD**:\n\n1. Support xml source formats for all US Core interactions.\n1. Identify the US Core profiles supported as part of the FHIR `meta.profile` attribute for each instance.\n1. Support xml resource formats for all Argonaut questionnaire interactions.","security":{"description":"1. See the [General Security Considerations](security.html) section for requirements and recommendations.\n1. A server **SHALL** reject any unauthorized requests by returning an `HTTP 401` unauthorized response code."},"resource":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"AllergyIntolerance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CarePlan","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CareTeam","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"onset-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Condition","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"onset-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-onset-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Device","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DiagnosticReport","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note","http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create","documentation":"This conformance expectation applies **only** to the *US Core DiagnosticReport Profile for Report and Note exchange* profile. The conformance expectation for the *US Core DiagnosticReport Profile for Laboratory Results Reporting* is **MAY**."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type","documentation":"The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"},{"url":"required","valueString":"period"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DocumentReference","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference"],"documentation":"The DocumentReference.type binding SHALL support at a minimum the [5 Common Clinical Notes](ValueSet-us-core-clinical-note-type.html) and may extend to the full US Core DocumentReference Type Value Set","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-type","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"period","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-period","type":"date"}],"operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"docref","definition":"http://hl7.org/fhir/us/core/OperationDefinition/docref","documentation":"A server **SHALL** be capable of responding to a $docref operation and capable of returning at least a reference to a generated CCD document, if available. **MAY** provide references to other 'on-demand' and 'stable' documents (or 'delayed/deferred assembly') that meet the query parameters as well. If a context date range is supplied the server ** SHOULD** provide references to any document that falls within the date range If no date range is supplied, then the server **SHALL** provide references to last or current encounter. **SHOULD** document what resources, if any, are returned as included resources\n\n`GET [base]/DocumentReference/$docref?patient=[id]`"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"class"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"date"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Encounter","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"class","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-class","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"target-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"lifecycle-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Goal","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"lifecycle-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-lifecycle-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"target-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-target-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Immunization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Location","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-location"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-city","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-city","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-state","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-state","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-postalcode","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-postalcode","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Medication","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication"],"documentation":"The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria **SHALL** be supported.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"encounter"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"authoredon"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"MedicationRequest","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest"],"documentation":"The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be [contained](http://hl7.org/fhir/R4/references.html#contained) or an external resource. The server application **MAY** choose any one way or more than one method, but if an external reference to Medication is used, the server **SHALL** support the _include` parameter for searching this element. The client application must support all methods.\n\n For example, A server **SHALL** be capable of returning all medications for a patient using one of or both:\n\n `GET /MedicationRequest?patient=[id]`\n\n `GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication`","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchInclude":["MedicationRequest:medication"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"intent","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-intent","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"encounter","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-encounter","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"authoredon","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-authoredon","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Observation","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height","http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age","http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type","documentation":"The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Organization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"gender"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"family"},{"url":"required","valueString":"gender"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"family"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Patient","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"birthdate","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-birthdate","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"family","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-family","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"gender","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-gender","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"given","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-given","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-name","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Practitioner","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-identifier","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"PractitionerRole","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchInclude":["PractitionerRole:endpoint","PractitionerRole:practitioner"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"specialty","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"practitioner","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Procedure","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Provenance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance"],"documentation":"If a system receives a provider in `Provenance.agent.who` as free text they must capture who sent them the information as the organization. On request they **SHALL** provide this organization as the source and **MAY** include the free text provider.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"ValueSet","operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"expand","definition":"http://hl7.org/fhir/OperationDefinition/ValueSet-expand","documentation":"A client can determine the note and report types support by a server by invoking the standard FHIR Value Set Expansion ($expand) operation defined in the FHIR R4 specification. Because servers may support different read and write formats, it also is used to determine the formats (for example, text, pdf) the server supports read and write transactions."}]}],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"transaction"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"batch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"search-system"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-system"}]}]} \ No newline at end of file +{"resourceType":"CapabilityStatement","id":"us-core-server","text":{"status":"generated","div":"

    US Core Server CapabilityStatement

    This Section describes the expected capabilities of the US Core Server actor which is responsible for providing responses to the queries submitted by the US Core Requestors. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined. Systems implementing this capability statement should meet the ONC 2015 Common Clinical Data Set (CCDS) access requirement for Patient Selection 170.315(g)(7) and Application Access - Data Category Request 170.315(g)(8) and and the latest proposed ONC [U.S. Core Data for Interoperability (USCDI)]. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.

    FHIR RESTful Capabilities

    The US Core Server SHALL:

    1. Support the US Core Patient resource profile.
    2. Support at least one additional resource profile from the list of US Core Profiles.
    3. Implement the RESTful behavior according to the FHIR specification.
    4. Return the following response classes:\n
      • (Status 400): invalid parameter
      • (Status 401/4xx): unauthorized request
      • (Status 403): insufficient scope
      • (Status 404): unknown resource
      • (Status 410): deleted resource.
      \n
    5. Support json source formats for all US Core interactions.

    The US Core Server SHOULD:

    1. Support xml source formats for all US Core interactions.
    2. Identify the US Core profiles supported as part of the FHIR meta.profile attribute for each instance.
    3. Support xml resource formats for all Argonaut questionnaire interactions.

    Security:

    1. See the General Security Considerations section for requirements and recommendations.
    2. A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code.

    Summary of System Wide Interactions

  • MAY support the\ttransaction interaction.
  • MAY support the\tbatch interaction.
  • MAY support the\tsearch-system interaction.
  • MAY support the\thistory-system interaction.
  • RESTful Capabilities by Resource/Profile:

    Summary of Search Criteria

    Resource TypeSupported ProfilesSupported SearchesSupported _includesSupported _revincludesSupported Operations
    AllergyIntoleranceUS Core AllergyIntolerance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+clinical-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CarePlanUS Core CarePlan Profile\n\t\t\t\t\t\t\t, patient+category+status, patient+category+date, patient+category, patient+category+status+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CareTeamUS Core CareTeam Profile\n\t\t\t\t\t\t\t, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ConditionUS Core Condition Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+clinical-status, patient+onset-date, patient+code, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DeviceUS Core Implantable Device Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DiagnosticReportUS Core DiagnosticReport Profile for Report and Note exchange, \n\n\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+code+date, patient+code, patient+status, patient+category+date, patient+category, patient+category, patient+category+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DocumentReferenceUS Core DocumentReference Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tpatient, patient+status, patient+category+date, patient+category, patient+type+period, patient+type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$docref\n\t\t\t\t\t\t
    EncounterUS Core Encounter Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tpatient, patient+status, patient+type, class+patient, date+patient\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    GoalUS Core Goal Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+target-date, patient+lifecycle-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ImmunizationUS Core Immunization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+status, patient+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    LocationUS Core Location Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress, \n\t\t\t\t\t\t\taddress-city, \n\t\t\t\t\t\t\taddress-state, \n\t\t\t\t\t\t\taddress-postalcode\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationUS Core Medication Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationRequestUS Core MedicationRequest Profile\n\t\t\t\t\t\t\t, patient+intent, patient+intent+encounter, patient+intent+status, patient+intent+authoredon\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tMedicationRequest:medication\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ObservationUS Core Smoking Status Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\n\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\n\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\t\t\t, patient+category+status, patient+code+date, patient+code, patient+category+date, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    OrganizationUS Core Organization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PatientUS Core Patient Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tname, birthdate+name, gender+name, family+gender, birthdate+family\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerUS Core Practitioner Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerRoleUS Core PractitionerRole Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tspecialty, \n\t\t\t\t\t\t\tpractitioner\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tPractitionerRole:endpoint, PractitionerRole:practitioner\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProcedureUS Core Procedure Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+code+date, patient+status, patient+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProvenanceUS Core Provenance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ValueSet\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$expand\n\t\t\t\t\t\t

    AllergyIntolerance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core AllergyIntolerance Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?clinical-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]&clinical-status=[system]|[code]

    CarePlan

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CarePlan Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?category=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/CarePlan?date=[date]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]
    SHOULDpatient+category+status+date\n\t\t\t\t\t\treference+token+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]&date=[date]

    CareTeam

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CareTeam Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CareTeam?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]&status=[status]

    Condition

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Condition Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?category=[system]|[code]
    MAYclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?clinical-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]
    MAYonset-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Condition?onset-date=[onset-date]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&clinical-status=[system]|[code]
    SHOULDpatient+onset-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&onset-date=[onset-date]
    SHOULDpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&code=[system]|[code]
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&category=[system]|[code]

    Device

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Implantable Device Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Device?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]&type=[system]|[code]

    DiagnosticReport

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Report and Note exchange, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    create

    This conformance expectation applies only to the US Core DiagnosticReport Profile for Report and Note exchange profile. The conformance expectation for the US Core DiagnosticReport Profile for Laboratory Results Reporting is MAY.

    \n
    search-type

    The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations.

    \n

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?category=[system]|[code]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?code=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DiagnosticReport?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]&date=[date]
    SHALLpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&status=[status]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]&date=[date]

    DocumentReference

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DocumentReference Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The DocumentReference.type binding SHALL support at a minimum the 5 Common Clinical Notes and may extend to the full US Core DocumentReference Type Value Set

    Reference Policy: resolves

    Profile Interaction Summary:

    Operation Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?_id=[id]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?category=[system]|[code]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?type=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?date=[date]
    MAYperiod\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?period=[period]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&status=[status]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]
    SHOULDpatient+type+period\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]&period=[period]
    SHALLpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]

    Encounter

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Encounter Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?_id=[id]
    MAYclass\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]
    SHOULDidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?identifier=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?status=[status]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&status=[status]
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&type=[system]|[code]
    SHOULDclass+patient\n\t\t\t\t\t\ttoken+reference\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]&patient=[patient]
    SHALLdate+patient\n\t\t\t\t\t\tdate+reference\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]&patient=[patient]

    Goal

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Goal Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYlifecycle-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Goal?lifecycle-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]
    MAYtarget-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Goal?target-date=[target-date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+target-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&target-date=[target-date]
    SHOULDpatient+lifecycle-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&lifecycle-status=[system]|[code]

    Immunization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Immunization Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Immunization?status=[status]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Immunization?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&status=[status]
    SHOULDpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&date=[date]

    Location

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Location Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?name=[name]
    SHALLaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address=[address]
    SHOULDaddress-city\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-city=[address-city]
    SHOULDaddress-state\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-state=[address-state]
    SHOULDaddress-postalcode\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-postalcode=[address-postalcode]

    Medication

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Medication Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria SHALL be supported.

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:


    MedicationRequest

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core MedicationRequest Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be contained or an external resource. The server application MAY choose any one way or more than one method, but if an external reference to Medication is used, the server SHALL support the _include` parameter for searching this element. The client application must support all methods.

    For example, A server SHALL be capable of returning all medications for a patient using one of or both:

    GET /MedicationRequest?patient=[id]

    GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?status=[status]
    MAYintent\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?intent=[system]|[code]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]
    MAYencounter\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?encounter=[encounter]
    MAYauthoredon\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/MedicationRequest?authoredon=[authoredon]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+intent\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]
    SHOULDpatient+intent+encounter\n\t\t\t\t\t\treference+token+reference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&encounter=[encounter]
    SHALLpatient+intent+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&status=[status]
    SHOULDpatient+intent+authoredon\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&authoredon=[authoredon]

    Observation

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Smoking Status Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    search-type

    The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations.

    \n

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?status=[status]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?category=[system]|[code]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?code=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Observation?date=[date]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&status=[status]
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]&date=[date]
    SHALLpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]

    Organization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Organization Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?name=[name]
    SHALLaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?address=[address]

    Patient

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Patient Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?_id=[id]
    MAYbirthdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]
    MAYfamily\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?family=[family]
    MAYgender\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]
    MAYgiven\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?given=[given]
    SHALLidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?identifier=[system]|[code]
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?name=[name]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLbirthdate+name\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&name=[name]
    SHALLgender+name\n\t\t\t\t\t\ttoken+string\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]&name=[name]
    SHOULDfamily+gender\n\t\t\t\t\t\tstring+token\n\t\t\t\t\t\tGET [base]/Patient?family=[family]&gender=[system]|[code]
    SHOULDbirthdate+family\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&family=[family]

    Practitioner

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Practitioner Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Practitioner?name=[name]
    SHALLidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Practitioner?identifier=[system]|[code]

    PractitionerRole

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core PractitionerRole Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLspecialty\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/PractitionerRole?specialty=[system]|[code]
    SHALLpractitioner\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/PractitionerRole?practitioner=[practitioner]

    Procedure

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Procedure Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Procedure?date=[date]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&code=[system]|[code]&date=[date]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&status=[status]
    SHALLpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&date=[date]

    Provenance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Provenance Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    If a system receives a provider in Provenance.agent.who as free text they must capture who sent them the information as the organization. On request they SHALL provide this organization as the source and MAY include the free text provider.

    Reference Policy: resolves

    Profile Interaction Summary:

    Fetch and Search Criteria:


    ValueSet

    Operation Summary:



    "},"url":"http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server","version":"3.0.1","name":"UsCoreServerCapabilityStatement","title":"US Core Server CapabilityStatement","status":"active","experimental":false,"date":"2019-09-12T00:00:00+00:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"This Section describes the expected capabilities of the US Core Server actor which is responsible for providing responses to the queries submitted by the US Core Requestors. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined. Systems implementing this capability statement should meet the ONC 2015 Common Clinical Data Set (CCDS) access requirement for Patient Selection 170.315(g)(7) and Application Access - Data Category Request 170.315(g)(8) and and the latest proposed ONC [U.S. Core Data for Interoperability (USCDI)]. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"kind":"requirements","fhirVersion":"4.0.0","format":["xml","json"],"patchFormat":["application/json-patch+json"],"implementationGuide":["http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core-3.0.1"],"rest":[{"mode":"server","documentation":"The US Core Server **SHALL**:\n\n1. Support the US Core Patient resource profile.\n1. Support at least one additional resource profile from the list of US Core Profiles.\n1. Implement the RESTful behavior according to the FHIR specification.\n1. Return the following response classes:\n - (Status 400): invalid parameter\n - (Status 401/4xx): unauthorized request\n - (Status 403): insufficient scope\n - (Status 404): unknown resource\n - (Status 410): deleted resource.\n1. Support json source formats for all US Core interactions.\n\nThe US Core Server **SHOULD**:\n\n1. Support xml source formats for all US Core interactions.\n1. Identify the US Core profiles supported as part of the FHIR `meta.profile` attribute for each instance.\n1. Support xml resource formats for all Argonaut questionnaire interactions.","security":{"description":"1. See the [General Security Considerations](security.html) section for requirements and recommendations.\n1. A server **SHALL** reject any unauthorized requests by returning an `HTTP 401` unauthorized response code."},"resource":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"AllergyIntolerance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CarePlan","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CareTeam","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"onset-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Condition","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"onset-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-onset-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Device","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DiagnosticReport","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note","http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create","documentation":"This conformance expectation applies **only** to the *US Core DiagnosticReport Profile for Report and Note exchange* profile. The conformance expectation for the *US Core DiagnosticReport Profile for Laboratory Results Reporting* is **MAY**."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type","documentation":"The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"},{"url":"required","valueString":"period"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DocumentReference","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference"],"documentation":"The DocumentReference.type binding SHALL support at a minimum the [5 Common Clinical Notes](ValueSet-us-core-clinical-note-type.html) and may extend to the full US Core DocumentReference Type Value Set","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-type","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"period","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-period","type":"date"}],"operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"docref","definition":"http://hl7.org/fhir/us/core/OperationDefinition/docref","documentation":"A server **SHALL** be capable of responding to a $docref operation and capable of returning at least a reference to a generated CCD document, if available. **MAY** provide references to other 'on-demand' and 'stable' documents (or 'delayed/deferred assembly') that meet the query parameters as well. If a context date range is supplied the server ** SHOULD** provide references to any document that falls within the date range If no date range is supplied, then the server **SHALL** provide references to last or current encounter. **SHOULD** document what resources, if any, are returned as included resources\n\n`GET [base]/DocumentReference/$docref?patient=[id]`"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"class"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"date"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Encounter","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"class","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-class","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"target-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"lifecycle-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Goal","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"lifecycle-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-lifecycle-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"target-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-target-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Immunization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Location","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-location"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-city","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-city","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-state","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-state","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-postalcode","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-postalcode","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Medication","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication"],"documentation":"The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria **SHALL** be supported.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"encounter"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"authoredon"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"MedicationRequest","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest"],"documentation":"The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be [contained](http://hl7.org/fhir/R4/references.html#contained) or an external resource. The server application **MAY** choose any one way or more than one method, but if an external reference to Medication is used, the server **SHALL** support the _include` parameter for searching this element. The client application must support all methods.\n\n For example, A server **SHALL** be capable of returning all medications for a patient using one of or both:\n\n `GET /MedicationRequest?patient=[id]`\n\n `GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication`","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchInclude":["MedicationRequest:medication"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"intent","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-intent","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"encounter","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-encounter","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"authoredon","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-authoredon","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Observation","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height","http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age","http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type","documentation":"The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Organization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"gender"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"family"},{"url":"required","valueString":"gender"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"family"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Patient","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"birthdate","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-birthdate","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"family","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-family","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"gender","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-gender","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"given","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-given","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-name","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Practitioner","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-identifier","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"PractitionerRole","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchInclude":["PractitionerRole:endpoint","PractitionerRole:practitioner"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"specialty","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"practitioner","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Procedure","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Provenance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance"],"documentation":"If a system receives a provider in `Provenance.agent.who` as free text they must capture who sent them the information as the organization. On request they **SHALL** provide this organization as the source and **MAY** include the free text provider.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"ValueSet","operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"expand","definition":"http://hl7.org/fhir/OperationDefinition/ValueSet-expand","documentation":"A client can determine the note and report types support by a server by invoking the standard FHIR Value Set Expansion ($expand) operation defined in the FHIR R4 specification. Because servers may support different read and write formats, it also is used to determine the formats (for example, text, pdf) the server supports read and write transactions."}]}],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"transaction"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"batch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"search-system"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-system"}]}]} \ No newline at end of file From c92653b4a9bfe5de5a6d7ba0e1cab03185907bff Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 15 Oct 2019 15:48:07 -0400 Subject: [PATCH 002/173] add include search tests --- generator/uscore/metadata_extractor.rb | 5 +++ generator/uscore/uscore_generator.rb | 26 +++++++++++++- .../pediatric_bmi_for_age_sequence.rb | 2 +- .../pediatric_weight_for_height_sequence.rb | 2 +- .../us_core_allergyintolerance_sequence.rb | 2 +- .../us_core_careplan_sequence.rb | 2 +- .../us_core_careteam_sequence.rb | 2 +- .../us_core_condition_sequence.rb | 2 +- .../us_core_diagnosticreport_lab_sequence.rb | 2 +- .../us_core_diagnosticreport_note_sequence.rb | 2 +- .../us_core_documentreference_sequence.rb | 2 +- .../us_core_encounter_sequence.rb | 2 +- .../uscore_v3.0.1/us_core_goal_sequence.rb | 2 +- .../us_core_immunization_sequence.rb | 2 +- .../us_core_implantable_device_sequence.rb | 2 +- .../us_core_location_sequence.rb | 2 +- .../us_core_medicationrequest_sequence.rb | 30 +++++++++++++--- .../us_core_observation_lab_sequence.rb | 2 +- .../us_core_organization_sequence.rb | 2 +- .../uscore_v3.0.1/us_core_patient_sequence.rb | 2 +- .../us_core_practitioner_sequence.rb | 2 +- .../us_core_practitionerrole_sequence.rb | 36 ++++++++++++++++--- .../us_core_procedure_sequence.rb | 2 +- .../us_core_pulse_oximetry_sequence.rb | 2 +- .../us_core_smokingstatus_sequence.rb | 2 +- lib/app/sequence_base.rb | 20 ++++++----- 26 files changed, 120 insertions(+), 39 deletions(-) diff --git a/generator/uscore/metadata_extractor.rb b/generator/uscore/metadata_extractor.rb index 264a2784a..fa344b247 100644 --- a/generator/uscore/metadata_extractor.rb +++ b/generator/uscore/metadata_extractor.rb @@ -94,6 +94,7 @@ def add_metadata_from_resources(metadata, resources) add_basic_searches(resource, new_sequence) add_combo_searches(resource, new_sequence) add_interactions(resource, new_sequence) + add_include_search(resource, new_sequence) base_path = new_sequence[:profile].split('us/core/').last profile_definition = @resource_by_path[base_path] @@ -150,6 +151,10 @@ def add_interactions(resource, sequence) end end + def add_include_search(resource, sequence) + sequence[:include_params] = resource['searchInclude'] || [] + end + def add_must_support_elements(profile_definition, sequence) profile_definition['snapshot']['element'].select { |el| el['mustSupport'] }.each do |element| if element['path'].end_with? 'extension' diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index f0215065e..44b76aa73 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -66,6 +66,7 @@ def generate_tests(metadata) create_interaction_test(sequence, interaction) end + create_include_test(sequence) if sequence[:include_params].any? create_resource_profile_test(sequence) create_must_support_test(sequence) create_references_resolved_test(sequence) @@ -131,6 +132,29 @@ def create_authorization_test(sequence) sequence[:tests] << authorization_test end + def create_include_test(sequence) + include_test = { + tests_that: "A Server SHOULD be capable of supporting the following _includes: #{sequence[:include_params].join(', ')}", + index: sequence[:tests].length + 1, + link: 'https://www.hl7.org/fhir/search.html#include' + } + first_search = find_first_search(sequence) + search_params = first_search.nil? ? 'search_params = {}' : get_search_params(first_search[:names], sequence) + include_test[:test_code] = search_params + sequence[:include_params].each do |include| + included_resource = include.split(':').last.capitalize # kind of a hack, but works for now - would have to otherwise figure out resource type of target profile + include_test[:test_code] += %( + search_params['_include'] = '#{include}' + reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + #{included_resource.downcase}_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == '#{included_resource}' } + assert #{included_resource.downcase}_results.any?, 'No #{included_resource.downcase} resources were returned from this search' + ) + end + sequence[:tests] << include_test + end + def create_search_test(sequence, search_param) search_test = { tests_that: "Server returns expected results from #{sequence[:resource]} search by #{search_param[:names].join('+')}", @@ -161,7 +185,7 @@ def create_search_test(sequence, search_param) @#{sequence[:resource].downcase} = reply&.resource&.entry&.first&.resource @#{sequence[:resource].downcase}_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(#{save_resource_ids_in_bundle_arguments}) - save_delayed_sequence_references(@#{sequence[:resource].downcase}) + save_delayed_sequence_references(@#{sequence[:resource].downcase}_ary) validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params)) else %( diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb index cd3726180..ea7a2e115 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - save_delayed_sequence_references(@observation) + save_delayed_sequence_references(@observation_ary) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb index 8fa14fbf7..3a056ade2 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - save_delayed_sequence_references(@observation) + save_delayed_sequence_references(@observation_ary) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb index 50ae6e28a..98cd81982 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb @@ -80,7 +80,7 @@ def validate_resource_item(resource, property, value) @allergyintolerance = reply&.resource&.entry&.first&.resource @allergyintolerance_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('AllergyIntolerance'), reply) - save_delayed_sequence_references(@allergyintolerance) + save_delayed_sequence_references(@allergyintolerance_ary) validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb index 1562aaa8a..7cc7425b3 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb @@ -86,7 +86,7 @@ def validate_resource_item(resource, property, value) @careplan = reply&.resource&.entry&.first&.resource @careplan_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) - save_delayed_sequence_references(@careplan) + save_delayed_sequence_references(@careplan_ary) validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb index 132a5d32a..e1c74f74e 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb @@ -76,7 +76,7 @@ def validate_resource_item(resource, property, value) @careteam = reply&.resource&.entry&.first&.resource @careteam_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) - save_delayed_sequence_references(@careteam) + save_delayed_sequence_references(@careteam_ary) validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb index 0af46fcd4..1b750bd7a 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb @@ -94,7 +94,7 @@ def validate_resource_item(resource, property, value) @condition = reply&.resource&.entry&.first&.resource @condition_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Condition'), reply) - save_delayed_sequence_references(@condition) + save_delayed_sequence_references(@condition_ary) validate_search_reply(versioned_resource_class('Condition'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb index 876a0d7d5..86ce3694b 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @diagnosticreport = reply&.resource&.entry&.first&.resource @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - save_delayed_sequence_references(@diagnosticreport) + save_delayed_sequence_references(@diagnosticreport_ary) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb index c506d26f2..834829b61 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @diagnosticreport = reply&.resource&.entry&.first&.resource @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - save_delayed_sequence_references(@diagnosticreport) + save_delayed_sequence_references(@diagnosticreport_ary) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb index 0f4f47123..2f34239ef 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb @@ -102,7 +102,7 @@ def validate_resource_item(resource, property, value) @documentreference = reply&.resource&.entry&.first&.resource @documentreference_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('DocumentReference'), reply) - save_delayed_sequence_references(@documentreference) + save_delayed_sequence_references(@documentreference_ary) validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb index eeffc66d5..0776132ef 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb @@ -102,7 +102,7 @@ def validate_resource_item(resource, property, value) @encounter = reply&.resource&.entry&.first&.resource @encounter_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Encounter'), reply) - save_delayed_sequence_references(@encounter) + save_delayed_sequence_references(@encounter_ary) validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb index 70353d054..b4b1f1fc5 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb @@ -86,7 +86,7 @@ def validate_resource_item(resource, property, value) @goal = reply&.resource&.entry&.first&.resource @goal_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Goal'), reply) - save_delayed_sequence_references(@goal) + save_delayed_sequence_references(@goal_ary) validate_search_reply(versioned_resource_class('Goal'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb index 5e9b5c2fd..2e258eca5 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb @@ -86,7 +86,7 @@ def validate_resource_item(resource, property, value) @immunization = reply&.resource&.entry&.first&.resource @immunization_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Immunization'), reply) - save_delayed_sequence_references(@immunization) + save_delayed_sequence_references(@immunization_ary) validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb index 61be439ea..d7a67f73f 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb @@ -80,7 +80,7 @@ def validate_resource_item(resource, property, value) @device = reply&.resource&.entry&.first&.resource @device_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Device'), reply) - save_delayed_sequence_references(@device) + save_delayed_sequence_references(@device_ary) validate_search_reply(versioned_resource_class('Device'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb index a25990781..6dd0f221d 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb @@ -108,7 +108,7 @@ def validate_resource_item(resource, property, value) @location = reply&.resource&.entry&.first&.resource @location_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Location'), reply) - save_delayed_sequence_references(@location) + save_delayed_sequence_references(@location_ary) validate_search_reply(versioned_resource_class('Location'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb index ef33c0ba2..bafee3c4d 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb @@ -94,7 +94,7 @@ def validate_resource_item(resource, property, value) @medicationrequest = reply&.resource&.entry&.first&.resource @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) - save_delayed_sequence_references(@medicationrequest) + save_delayed_sequence_references(@medicationrequest_ary) validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) end @@ -214,9 +214,31 @@ def validate_resource_item(resource, property, value) validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) end - test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHOULD be capable of supporting the following _includes: MedicationRequest:medication' do metadata do id '09' + link 'https://www.hl7.org/fhir/search.html#include' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + intent_val = resolve_element_from_path(@medicationrequest, 'intent') + search_params = { 'patient': patient_val, 'intent': intent_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_include'] = 'MedicationRequest:medication' + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + medication_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Medication' } + assert medication_results.any?, 'No medication resources were returned from this search' + end + + test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '10' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest' description %( ) @@ -229,7 +251,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any MedicationRequest for this patient.' do metadata do - id '10' + id '11' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -267,7 +289,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '11' + id '12' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb index aba3d0adf..8eb72868a 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - save_delayed_sequence_references(@observation) + save_delayed_sequence_references(@observation_ary) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb index 74d74da66..cd829b012 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb @@ -96,7 +96,7 @@ def validate_resource_item(resource, property, value) @organization = reply&.resource&.entry&.first&.resource @organization_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Organization'), reply) - save_delayed_sequence_references(@organization) + save_delayed_sequence_references(@organization_ary) validate_search_reply(versioned_resource_class('Organization'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb index d8188b0b2..7c2c99e0a 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb @@ -105,7 +105,7 @@ def validate_resource_item(resource, property, value) @patient = reply&.resource&.entry&.first&.resource @patient_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Patient'), reply) - save_delayed_sequence_references(@patient) + save_delayed_sequence_references(@patient_ary) validate_search_reply(versioned_resource_class('Patient'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb index 50230e705..23a760897 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb @@ -103,7 +103,7 @@ def validate_resource_item(resource, property, value) @practitioner = reply&.resource&.entry&.first&.resource @practitioner_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Practitioner'), reply) - save_delayed_sequence_references(@practitioner) + save_delayed_sequence_references(@practitioner_ary) validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb index fb78e46f5..6d3118b47 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb @@ -96,7 +96,7 @@ def validate_resource_item(resource, property, value) @practitionerrole = reply&.resource&.entry&.first&.resource @practitionerrole_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('PractitionerRole'), reply) - save_delayed_sequence_references(@practitionerrole) + save_delayed_sequence_references(@practitionerrole_ary) validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) end @@ -151,9 +151,37 @@ def validate_resource_item(resource, property, value) validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) end - test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHOULD be capable of supporting the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do metadata do id '07' + link 'https://www.hl7.org/fhir/search.html#include' + description %( + ) + versions :r4 + end + + specialty_val = resolve_element_from_path(@practitionerrole, 'specialty.coding.code') + search_params = { 'specialty': specialty_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_include'] = 'PractitionerRole:endpoint' + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + endpoint_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Endpoint' } + assert endpoint_results.any?, 'No endpoint resources were returned from this search' + + search_params['_include'] = 'PractitionerRole:practitioner' + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + practitioner_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Practitioner' } + assert practitioner_results.any?, 'No practitioner resources were returned from this search' + end + + test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole' description %( ) @@ -166,7 +194,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any PractitionerRole for this patient.' do metadata do - id '08' + id '09' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -201,7 +229,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '09' + id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb index be14016c2..db4826508 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @procedure = reply&.resource&.entry&.first&.resource @procedure_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Procedure'), reply) - save_delayed_sequence_references(@procedure) + save_delayed_sequence_references(@procedure_ary) validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb index 83f56566a..b7509a2a0 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb @@ -96,7 +96,7 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply) - save_delayed_sequence_references(@observation) + save_delayed_sequence_references(@observation_ary) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb index 0b1f4da15..ffee11c05 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - save_delayed_sequence_references(@observation) + save_delayed_sequence_references(@observation_ary) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end diff --git a/lib/app/sequence_base.rb b/lib/app/sequence_base.rb index 8c2890e2f..bca737fb5 100644 --- a/lib/app/sequence_base.rb +++ b/lib/app/sequence_base.rb @@ -657,17 +657,19 @@ def validate_reference_resolutions(resource) assert(problems.empty?, problems.join("
    \n")) end - def save_delayed_sequence_references(resource) + def save_delayed_sequence_references(resources) delayed_resource_types = @@conformance_supports.select { |sequence, _resources| @@delayed_sequences.include? sequence }.values.flatten - walk_resource(resource) do |value, meta, _path| - next if meta['type'] != 'Reference' + resources.each do |resource| + walk_resource(resource) do |value, meta, _path| + next if meta['type'] != 'Reference' - if value.relative? - begin - resource_class = value.resource_class.name.demodulize - @instance.save_resource_reference(resource_class, value.reference.split('/').last) if delayed_resource_types.include? resource_class.to_sym - rescue NameError - next + if value.relative? + begin + resource_class = value.resource_class.name.demodulize + @instance.save_resource_reference(resource_class, value.reference.split('/').last) if delayed_resource_types.include? resource_class.to_sym + rescue NameError + next + end end end end From fe5d735f77c5a8089bd608509e9a3ed3470145f9 Mon Sep 17 00:00:00 2001 From: Chase Date: Wed, 16 Oct 2019 10:48:31 -0400 Subject: [PATCH 003/173] Make a little more generic --- generator/uscore/uscore_generator.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 390816f83..5e3769856 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -139,16 +139,17 @@ def create_revinclude_test(sequence) link: 'https://www.hl7.org/fhir/search.html#revinclude' } first_search = find_first_search(sequence) - search_params = first_search.nil? ? 'search_params = {}' : get_search_params(first_search[:names], sequence) + search_params = first_search.nil? ? "\nsearch_params = {}" : get_search_params(first_search[:names], sequence) + revinclude_test[:test_code] = search_params sequence[:revincludes].each do |revinclude| - revinclude_test[:test_code] = %( - #{search_params} + resource_type = revinclude.split(':').first.downcase + revinclude_test[:test_code] += %( search_params['_revinclude'] = '#{revinclude}' reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == '#{revinclude.split(':').first}' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + #{resource_type}_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == '#{revinclude.split(':').first}' } + assert #{resource_type}_results.any?, 'No #{resource_type} resources were returned from this search' ) end sequence[:tests] << revinclude_test From cbda7d22bbb739ddbd0b658755a99945f9337e58 Mon Sep 17 00:00:00 2001 From: Chase Date: Wed, 16 Oct 2019 11:31:10 -0400 Subject: [PATCH 004/173] fix delayed resource test --- test/unit/sequence_base_test.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/unit/sequence_base_test.rb b/test/unit/sequence_base_test.rb index 2bb8e4f8f..670d9cb7b 100644 --- a/test/unit/sequence_base_test.rb +++ b/test/unit/sequence_base_test.rb @@ -33,12 +33,12 @@ def test_save_delayed_resource_references delayed_resources.each do |res| set_resource_reference(@allergy_intolerance_resource, res) - @sequence.save_delayed_sequence_references(@allergy_intolerance_resource) + @sequence.save_delayed_sequence_references(Array.wrap(@allergy_intolerance_resource)) assert @instance.resource_references.any? { |ref| ref.resource_type == res }, "#{res} reference should be saved" end some_non_delayed_resources.each do |res| set_resource_reference(@allergy_intolerance_resource, res) - @sequence.save_delayed_sequence_references(@allergy_intolerance_resource) + @sequence.save_delayed_sequence_references(Array.wrap(@allergy_intolerance_resource)) assert @instance.resource_references.none? { |ref| ref.resource_type == res }, "#{res} reference should not be saved" end end From 2fe27eab640f369af28cc279b1b2dda0c23b6406 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 16 Oct 2019 12:13:07 -0400 Subject: [PATCH 005/173] Add discovery sequence --- config.yml | 1 + .../bulk_data/bulk_data_discovery_sequence.rb | 185 ++++++++++++++++++ lib/app/modules/bulk_data_module.yml | 1 + 3 files changed, 187 insertions(+) create mode 100644 lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb diff --git a/config.yml b/config.yml index 4dd5124f5..9316637e3 100644 --- a/config.yml +++ b/config.yml @@ -44,6 +44,7 @@ modules: - smart - argonaut - uscore_v3.0.0 + - bulk_data # preset fhir servers: optional. Minimally requires name, uri, module, optional inferno_uri, client_id, client_secret, scopes, instructions link presets: diff --git a/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb b/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb new file mode 100644 index 000000000..49a68b7b7 --- /dev/null +++ b/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb @@ -0,0 +1,185 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class BulkDataDiscoverySequence < SequenceBase + title 'Bulk Data Discovery' + + test_id_prefix 'Discovery' + + requires :url + defines :oauth_authorize_endpoint, :oauth_token_endpoint, :oauth_register_endpoint + + description "Retrieve server's SMART on FHIR configuration" + + details %( + # Background + + The #{title} Sequence test looks for authorization endpoints and SMART + capabilities as described by the [SMART Backend Services: Authorization + Guide](https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html). + ) + + WELL_KNOWN_FIELDS = [ + 'token_endpoint', + 'scopes_supported', + 'token_endpoint_auth_methods_supported', + 'token_endpoint_auth_signing_alg_values_supported' + ].freeze + + + SMART_OAUTH_EXTENSION_URL = 'http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris' + + REQUIRED_OAUTH_ENDPOINTS = [ + { url: 'authorize', description: 'authorization' }, + { url: 'token', description: 'token' } + ].freeze + + OPTIONAL_OAUTH_ENDPOINTS = [ + { url: 'register', description: 'dynamic registration' }, + { url: 'manage', description: 'authorization management' }, + { url: 'introspect', description: 'token introspection' }, + { url: 'revoke', description: 'token revocation' } + ].freeze + + test 'Retrieve Configuration from well-known endpoint' do + metadata do + id '01' + link 'http://www.hl7.org/fhir/smart-app-launch/conformance/#using-well-known' + description %( + The authorization endpoints accepted by a FHIR resource server can + be exposed as a Well-Known Uniform Resource Identifier + ) + optional + end + + well_known_configuration_url = @instance.url.chomp('/') + '/.well-known/smart-configuration' + well_known_configuration_response = LoggedRestClient.get(well_known_configuration_url) + assert_response_ok(well_known_configuration_response) + assert_response_content_type(well_known_configuration_response, 'application/json') + assert_valid_json(well_known_configuration_response.body) + + @well_known_configuration = JSON.parse(well_known_configuration_response.body) + @well_known_authorize_url = @well_known_configuration['authorization_endpoint'] + @well_known_token_url = @well_known_configuration['token_endpoint'] + @well_known_register_url = @well_known_configuration['registration_endpoint'] + @well_known_manage_url = @well_known_configuration['management_endpoint'] + @well_known_introspect_url = @well_known_configuration['introspection_endpoint'] + @well_known_revoke_url = @well_known_configuration['revocation_endpoint'] + + @instance.update( + oauth_authorize_endpoint: @well_known_authorize_url, + oauth_token_endpoint: @well_known_token_url, + oauth_register_endpoint: @well_known_configuration['registration_endpoint'] + ) + + assert @well_known_configuration.present?, 'No .well-known/smart-configuration body' + end + + test 'Configuration from well-known endpoint contains required fields' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#advertising-server-conformance-with-smart-backend-services' + description %( + The JSON from .well-known/smart-configuration contains the following + required fields: #{WELL_KNOWN_FIELDS.map { |field| "`#{field}`" }.join(', ')} + ) + optional + end + + skip 'Server does NOT provide .well-known endpoint' unless @well_known_configuration.present? + + missing_fields = WELL_KNOWN_FIELDS - @well_known_configuration.keys + assert missing_fields.empty?, "The following required fields are missing: #{missing_fields.join(', ')}" + end + + test 'Conformance/Capability Statement provides OAuth 2.0 endpoints' do + metadata do + id '03' + link 'http://hl7.org/fhir/smart-app-launch/conformance/index.html#using-cs' + description %( + If a server requires SMART on FHIR authorization for access, its + metadata must support automated discovery of OAuth2 endpoints. + ) + optional + end + + @conformance = @client.conformance_statement + oauth_metadata = @client.get_oauth2_metadata_from_conformance(false) # strict mode off, don't require server to state smart conformance + + assert oauth_metadata.present?, 'No OAuth Metadata in Conformance/CapabiliytStatemeent resource' + + REQUIRED_OAUTH_ENDPOINTS.each do |endpoint| + url = oauth_metadata[:"#{endpoint[:url]}_url"] + instance_variable_set(:"@conformance_#{endpoint[:url]}_url", url) + + assert url.present?, "No #{endpoint[:description]} URI provided in Conformance/CapabilityStatement resource" + assert_valid_http_uri url, "Invalid #{endpoint[:description]} url: '#{url}'" + end + + warning do + services = [] + @conformance.try(:rest)&.each do |endpoint| + endpoint.try(:security).try(:service)&.each do |sec_service| + sec_service.try(:coding)&.each do |coding| + services << coding.code + end + end + end + + assert !services.empty?, 'No security services listed. Conformance/CapabilityStatement.rest.security.service should be SMART-on-FHIR.' + assert services.any? { |service| service == 'SMART-on-FHIR' }, "Conformance/CapabilityStatement.rest.security.service set to #{services.map { |e| "'" + e + "'" }.join(', ')}. It should contain 'SMART-on-FHIR'." + end + + security_extensions = + @conformance.rest.first.security&.extension + &.find { |extension| extension.url == SMART_OAUTH_EXTENSION_URL } + &.extension + + OPTIONAL_OAUTH_ENDPOINTS.each do |endpoint| + warning do + url = + security_extensions + &.find { |extension| extension.url == endpoint[:url] } + &.value + + assert url.present?, "No #{endpoint[:description]} endpoint in conformance." + assert_valid_http_uri url, "Invalid #{endpoint[:description]} url: '#{url}'" + instance_variable_set(:"@conformance_#{endpoint[:url]}_url", url) + end + end + + @instance.update( + oauth_authorize_endpoint: @conformance_authorize_url, + oauth_token_endpoint: @conformance_token_url, + oauth_register_endpoint: @conformance_register_url + ) + end + + # test 'OAuth Endpoints must be the same in the conformance statement and well known endpoint' do + # metadata do + # id '05' + # link 'http://hl7.org/fhir/smart-app-launch/conformance/index.html#using-cs' + # description %( + # If a server requires SMART on FHIR authorization for access, its + # metadata must support automated discovery of OAuth2 endpoints. + # ) + # end + + # (REQUIRED_OAUTH_ENDPOINTS + OPTIONAL_OAUTH_ENDPOINTS).each do |endpoint| + # url = endpoint[:url] + # well_known_url = instance_variable_get(:"@well_known_#{url}_url") + # conformance_url = instance_variable_get(:"@conformance_#{url}_url") + + # assert well_known_url == conformance_url, %( + # The #{endpoint[:description]} url is not consistent between the + # well-known configuration and the conformance statement: + + # Well-known #{url} url: #{well_known_url} + # Conformance #{url} url: #{conformance_url} + # ) + # end + # end + end + end +end diff --git a/lib/app/modules/bulk_data_module.yml b/lib/app/modules/bulk_data_module.yml index f204be5df..246634341 100644 --- a/lib/app/modules/bulk_data_module.yml +++ b/lib/app/modules/bulk_data_module.yml @@ -10,6 +10,7 @@ test_sets: - name: Discovery sequences: - BulkDataCapabilityStatementSequence + - BulkDataDiscoverySequence - name: Group Export sequences: - BulkDataGroupExportSequence From 77c635df7f8966bac1069c52779e40bd6100b152 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 16 Oct 2019 12:39:48 -0400 Subject: [PATCH 006/173] fix rubocop --- lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb b/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb index 49a68b7b7..fec90eef7 100644 --- a/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb +++ b/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb @@ -16,7 +16,7 @@ class BulkDataDiscoverySequence < SequenceBase # Background The #{title} Sequence test looks for authorization endpoints and SMART - capabilities as described by the [SMART Backend Services: Authorization + capabilities as described by the [SMART Backend Services: Authorization Guide](https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html). ) @@ -27,7 +27,6 @@ class BulkDataDiscoverySequence < SequenceBase 'token_endpoint_auth_signing_alg_values_supported' ].freeze - SMART_OAUTH_EXTENSION_URL = 'http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris' REQUIRED_OAUTH_ENDPOINTS = [ From a1d7b1783e1e0602b426cbec5441636af4c0437f Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 10 Oct 2019 16:06:48 -0400 Subject: [PATCH 007/173] add ast and parser gems --- Gemfile | 2 ++ Gemfile.lock | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Gemfile b/Gemfile index f866d18c8..704d2e0a1 100644 --- a/Gemfile +++ b/Gemfile @@ -3,6 +3,7 @@ source 'https://rubygems.org' gem 'addressable' +gem 'ast' gem 'base62-rb' gem 'bloomer' gem 'colorize' @@ -11,6 +12,7 @@ gem 'dm-sqlite-adapter' gem 'fhir_client' gem 'json-jwt' gem 'kramdown' +gem 'parser' gem 'pry' gem 'pry-byebug' gem 'rake' diff --git a/Gemfile.lock b/Gemfile.lock index db1a9f455..28d969c16 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -228,6 +228,7 @@ PLATFORMS DEPENDENCIES addressable + ast base62-rb bloomer colorize @@ -237,6 +238,7 @@ DEPENDENCIES json-jwt kramdown minitest + parser pry pry-byebug rack-test From c95ba4719297363205b9d55878d9ba6c311d273b Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 10 Oct 2019 16:04:00 -0400 Subject: [PATCH 008/173] WIP locate assertions in sequences --- find_assertions.rb | 65 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 find_assertions.rb diff --git a/find_assertions.rb b/find_assertions.rb new file mode 100644 index 000000000..c9e93a87c --- /dev/null +++ b/find_assertions.rb @@ -0,0 +1,65 @@ +require 'ast' +require 'parser/current' +require 'pry' +require_relative './lib/app/utils/assertions' + +# AST processor to find the location of each assertion in a sequence +class SequenceProcessor + include AST::Processor::Mixin + + attr_reader :file_name + + def initialize(file_name) + @file_name = file_name + end + + def handler_missing(node) + node.children.each { |child| process(child) if child.respond_to? :to_ast } + end + + def on_send(node) + _, method_name = *node + AssertionTracker.add_assertion_location(location(node)) if AssertionTracker.assertion? method_name + end + + def location(node) + "#{stripped_file_name}:#{node.loc.line}" + end + + def stripped_file_name + @stripped_file_name ||= file_name.split('lib/app/modules/').last + end +end + +# Store the location of each assertion in a sequence +class AssertionTracker + class << self + def assertion_method_names + @assertion_method_names ||= Set.new(Inferno::Assertions.instance_methods) + end + + def assertion_locations + @assertion_locations ||= [] + end + + def assertion?(method_name) + assertion_method_names.include? method_name + end + + def add_assertion_location(location) + assertion_locations << location + end + end +end + +sequence_paths = File.join(__dir__, 'lib', 'app', 'modules', '*', '*.rb') + +Dir.glob(sequence_paths).sort.each do |sequence_file_name| + file_contents = File.read(sequence_file_name) + ast = Parser::CurrentRuby.parse(file_contents) + + processor = SequenceProcessor.new(sequence_file_name) + processor.process(ast) +end + +puts AssertionTracker.assertion_locations From 34729040accf015f632ea94811ef0ede618fdbeb Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 11 Oct 2019 13:37:46 -0400 Subject: [PATCH 009/173] WIP track assertion calls --- find_assertions.rb | 33 ++++++++++++++++++++++++++++++++- lib/app/utils/assertions.rb | 6 ++++++ test/test_helper.rb | 5 +++++ 3 files changed, 43 insertions(+), 1 deletion(-) diff --git a/find_assertions.rb b/find_assertions.rb index c9e93a87c..e32e2be8b 100644 --- a/find_assertions.rb +++ b/find_assertions.rb @@ -42,6 +42,10 @@ def assertion_locations @assertion_locations ||= [] end + def assertion_calls + @assertion_calls ||= Hash.new { |hash, key| hash[key] = [] } + end + def assertion?(method_name) assertion_method_names.include? method_name end @@ -49,6 +53,33 @@ def assertion?(method_name) def add_assertion_location(location) assertion_locations << location end + + def add_assertion_call(location, result) + assertion_calls[location] << result + end + end +end + +class AssertionReporter + class << self + def print + AssertionTracker.assertion_locations.sort.each do |location| + results = AssertionTracker.assertion_calls[location] + puts "#{location.ljust(location_width)} Pass: #{pass_count(results).to_s.rjust(3)} Fail: #{fail_count(results).to_s.rjust(3)}" + end + end + + def location_width + @location_width ||= AssertionTracker.assertion_calls.keys.max_by(&:length).length + end + + def pass_count(results) + results.count { |result| result } + end + + def fail_count(results) + results.count { |result| !result } + end end end @@ -62,4 +93,4 @@ def add_assertion_location(location) processor.process(ast) end -puts AssertionTracker.assertion_locations +puts "\n### Assertion locations loaded ###\n\n" diff --git a/lib/app/utils/assertions.rb b/lib/app/utils/assertions.rb index 70ac012bb..d51af8112 100644 --- a/lib/app/utils/assertions.rb +++ b/lib/app/utils/assertions.rb @@ -6,6 +6,12 @@ module Inferno module Assertions def assert(test, message = 'assertion failed, no message', data = '') + if ENV['RACK_ENV'] == 'test' + sequence_line_regex = /inferno\/lib\/app\/modules\/(\w+\/\w+\.rb:\d+)/ + backtrace_location = caller_locations.find { |location| location.to_s.match? sequence_line_regex } + call_site = backtrace_location&.to_s&.match(sequence_line_regex)&.[](1) + AssertionTracker.add_assertion_call(call_site, !!test) if call_site.present? + end raise AssertionException.new message, data unless test end diff --git a/test/test_helper.rb b/test/test_helper.rb index 71ae739d2..2c8a9fbba 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -10,10 +10,15 @@ require 'webmock/minitest' require 'rack/test' require 'json/jwt' +require_relative '../find_assertions' test_log_filename = File.join('tmp', 'test.log') FileUtils.rm test_log_filename if File.exist? test_log_filename +MiniTest.after_run { + AssertionReporter.print +} + require_relative '../lib/app' def load_json_fixture(file) From e5b0e164e5bc4ed73f3b58ca39db66766aa84224 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 15 Oct 2019 15:07:53 -0400 Subject: [PATCH 010/173] remove unused assertions and add assertion unit tests --- lib/app/utils/assertions.rb | 78 ----------- lib/app/utils/tls_tester.rb | 2 +- test/unit/assertions_test.rb | 251 ++++++++++++++++++++++++++++++++--- 3 files changed, 237 insertions(+), 94 deletions(-) diff --git a/lib/app/utils/assertions.rb b/lib/app/utils/assertions.rb index d51af8112..02f230ef5 100644 --- a/lib/app/utils/assertions.rb +++ b/lib/app/utils/assertions.rb @@ -40,12 +40,6 @@ def assert_response_accepted(response) raise AssertionException, "Bad response code: expected 202, but found #{response.code}" end - def assert_response_not_found(response) - return if assertion_negated([404].include?(response.code)) - - raise AssertionException, "Bad response code: expected 404, but found #{response.code}" - end - def assert_response_unauthorized(response) return if assertion_negated([401, 406].include?(response.code)) @@ -64,18 +58,6 @@ def assert_response_bad(response) raise AssertionException, "Bad response code: expected 400, but found #{response.code}" end - def assert_response_conflict(response) - return if assertion_negated([409, 412].include?(response.code)) - - raise AssertionException, "Bad response code: expected 409 or 412, but found #{response.code}" - end - - def assert_navigation_links(bundle) - return if assertion_negated(bundle.first_link && bundle.last_link && bundle.next_link) - - raise AssertionException, 'Expecting first, next and last link to be present' - end - def assert_bundle_response(response) return if assertion_negated(response.resource.class == FHIR::DSTU2::Bundle || response.resource.class == FHIR::Bundle) @@ -89,19 +71,6 @@ def assert_bundle_response(response) raise AssertionException, "Expected FHIR Bundle but found: #{found.class.name.demodulize}" end - def assert_bundle_transactions_okay(response) - response.resource.entry.each do |entry| - unless assertion_negated(!entry.response.nil?) - raise AssertionException, 'All Transaction/Batch Bundle.entry elements SHALL have a response.' - end - - status = entry.response.status - unless assertion_negated(status && status.start_with?('200', '201', '204')) - raise AssertionException, "Expected all Bundle.entry.response.status to be 200, 201, or 204; but found: #{status}" - end - end - end - def assert_response_content_type(reply, content_type) header = if reply.respond_to? :response # response from FHIR::Client reply.response[:headers]['content-type'] @@ -116,53 +85,6 @@ def assert_response_content_type(reply, content_type) raise AssertionException.new "Expected content-type #{content_type} but found #{response_content_type}", response_content_type end - # Based on MIME Types defined in - # http://hl7.org/fhir/2015May/http.html#2.1.0.6 - def assert_valid_resource_content_type_present(client_reply) - header = client_reply.response[:headers]['content-type'] - content_type = header - charset = encoding = nil - - content_type = header[0, header.index(';')] unless header.index(';').nil? - charset = header[header.index('charset=') + 8..-1] unless header.index('charset=').nil? - encoding = Encoding.find(charset) unless charset.nil? - - unless assertion_negated(encoding == Encoding::UTF_8) - raise AssertionException.new "Response content-type specifies encoding other than UTF-8: #{charset}", header - end - - return if assertion_negated((content_type == FHIR::Formats::ResourceFormat::RESOURCE_XML) || (content_type == FHIR::Formats::ResourceFormat::RESOURCE_JSON)) - - raise AssertionException.new "Invalid FHIR content-type: #{content_type}", header - end - - def assert_etag_present(client_reply) - header = client_reply.response[:headers]['etag'] - assert assertion_negated(!header.nil?), 'ETag HTTP header is missing.' - end - - def assert_last_modified_present(client_reply) - header = client_reply.response[:headers]['last-modified'] - assert assertion_negated(!header.nil?), 'Last-modified HTTP header is missing.' - end - - def assert_valid_content_location_present(client_reply) - header = client_reply.response[:headers]['location'] - assert assertion_negated(!header.nil?), 'Location HTTP header is missing.' - end - - def assert_response_code(response, code) - return if assertion_negated(code.to_s == response.code.to_s) - - raise AssertionException, "Bad response code: expected #{code}, but found #{response.code}" - end - - def assert_resource_type(response, resource_type) - return if assertion_negated(!response.resource.nil? && response.resource.class == resource_type) - - raise AssertionException, "Bad response type: expected #{resource_type}, but found #{response.resource.class}." - end - def assertion_negated(expression) @negated ? !expression : expression end diff --git a/lib/app/utils/tls_tester.rb b/lib/app/utils/tls_tester.rb index 5a18c0393..4729d059e 100644 --- a/lib/app/utils/tls_tester.rb +++ b/lib/app/utils/tls_tester.rb @@ -57,7 +57,7 @@ def verify_deny_protocol(ssl_version, readable_version) http.max_version = ssl_version http.verify_mode = OpenSSL::SSL::VERIFY_PEER begin - http.request_get(@host) + http.request_get(@uri) rescue StandardError => e return true, "Correctly denied connection error of type #{e.class} happened, message is #{e.message}" end diff --git a/test/unit/assertions_test.rb b/test/unit/assertions_test.rb index ff49bf90e..f21c3b81e 100644 --- a/test/unit/assertions_test.rb +++ b/test/unit/assertions_test.rb @@ -2,29 +2,250 @@ require File.expand_path '../test_helper.rb', __dir__ -class AssertionsTest < MiniTest::Test - def setup - # Create an instance of an anonymous class to wrap Inferno's assertions which collide/conflct with the tests methods +describe Inferno::Assertions do + before do + # Create an instance of an anonymous class to wrap Inferno's assertions + # which collide/conflct with the tests methods @inferno_asserter = Class.new do include Inferno::Assertions end.new end + MESSAGE = 'MESSAGE' + DATA = 'DATA' - def test_assert_tls_1_2 - WebMock.reset! - stub_request(:any, 'https://www.example.org/') + describe '#assert' do + it 'raises an AssertionException if test is falsy' do + exception = assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert(false, MESSAGE, DATA) + end - result, msg = @inferno_asserter.assert_tls_1_2('https://www.example.org/') - result = true if result.nil? - assert result, msg + assert_equal(exception.message, MESSAGE) + assert_equal(exception.details, DATA) + end + + it 'does not raise an exception if test is truthy' do + @inferno_asserter.assert(true, MESSAGE, DATA) + end + end + + describe '#assert_equal' do + it 'raises an AssertionException if its arguments are not equal' do + exception = assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_equal(1, 2, MESSAGE, DATA) + end + + assert_equal(exception.message, MESSAGE + ' Expected: 1, but found: 2.') + assert_equal(exception.details, DATA) + end + + it 'does not raise an exception if its arguments are equal' do + @inferno_asserter.assert_equal(1, 1, MESSAGE, DATA) + end + end + + describe '#assert_response_ok' do + it 'raises an AssertionException for status codes other than 200 and 201' do + bad_response = OpenStruct.new(code: 400) + exception = assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_response_ok(bad_response, MESSAGE) + end + + assert exception.message.end_with? MESSAGE + end + + it 'does not raise an exception for status codes 200 and 201' do + [200, 201].each do |status| + response = OpenStruct.new(code: status) + @inferno_asserter.assert_response_ok(response, MESSAGE) + end + end + end + + describe '#assert_response_accepted' do + it 'raises an AssertionException for status codes other than 202' do + bad_response = OpenStruct.new(code: 200) + assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_response_accepted(bad_response) + end + end + + it 'does not raise an exception for status code 202' do + response = OpenStruct.new(code: 202) + @inferno_asserter.assert_response_accepted(response) + end end - def test_assert_deny_previous_tls - WebMock.reset! - stub_request(:any, 'https://www.example.org/') + describe '#assert_response_unauthorized' do + it 'raises an AssertionException for status codes other than 401 and 406' do + bad_response = OpenStruct.new(code: 200) + assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_response_unauthorized(bad_response) + end + end + + it 'does not raise an exception for status codes 401 and 406' do + [401, 406].each do |status| + response = OpenStruct.new(code: status) + @inferno_asserter.assert_response_unauthorized(response) + end + end + end + + describe '#assert_response_bad_or_unauthorized' do + it 'raises an AssertionException for status codes other than 400 and 401' do + bad_response = OpenStruct.new(code: 200) + exception = assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_response_bad_or_unauthorized(bad_response) + end + + assert_equal exception.message, 'Bad response code: expected 400 or 401, but found 200' + end + + it 'does not raise an exception for status codes 400 and 401' do + [400, 401].each do |status| + response = OpenStruct.new(code: status) + @inferno_asserter.assert_response_bad_or_unauthorized(response) + end + end + end + + describe '#assert_response_bad' do + it 'raises an AssertionException for status codes other than 400' do + bad_response = OpenStruct.new(code: 200) + assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_response_bad(bad_response) + end + end + + it 'does not raise an exception for status code 400' do + response = OpenStruct.new(code: 400) + @inferno_asserter.assert_response_bad(response) + end + end + + describe '#assert_response_bad' do + it 'raises an AssertionException when the response does not include a Bundle' do + [nil, FHIR::OperationOutcome.new].each do |not_bundle| + bad_response = OpenStruct.new(resource: not_bundle) + assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_bundle_response(bad_response) + end + end + end + + it 'does not raise an exception when the response includes a Bundle' do + [FHIR::Bundle.new, FHIR::DSTU2::Bundle.new].each do |bundle| + response = OpenStruct.new(resource: bundle) + @inferno_asserter.assert_bundle_response(response) + end + end + end + + describe '#assert_response_content_type' do + it 'raises an AssertionException when the content-type does not match' do + bad_response = OpenStruct.new(response: { headers: { 'content-type' => 'ABC' } }) + assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_response_content_type(bad_response, 'XYZ') + end + end + + it 'does not raise an exception when the content-type matches' do + content_type = 'ABC' + fhir_client_response = { response: { headers: { 'content-type' => content_type } } } + rest_client_response = { headers: { content_type: content_type } } + [fhir_client_response, rest_client_response].each do |response_hash| + response = OpenStruct.new(response_hash) + @inferno_asserter.assert_response_content_type(response, content_type) + end + end + end + + describe '#assert_tls_1_2' do + before do + WebMock.reset! + end + + it 'raises an error for non-https urls ' do + url = 'http://www.example.com/' + stub_request(:any, url) + + assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_tls_1_2(url) + end + end + + it 'does not raise an error if the url supports TSL 1.2' do + url = 'https://www.example.com/' + stub_request(:any, url) + + @inferno_asserter.assert_tls_1_2(url) + end + end + + describe '#assert_deny_previous_tls' do + it 'does not raise an error if the requests cause an error' do + WebMock.reset! + url = 'https://www.example.com/' + stub_request(:any, url).to_raise(StandardError) + @inferno_asserter.assert_deny_previous_tls(url) + end + end + + describe '#assert_valid_http_uri' do + it 'raises on error for non-url strings' do + non_url = 'abc' + exception = assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_valid_http_uri(non_url, MESSAGE) + end + + assert_equal(exception.message, MESSAGE) + end + + it 'does not raise an error for urls' do + urls = ['http://www.example.com', 'https://www.example.com'] + urls.each do |url| + @inferno_asserter.assert_valid_http_uri(url) + end + end + end + + describe '#assert_operation_supported' do + it 'raises an error when the operation is not supported' do + operation = 'operation' + capabilities = Minitest::Mock.new + capabilities.expect :operation_supported?, false, [operation] + + assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_operation_supported(capabilities, operation) + end + end + + it 'does not raise an error when teh operatin is supported' do + operation = 'operation' + capabilities = Minitest::Mock.new + capabilities.expect :operation_supported?, true, [operation] + + @inferno_asserter.assert_operation_supported(capabilities, operation) + end + end + + describe '#assert_valid_conformance' do + it 'raises an error when the conformance classes do not match' do + def @inferno_asserter.versioned_conformance_class + FHIR::DSTU2::Conformance + end + + assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_valid_conformance(FHIR::CapabilityStatement.new) + end + end + + it 'does not raise an error when the conformance classes match' do + def @inferno_asserter.versioned_conformance_class + FHIR::CapabilityStatement + end - result, msg = @inferno_asserter.assert_deny_previous_tls('https://www.example.org/') - result = true if result.nil? - assert result, msg + @inferno_asserter.assert_valid_conformance(FHIR::CapabilityStatement.new) + end end end From d23996449c7264fb9821f8ef4937594995b8543d Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 16 Oct 2019 08:41:56 -0400 Subject: [PATCH 011/173] refactor assertions --- lib/app/utils/assertions.rb | 247 +++++++++++++++++------------------- 1 file changed, 115 insertions(+), 132 deletions(-) diff --git a/lib/app/utils/assertions.rb b/lib/app/utils/assertions.rb index 02f230ef5..9723e60a1 100644 --- a/lib/app/utils/assertions.rb +++ b/lib/app/utils/assertions.rb @@ -7,11 +7,12 @@ module Inferno module Assertions def assert(test, message = 'assertion failed, no message', data = '') if ENV['RACK_ENV'] == 'test' - sequence_line_regex = /inferno\/lib\/app\/modules\/(\w+\/\w+\.rb:\d+)/ + sequence_line_regex = %r{inferno/lib/app/modules/(\w+/\w+\.rb:\d+)} backtrace_location = caller_locations.find { |location| location.to_s.match? sequence_line_regex } call_site = backtrace_location&.to_s&.match(sequence_line_regex)&.[](1) AssertionTracker.add_assertion_call(call_site, !!test) if call_site.present? end + raise AssertionException.new message, data unless test end @@ -22,53 +23,58 @@ def assert_valid_json(json) end def assert_equal(expected, actual, message = '', data = '') - return if assertion_negated(expected == actual) - message += " Expected: #{expected}, but found: #{actual}." - raise AssertionException.new message, data + assert expected == actual, message, data end def assert_response_ok(response, error_message = '') - return if assertion_negated([200, 201].include?(response.code)) - - raise AssertionException, "Bad response code: expected 200, 201, but found #{response.code}. #{error_message}" + message = "Bad response code: expected 200, 201, but found #{response.code}. #{error_message}" + assert [200, 201].include?(response.code), message end def assert_response_accepted(response) - return if assertion_negated([202].include?(response.code)) - - raise AssertionException, "Bad response code: expected 202, but found #{response.code}" + message = "Bad response code: expected 202, but found #{response.code}" + assert response.code == 202, message end def assert_response_unauthorized(response) - return if assertion_negated([401, 406].include?(response.code)) - - raise AssertionException, "Bad response code: expected 401 or 406, but found #{response.code}" + message = "Bad response code: expected 401 or 406, but found #{response.code}" + assert [401, 406].include?(response.code), message end def assert_response_bad_or_unauthorized(response) - return if assertion_negated([400, 401].include?(response.code)) - - raise AssertionException, "Bad response code: expected 400 or 401, but found #{response.code}" + message = "Bad response code: expected 400 or 401, but found #{response.code}" + assert [400, 401].include?(response.code), message end def assert_response_bad(response) - return if assertion_negated([400].include?(response.code)) - - raise AssertionException, "Bad response code: expected 400, but found #{response.code}" + message = "Bad response code: expected 400, but found #{response.code}" + assert response.code == 400, message end def assert_bundle_response(response) - return if assertion_negated(response.resource.class == FHIR::DSTU2::Bundle || response.resource.class == FHIR::Bundle) + message = "Expected FHIR Bundle but found: #{resource_class(response)}" + assert response.resource.class.name.demodulize == 'Bundle', message + end - # check what this is... - found = response.resource - begin - found = resource_from_contents(response.body) - rescue StandardError - found = nil - end - raise AssertionException, "Expected FHIR Bundle but found: #{found.class.name.demodulize}" + def resource_class(response) + resource = + begin + resource_from_contents(response.body) + rescue StandardError + nil + end + resource.class.name.demodulize + end + + def base_header(header) + return header unless header.include? ';' + + header[0, header.index(';')] + end + + def header_charset(header) + header[header.index('charset=') + 8..-1] if header.include? 'charset=' end def assert_response_content_type(reply, content_type) @@ -77,144 +83,121 @@ def assert_response_content_type(reply, content_type) else # response from LoggedRestClient reply.headers[:content_type] end - response_content_type = header - response_content_type = header[0, header.index(';')] unless header.index(';').nil? - - return if assertion_negated(response_content_type == content_type) + response_content_type = base_header(header) - raise AssertionException.new "Expected content-type #{content_type} but found #{response_content_type}", response_content_type - end - - def assertion_negated(expression) - @negated ? !expression : expression + message = "Expected content-type #{content_type} but found #{response_content_type}" + assert response_content_type == content_type, message, response_content_type end def assert_tls_1_2(uri) tls_tester = TlsTester.new(uri: uri) - unless uri.downcase.start_with?('https') - raise AssertionException.new "URI is not HTTPS: #{uri}", %( - - The following URI does not use the HTTPS protocol identifier: - - [#{uri}](#{uri}) - - The HTTPS protocol identifier is required for TLS connections. - - HTTP/TLS is differentiated from HTTP by using the `https` - protocol identifier in place of the `http` protocol identifier. An - example URI specifying HTTP/TLS is: - `https://www.example.org` - - [HTTP Over TLS](https://tools.ietf.org/html/rfc2818#section-2.4) - - - In order to fix this error you must secure this endpoint with TLS 1.2 and ensure that references - to this URL point to the HTTPS protocol so that use of TLS is explicit. - - You may safely ignore this error if this environment does not secure content using TLS. If you are - running a local copy of Inferno, you can turn off TLS detection by changing setting the `disable_tls_tests` - option to false in `config.yml`. - ) - end - + assert uri.downcase.start_with?('https'), "URI is not HTTPS: #{uri}", uri_not_https_details(uri) begin - passed, msg, details = tls_tester.verify_ensure_tls_v1_2 - raise AssertionException.new msg, details unless passed + passed, message, details = tls_tester.verify_ensure_tls_v1_2 + assert passed, message, details rescue SocketError => e - raise AssertionException.new "Unable to connect to #{uri}: #{e.message}", %( - The following URI did not accept socket connections over port 443: - - [#{uri}](#{uri}) + assert false, "Unable to connect to #{uri}: #{e.message}", tls_socket_error_details(uri) + rescue StandardError => e + assert false, + "Unable to connect to #{uri}: #{e.class.name}, #{e.message}", + tls_unexpected_error_details(uri) + end + end - ``` - When HTTP/TLS is being run over a TCP/IP connection, the default port - is 443. - ``` - [HTTP Over TLS](https://tools.ietf.org/html/rfc2818#section-2.3) + def assert_deny_previous_tls(uri) + tls_tester = TlsTester.new(uri: uri) + begin + passed, message, details = tls_tester.verify_deny_ssl_v3 + assert passed, message, details - To fix this error ensure that the URI uses TLS. + passed, message, details = tls_tester.verify_deny_tls_v1_1 + assert passed, message, details - You may safely ignore this error if this environment does not secure content using TLS. If you are - running a local copy of Inferno, you can turn off TLS detection by changing setting the `disable_tls_tests` - option to false in `config.yml`. - ) + passed, message, details = tls_tester.verify_deny_tls_v1 + assert passed, message, details + rescue SocketError => e + assert false, "Unable to connect to #{uri}: #{e.message}", tls_socket_error_details(uri) rescue StandardError => e - raise AssertionException.new "Unable to connect to #{uri}: #{e.class.name}, #{e.message}", %( - An unexpected error occurred when attempting to connect to the following URI using TLS. + assert false, + "Unable to connect to #{uri}: #{e.class.name}, #{e.message}", + tls_unexpected_error_details(uri) + end + end - [#{uri}](#{uri}) + def assert_valid_http_uri(uri, message = nil) + error_message = message || "\"#{uri}\" is not a valid URI" + assert (uri =~ /\A#{URI.regexp(['http', 'https'])}\z/), error_message + end - Ensure that this URI is protected by TLS. + def assert_operation_supported(server_capabilities, op_name) + assert server_capabilities.operation_supported?(op_name), + "FHIR server capability statement did not support #{op_name} operation" + end - You may safely ignore this error if this environment does not secure content using TLS. If you are - running a local copy of Inferno, you can turn off TLS detection by changing setting the `disable_tls_tests` - option to false in `config.yml`. - ) - end + def assert_valid_conformance(conformance = @conformance) + conformance_resource_name = versioned_conformance_class.name.demodulize + assert conformance.class == versioned_conformance_class, + "Expected valid #{conformance_resource_name} resource." end - def assert_deny_previous_tls(uri) - tls_tester = TlsTester.new(uri: uri) + def uri_not_https_details(uri) + %( + The following URI does not use the HTTPS protocol identifier: - begin - passed, msg, details = tls_tester.verify_deny_ssl_v3 - raise AssertionException.new msg, details unless passed + [#{uri}](#{uri}) - passed, msg, details = tls_tester.verify_deny_tls_v1_1 - raise AssertionException.new msg, details unless passed + The HTTPS protocol identifier is required for TLS connections. - passed, msg, details = tls_tester.verify_deny_tls_v1 - raise AssertionException.new msg, details unless passed - rescue SocketError => e - raise AssertionException.new "Unable to connect to #{uri}: #{e.message}", %( - The following URI did not accept socket connections over port 443: + HTTP/TLS is differentiated from HTTP by using the `https` + protocol identifier in place of the `http` protocol identifier. An + example URI specifying HTTP/TLS is: + `https://www.example.org` - [#{uri}](#{uri}) + [HTTP Over TLS](https://tools.ietf.org/html/rfc2818#section-2.4) - ``` - When HTTP/TLS is being run over a TCP/IP connection, the default port - is 443. - ``` - [HTTP Over TLS](https://tools.ietf.org/html/rfc2818#section-2.3) + In order to fix this error you must secure this endpoint with TLS 1.2 + and ensure that references to this URL point to the HTTPS protocol so + that use of TLS is explicit. + ) + disable_tls_instructions + end - To fix this error ensure that the URI uses TLS. + def tls_socket_error_details(uri) + %( + The following URI did not accept socket connections over port 443: - You may safely ignore this error if this environment does not secure content using TLS. If you are - running a local copy of Inferno, you can turn off TLS detection by changing setting the `disable_tls_tests` - option to false in `config.yml`. - ) - rescue StandardError => e - raise AssertionException.new "Unable to connect to #{uri}: #{e.class.name}, #{e.message}", %( - An unexpected error occured when attempting to connect to the following URI using TLS. + [#{uri}](#{uri}) - [#{uri}](#{uri}) + ``` + When HTTP/TLS is being run over a TCP/IP connection, the default port + is 443. + ``` + [HTTP Over TLS](https://tools.ietf.org/html/rfc2818#section-2.3) - Ensure that this URI is protected by TLS. - You may safely ignore this error if this environment does not secure content using TLS. If you are - running a local copy of Inferno, you can turn off TLS detection by changing setting the `disable_tls_tests` - option to false in `config.yml`. - ) - end + To fix this error ensure that this URI is protected by TLS. + ) + disable_tls_instructions end - def assert_valid_http_uri(uri, message = nil) - error_message = message || "\"#{uri}\" is not a valid URI" - assert (uri =~ /\A#{URI.regexp(['http', 'https'])}\z/), error_message - end + def tls_unexpected_error_details(uri) + %( + An unexpected error occured when attempting to connect to the + following URI using TLS. - def assert_operation_supported(server_capabilities, op_name) - assert server_capabilities.operation_supported?(op_name), "FHIR server capability statement did not support #{op_name} operation" + [#{uri}](#{uri}) + + To fix this error ensure that this URI is protected by TLS. + ) + disable_tls_instructions end - def assert_valid_conformance(conformance = @conformance) - conformance_resource_name = versioned_conformance_class.name.demodulize - assert( - conformance.class == versioned_conformance_class, - "Expected valid #{conformance_resource_name} resource." + def disable_tls_instructions + %( + You may safely ignore this error if this environment does not secure + content using TLS. If you are running a local copy of Inferno you + can turn off TLS detection by changing setting the + `disable_tls_tests` option to true in `config.yml`. ) end end From 1c6e1182d6af940291e13e977ad091ad27f93667 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 16 Oct 2019 09:13:57 -0400 Subject: [PATCH 012/173] update assert_valid_json --- lib/app/utils/assertions.rb | 4 ++-- lib/app/utils/tls_tester.rb | 2 +- test/unit/assertions_test.rb | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/lib/app/utils/assertions.rb b/lib/app/utils/assertions.rb index 9723e60a1..93023eb01 100644 --- a/lib/app/utils/assertions.rb +++ b/lib/app/utils/assertions.rb @@ -17,9 +17,9 @@ def assert(test, message = 'assertion failed, no message', data = '') end def assert_valid_json(json) - JSON.parse(json) + assert JSON.parse(json) rescue JSON::ParserError - raise AssertionException, 'Invalid JSON' + assert false, 'Invalid JSON' end def assert_equal(expected, actual, message = '', data = '') diff --git a/lib/app/utils/tls_tester.rb b/lib/app/utils/tls_tester.rb index 4729d059e..5a18c0393 100644 --- a/lib/app/utils/tls_tester.rb +++ b/lib/app/utils/tls_tester.rb @@ -57,7 +57,7 @@ def verify_deny_protocol(ssl_version, readable_version) http.max_version = ssl_version http.verify_mode = OpenSSL::SSL::VERIFY_PEER begin - http.request_get(@uri) + http.request_get(@host) rescue StandardError => e return true, "Correctly denied connection error of type #{e.class} happened, message is #{e.message}" end diff --git a/test/unit/assertions_test.rb b/test/unit/assertions_test.rb index f21c3b81e..deb5b9e4c 100644 --- a/test/unit/assertions_test.rb +++ b/test/unit/assertions_test.rb @@ -28,6 +28,21 @@ end end + describe '#assert_valid_json' do + it 'raises an AssertionException if JSON is invalid' do + exception = assert_raises(Inferno::AssertionException) do + @inferno_asserter.assert_valid_json('abc') + end + + assert_equal(exception.message, 'Invalid JSON') + end + + it 'does not raise an exception if JSON is valid' do + json = {a: '1'}.to_json + @inferno_asserter.assert_valid_json(json) + end + end + describe '#assert_equal' do it 'raises an AssertionException if its arguments are not equal' do exception = assert_raises(Inferno::AssertionException) do From 4f0a701b221aca9b2ba0447ecb87cece65d7616f Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 16 Oct 2019 09:36:42 -0400 Subject: [PATCH 013/173] cleanup --- lib/app/utils/assertions.rb | 6 ++- .../support/sequence_coverage_reporting.rb | 37 +++++++++++++++---- test/test_helper.rb | 13 +++++-- test/unit/assertions_test.rb | 2 +- 4 files changed, 43 insertions(+), 15 deletions(-) rename find_assertions.rb => test/support/sequence_coverage_reporting.rb (63%) diff --git a/lib/app/utils/assertions.rb b/lib/app/utils/assertions.rb index 93023eb01..12006cd22 100644 --- a/lib/app/utils/assertions.rb +++ b/lib/app/utils/assertions.rb @@ -6,11 +6,13 @@ module Inferno module Assertions def assert(test, message = 'assertion failed, no message', data = '') - if ENV['RACK_ENV'] == 'test' + if ENV['RACK_ENV'] == 'test' && create_assertion_report? sequence_line_regex = %r{inferno/lib/app/modules/(\w+/\w+\.rb:\d+)} backtrace_location = caller_locations.find { |location| location.to_s.match? sequence_line_regex } call_site = backtrace_location&.to_s&.match(sequence_line_regex)&.[](1) - AssertionTracker.add_assertion_call(call_site, !!test) if call_site.present? + if call_site.present? + AssertionTracker.add_assertion_call(call_site, !!test) # rubocop:disable Style/DoubleNegation + end end raise AssertionException.new message, data unless test diff --git a/find_assertions.rb b/test/support/sequence_coverage_reporting.rb similarity index 63% rename from find_assertions.rb rename to test/support/sequence_coverage_reporting.rb index e32e2be8b..fe1ce2832 100644 --- a/find_assertions.rb +++ b/test/support/sequence_coverage_reporting.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + require 'ast' require 'parser/current' require 'pry' -require_relative './lib/app/utils/assertions' +require_relative '../../lib/app/utils/assertions' -# AST processor to find the location of each assertion in a sequence +# AST processor which finds the location of each assertion in a sequence class SequenceProcessor include AST::Processor::Mixin @@ -17,6 +19,7 @@ def handler_missing(node) node.children.each { |child| process(child) if child.respond_to? :to_ast } end + # If an assertion is called, record its location def on_send(node) _, method_name = *node AssertionTracker.add_assertion_location(location(node)) if AssertionTracker.assertion? method_name @@ -31,17 +34,20 @@ def stripped_file_name end end -# Store the location of each assertion in a sequence +# Store the location of each assertion in a sequence, and track each time an +# assertion is called class AssertionTracker class << self def assertion_method_names @assertion_method_names ||= Set.new(Inferno::Assertions.instance_methods) end + # Assertion locations determined through analyzing the AST def assertion_locations @assertion_locations ||= [] end + # Assertion calls detected at runtime def assertion_calls @assertion_calls ||= Hash.new { |hash, key| hash[key] = [] } end @@ -67,10 +73,13 @@ def print results = AssertionTracker.assertion_calls[location] puts "#{location.ljust(location_width)} Pass: #{pass_count(results).to_s.rjust(3)} Fail: #{fail_count(results).to_s.rjust(3)}" end + + print_unknown_call_sites end def location_width - @location_width ||= AssertionTracker.assertion_calls.keys.max_by(&:length).length + # add 4 to account for line numbers + @location_width ||= AssertionTracker.assertion_locations.max_by(&:length).length end def pass_count(results) @@ -78,12 +87,26 @@ def pass_count(results) end def fail_count(results) - results.count { |result| !result } + results.count(&:!) + end + + # Locations which called an assertion which was not detected in the AST. + # This happens when a method from outside of the sequence makes an assertion + # (e.g., a method from SequenceBase). + def unknown_call_sites + AssertionTracker.assertion_calls.keys - AssertionTracker.assertion_locations + end + + def print_unknown_call_sites + return if unknown_call_sites.blank? + + puts "\nUnrecognized assertion call sites:" + puts unknown_call_sites.join("\n") end end end -sequence_paths = File.join(__dir__, 'lib', 'app', 'modules', '*', '*.rb') +sequence_paths = File.join(__dir__, '..', '..', 'lib', 'app', 'modules', '*', '*.rb') Dir.glob(sequence_paths).sort.each do |sequence_file_name| file_contents = File.read(sequence_file_name) @@ -92,5 +115,3 @@ def fail_count(results) processor = SequenceProcessor.new(sequence_file_name) processor.process(ast) end - -puts "\n### Assertion locations loaded ###\n\n" diff --git a/test/test_helper.rb b/test/test_helper.rb index 2c8a9fbba..cd7386efb 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -10,14 +10,19 @@ require 'webmock/minitest' require 'rack/test' require 'json/jwt' -require_relative '../find_assertions' test_log_filename = File.join('tmp', 'test.log') FileUtils.rm test_log_filename if File.exist? test_log_filename -MiniTest.after_run { - AssertionReporter.print -} +def create_assertion_report? + ENV['ASSERTION_REPORT']&.downcase == 'true' +end + +if create_assertion_report? + require_relative './support/sequence_coverage_reporting' + + MiniTest.after_run { AssertionReporter.print } +end require_relative '../lib/app' diff --git a/test/unit/assertions_test.rb b/test/unit/assertions_test.rb index deb5b9e4c..2b679b000 100644 --- a/test/unit/assertions_test.rb +++ b/test/unit/assertions_test.rb @@ -38,7 +38,7 @@ end it 'does not raise an exception if JSON is valid' do - json = {a: '1'}.to_json + json = { a: '1' }.to_json @inferno_asserter.assert_valid_json(json) end end From d8f0dc77c3b48c2502c89efb1d86c67e005e41ce Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 17 Oct 2019 14:44:47 -0400 Subject: [PATCH 014/173] generate csv output --- .gitignore | 1 + test/support/sequence_coverage_reporting.rb | 19 ++++++++++--------- test/test_helper.rb | 2 +- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 680204130..c01c70692 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ coverage tmp/* .vscode/* resources/terminology/* +sequence_coverage.csv diff --git a/test/support/sequence_coverage_reporting.rb b/test/support/sequence_coverage_reporting.rb index fe1ce2832..6c0cb3b4e 100644 --- a/test/support/sequence_coverage_reporting.rb +++ b/test/support/sequence_coverage_reporting.rb @@ -68,18 +68,19 @@ def add_assertion_call(location, result) class AssertionReporter class << self - def print - AssertionTracker.assertion_locations.sort.each do |location| - results = AssertionTracker.assertion_calls[location] - puts "#{location.ljust(location_width)} Pass: #{pass_count(results).to_s.rjust(3)} Fail: #{fail_count(results).to_s.rjust(3)}" - end - + def report + create_csv print_unknown_call_sites end - def location_width - # add 4 to account for line numbers - @location_width ||= AssertionTracker.assertion_locations.max_by(&:length).length + def create_csv + CSV.open(File.join(__dir__, '..', '..', 'sequence_coverage.csv'), 'wb') do |csv| + csv << ['Assertion Location', 'Pass Count', 'Fail Count'] + AssertionTracker.assertion_locations.sort.each do |location| + results = AssertionTracker.assertion_calls[location] + csv << [location, pass_count(results), fail_count(results)] + end + end end def pass_count(results) diff --git a/test/test_helper.rb b/test/test_helper.rb index cd7386efb..f3149704a 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -21,7 +21,7 @@ def create_assertion_report? if create_assertion_report? require_relative './support/sequence_coverage_reporting' - MiniTest.after_run { AssertionReporter.print } + MiniTest.after_run { AssertionReporter.report } end require_relative '../lib/app' From 70c56957645bbfc703b51437f6e13e504c5835a4 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Mon, 7 Oct 2019 09:58:46 -0400 Subject: [PATCH 015/173] check for US Core profile support --- lib/app/models/server_capabilities.rb | 6 +++ ...s_core_r4_capability_statement_sequence.rb | 52 ++++++++++++++++--- test/model/server_capabilities_test.rb | 17 +++++- 3 files changed, 66 insertions(+), 9 deletions(-) diff --git a/lib/app/models/server_capabilities.rb b/lib/app/models/server_capabilities.rb index 61d45ee7c..a102732a8 100644 --- a/lib/app/models/server_capabilities.rb +++ b/lib/app/models/server_capabilities.rb @@ -30,6 +30,12 @@ def supported_interactions end end + def supported_profiles + statement.rest.flat_map(&:resource) + &.flat_map { |resource| resource.supportedProfile + [resource.profile] } + &.compact || [] + end + def operation_supported?(operation_name) statement.rest.any? { |rest| rest.operation.any? { |operation| operation.name == operation_name } } end diff --git a/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb b/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb index 93b44e5e3..dd8cef161 100644 --- a/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb +++ b/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb @@ -55,6 +55,35 @@ class UsCoreR4CapabilityStatementSequence < CapabilityStatementSequence * [DSTU2 Conformance Statement](https://www.hl7.org/fhir/DSTU2/conformance.html) ) + PROFILES = [ + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-location', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient', + 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age', + 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus', + 'http://hl7.org/fhir/StructureDefinition/vitalsigns' + ].freeze + test 'FHIR server capability states JSON support' do metadata do id '04' @@ -85,26 +114,33 @@ class UsCoreR4CapabilityStatementSequence < CapabilityStatementSequence assert json_formats.any? { |format| @conformance.format.include? format }, 'Conformance does not state support for json.' end - test 'Capability Statement lists supported US Core profiles, operations and search parameters' do + test 'Capability Statement lists support for required US Core Profiles' do metadata do id '05' - link 'http://hl7.org/fhir/us/core/2019Jan/CapabilityStatement-us-core-server.html' - desc %( + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' + description %( The US Core Implementation Guide states: ``` The US Core Server SHALL: - - 1. Support the US Core Patient resource profile. - 2. Support at least one additional resource profile from the list of US Core Profiles. + 1. Support the US Core Patient resource profile. + 2. Support at least one additional resource profile from the list of + US Core Profiles. ``` - ) end + patient_profile = PROFILES.find { |profile| profile.end_with? 'patient' } + assert_valid_conformance - assert @instance.conformance_supported?(:Patient, [:read]), 'Patient resource with read interaction is not listed in capability statement.' + assert @server_capabilities.supported_profiles.include?(patient_profile), 'US Core Patient profile not supported' + + other_profiles = PROFILES.reject { |profile| profile == patient_profile } + + other_profiles_supported = other_profiles & @server_capabilities.supported_profiles + + assert other_profiles_supported.present?, 'No US Core profiles other than Patient are supported' end end end diff --git a/test/model/server_capabilities_test.rb b/test/model/server_capabilities_test.rb index 340d64d14..91bdde709 100644 --- a/test/model/server_capabilities_test.rb +++ b/test/model/server_capabilities_test.rb @@ -21,13 +21,18 @@ def setup }, { type: 'Condition', + profile: 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition', interaction: [ { code: 'delete' }, { code: 'update' } ] }, { - type: 'Observation' + type: 'Observation', + supportedProfile: [ + 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age', + 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height' + ] } ] } @@ -120,4 +125,14 @@ def test_smart_capabilities assert @capabilities.smart_capabilities == [] assert @smart_capabilities.smart_capabilities == ['launch-ehr', 'launch-standalone'] end + + def test_supported_profiles + expected_profiles = [ + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition', + 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age', + 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height' + ] + + assert_equal(expected_profiles, @capabilities.supported_profiles) + end end From 0dd7a2f6c580c3ca03e0c74e3737e80ff306531c Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 17 Oct 2019 15:36:37 -0400 Subject: [PATCH 016/173] update us core profile support testing methodology --- ...s_core_r4_capability_statement_sequence.rb | 88 +++++++++++-------- 1 file changed, 50 insertions(+), 38 deletions(-) diff --git a/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb b/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb index dd8cef161..073c52a76 100644 --- a/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb +++ b/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb @@ -55,34 +55,38 @@ class UsCoreR4CapabilityStatementSequence < CapabilityStatementSequence * [DSTU2 Conformance Statement](https://www.hl7.org/fhir/DSTU2/conformance.html) ) - PROFILES = [ - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-location', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient', - 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age', - 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry', - 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus', - 'http://hl7.org/fhir/StructureDefinition/vitalsigns' - ].freeze + PROFILES = { + 'AllergyIntolerance' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance'], + 'CarePlan' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan'], + 'CareTeam' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam'], + 'Condition' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition'], + 'Device' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device'], + 'DiagnosticReport' => [ + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note' + ], + 'DocumentReference' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference'], + 'Encounter' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter'], + 'Goal' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal'], + 'Immunization' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization'], + 'Location' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-location'], + 'Medication' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication'], + 'MedicationRequest' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest'], + 'Observation' => [ + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab', + 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age', + 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry', + 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus', + 'http://hl7.org/fhir/StructureDefinition/vitalsigns' + ], + 'Organization' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization'], + 'Patient' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient'], + 'Practitioner' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner'], + 'PractitionerRole' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole'], + 'Procedure' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure'], + 'Provenance' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance'] + }.freeze test 'FHIR server capability states JSON support' do metadata do @@ -130,17 +134,25 @@ class UsCoreR4CapabilityStatementSequence < CapabilityStatementSequence ) end - patient_profile = PROFILES.find { |profile| profile.end_with? 'patient' } - assert_valid_conformance - - assert @server_capabilities.supported_profiles.include?(patient_profile), 'US Core Patient profile not supported' - - other_profiles = PROFILES.reject { |profile| profile == patient_profile } - - other_profiles_supported = other_profiles & @server_capabilities.supported_profiles - - assert other_profiles_supported.present?, 'No US Core profiles other than Patient are supported' + supported_resources = @server_capabilities.supported_resources + supported_profiles = @server_capabilities.supported_profiles + + assert supported_resources.include?('Patient'), 'US Core Patient profile not supported' + + other_resources = PROFILES.keys.reject { |resource_type| resource_type == 'Patient' } + other_resources_supported = other_resources.any? { |resource| supported_resources.include? resource } + assert other_resources_supported, 'No US Core resources other than Patient are supported' + + PROFILES.each do |resource, profiles| + next unless supported_resources.include? resource + profiles.each do |profile| + warning do + message = "CapabilityStatement does not claim support for US Core #{resource} profile: #{profile}" + assert supported_profiles.include? profile, message + end + end + end end end end From b623911ebb146bae7be173d5b4e8b168fd35e83e Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 18 Oct 2019 13:37:42 -0400 Subject: [PATCH 017/173] add unit tests --- ...s_core_r4_capability_statement_sequence.rb | 9 +- .../smart/token_refresh_sequence_test.rb | 29 +++-- ...e_r4_capability_statement_sequence_test.rb | 106 ++++++++++++++++++ 3 files changed, 126 insertions(+), 18 deletions(-) create mode 100644 test/sequence/us_core_guidance/us_core_r4_capability_statement_sequence_test.rb diff --git a/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb b/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb index 073c52a76..457f6fa79 100644 --- a/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb +++ b/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb @@ -88,9 +88,10 @@ class UsCoreR4CapabilityStatementSequence < CapabilityStatementSequence 'Provenance' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance'] }.freeze - test 'FHIR server capability states JSON support' do + test :json_support do metadata do id '04' + name 'FHIR server capability states JSON support' link 'http://hl7.org/fhir/us/core/2019Jan/CapabilityStatement-us-core-server.html' description %( @@ -118,9 +119,10 @@ class UsCoreR4CapabilityStatementSequence < CapabilityStatementSequence assert json_formats.any? { |format| @conformance.format.include? format }, 'Conformance does not state support for json.' end - test 'Capability Statement lists support for required US Core Profiles' do + test :profile_support do metadata do id '05' + name 'Capability Statement lists support for required US Core Profiles' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( The US Core Implementation Guide states: @@ -146,10 +148,11 @@ class UsCoreR4CapabilityStatementSequence < CapabilityStatementSequence PROFILES.each do |resource, profiles| next unless supported_resources.include? resource + profiles.each do |profile| warning do message = "CapabilityStatement does not claim support for US Core #{resource} profile: #{profile}" - assert supported_profiles.include? profile, message + assert supported_profiles&.include?(profile), message end end end diff --git a/test/sequence/smart/token_refresh_sequence_test.rb b/test/sequence/smart/token_refresh_sequence_test.rb index 58e06143e..cc973f92b 100644 --- a/test/sequence/smart/token_refresh_sequence_test.rb +++ b/test/sequence/smart/token_refresh_sequence_test.rb @@ -3,8 +3,6 @@ require_relative '../../test_helper' describe Inferno::Sequence::TokenRefreshSequence do - SEQUENCE = Inferno::Sequence::TokenRefreshSequence - let(:full_body) do { 'access_token' => 'abc', @@ -15,6 +13,7 @@ end before do + @sequence_class = Inferno::Sequence::TokenRefreshSequence @token_endpoint = 'http://www.example.com/token' @client = FHIR::Client.new('http://www.example.com/fhir') @instance = Inferno::Models::TestingInstance.new(oauth_token_endpoint: @token_endpoint, scopes: 'jkl') @@ -22,13 +21,13 @@ describe 'invalid refresh token test' do before do - @test = SEQUENCE[:invalid_refresh_token] - @sequence = SEQUENCE.new(@instance, @client) + @test = @sequence_class[:invalid_refresh_token] + @sequence = @sequence_class.new(@instance, @client) end it 'fails when the token refresh response has a success status' do stub_request(:post, @token_endpoint) - .with(body: hash_including(refresh_token: SEQUENCE::INVALID_REFRESH_TOKEN)) + .with(body: hash_including(refresh_token: @sequence_class::INVALID_REFRESH_TOKEN)) .to_return(status: 200) assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } @@ -36,7 +35,7 @@ it 'succeeds when the token refresh response has an error status' do stub_request(:post, @token_endpoint) - .with(body: hash_including(refresh_token: SEQUENCE::INVALID_REFRESH_TOKEN)) + .with(body: hash_including(refresh_token: @sequence_class::INVALID_REFRESH_TOKEN)) .to_return(status: 400) @sequence.run_test(@test) @@ -45,13 +44,13 @@ describe 'invalid client id test' do before do - @test = SEQUENCE[:invalid_client_id] - @sequence = SEQUENCE.new(@instance, @client) + @test = @sequence_class[:invalid_client_id] + @sequence = @sequence_class.new(@instance, @client) end it 'fails when the token refresh response has a success status' do stub_request(:post, @token_endpoint) - .with(body: hash_including(client_id: SEQUENCE::INVALID_CLIENT_ID)) + .with(body: hash_including(client_id: @sequence_class::INVALID_CLIENT_ID)) .to_return(status: 200) assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } @@ -59,7 +58,7 @@ it 'succeeds when the token refresh has an error status' do stub_request(:post, @token_endpoint) - .with(body: hash_including(client_id: SEQUENCE::INVALID_CLIENT_ID)) + .with(body: hash_including(client_id: @sequence_class::INVALID_CLIENT_ID)) .to_return(status: 400) @sequence.run_test(@test) @@ -68,8 +67,8 @@ describe 'refresh with scope parameter test' do before do - @test = SEQUENCE[:refresh_with_scope] - @sequence = SEQUENCE.new(@instance, @client) + @test = @sequence_class[:refresh_with_scope] + @sequence = @sequence_class.new(@instance, @client) end it 'succeeds when the token refresh succeeds' do @@ -91,8 +90,8 @@ describe 'refresh without scope parameter test' do before do - @test = SEQUENCE[:refresh_without_scope] - @sequence = SEQUENCE.new(@instance, @client) + @test = @sequence_class[:refresh_without_scope] + @sequence = @sequence_class.new(@instance, @client) end it 'succeeds when the token refresh succeeds' do @@ -122,7 +121,7 @@ end before do - @sequence = SEQUENCE.new(@instance, @client) + @sequence = @sequence_class.new(@instance, @client) end it 'fails when the token response has an error status' do diff --git a/test/sequence/us_core_guidance/us_core_r4_capability_statement_sequence_test.rb b/test/sequence/us_core_guidance/us_core_r4_capability_statement_sequence_test.rb new file mode 100644 index 000000000..69a7747da --- /dev/null +++ b/test/sequence/us_core_guidance/us_core_r4_capability_statement_sequence_test.rb @@ -0,0 +1,106 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +describe Inferno::Sequence::UsCoreR4CapabilityStatementSequence do + before do + @sequence_class = Inferno::Sequence::UsCoreR4CapabilityStatementSequence + @client = FHIR::Client.new('http://www.example.com/fhir') + @instance = Inferno::Models::TestingInstance.new(oauth_token_endpoint: @token_endpoint, scopes: 'jkl') + @instance.instance_variable_set(:'@module', OpenStruct.new(fhir_version: 'r4')) + end + + # TODO: check assertion error messages + describe 'JSON support test' do + before do + @test = @sequence_class[:json_support] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'fails when the CapabilityStatement is invalid' do + @sequence.instance_variable_set(:'@conformance', FHIR::DSTU2::Conformance.new) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected valid CapabilityStatement resource.', exception.message + end + + it 'fails when the CapabilityStatement has no JSON support' do + @sequence.instance_variable_set(:'@conformance', FHIR::CapabilityStatement.new) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Conformance does not state support for json.', exception.message + end + + it 'succeeds when the CapabilityStatement has JSON support' do + @sequence.instance_variable_set(:'@conformance', FHIR::CapabilityStatement.new(format: ['application/fhir+json'])) + + @sequence.run_test(@test) + end + end + + describe 'Profile support test' do + before do + @test = @sequence_class[:profile_support] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@conformance', FHIR::CapabilityStatement.new) + end + + it 'fails when the CapabilityStatement is invalid' do + @sequence.instance_variable_set(:'@conformance', FHIR::DSTU2::Conformance.new) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected valid CapabilityStatement resource.', exception.message + end + + it 'fails when the CapabilityStatement has no Patient support' do + @sequence.instance_variable_set(:'@server_capabilities', OpenStruct.new(supported_resources: ['Observation'])) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'US Core Patient profile not supported', exception.message + end + + it 'fails when the CapabilityStatement has only Patient support' do + @sequence.instance_variable_set(:'@server_capabilities', OpenStruct.new(supported_resources: ['Patient'])) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + assert_equal 'No US Core resources other than Patient are supported', exception.message + end + + it 'generates a warning when the CapabilityStatement does not claim support for a US Core Profile' do + supported_resources = ['Patient', 'Condition'] + @sequence.instance_variable_set( + :'@server_capabilities', + OpenStruct.new(supported_resources: supported_resources) + ) + + @sequence.run_test(@test) + + warnings = @sequence.instance_variable_get(:'@test_warnings') + supported_resources.each do |resource| + profile = @sequence_class::PROFILES[resource].first + warning_message = "CapabilityStatement does not claim support for US Core #{resource} profile: #{profile}" + + assert_includes(warnings, warning_message) + end + end + + it 'succeeds without warnings when multiple US Core resources support all US Core profiles' do + supported_resources = ['Patient', 'Condition'] + supported_profiles = supported_resources.map { |resource| @sequence_class::PROFILES[resource].first } + @sequence.instance_variable_set( + :'@server_capabilities', + OpenStruct.new(supported_resources: supported_resources, supported_profiles: supported_profiles) + ) + + @sequence.run_test(@test) + + warnings = @sequence.instance_variable_get(:'@test_warnings') + + assert warnings.blank? + end + end +end From baa76a4a5b55f2d8cfcd1a16c70b8e215a60bf8d Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Mon, 21 Oct 2019 17:04:24 -0400 Subject: [PATCH 018/173] Add 2 unit tests --- .../bulk_data/bulk_data_discovery_sequence.rb | 13 ++--- .../bulk_data/discovery_sequence_test.rb | 55 +++++++++++++++++++ 2 files changed, 61 insertions(+), 7 deletions(-) create mode 100644 test/sequence/bulk_data/discovery_sequence_test.rb diff --git a/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb b/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb index 756e3e20c..6fddf2bcd 100644 --- a/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb +++ b/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb @@ -49,9 +49,10 @@ def oauth2_metadata_from_conformance options end - test 'Retrieve Configuration from well-known endpoint' do + test :read_well_known_endpoint do metadata do id '01' + name 'Retrieve Configuration from well-known endpoint' link 'http://www.hl7.org/fhir/smart-app-launch/conformance/#using-well-known' description %( The authorization endpoints accepted by a FHIR resource server can @@ -67,17 +68,15 @@ def oauth2_metadata_from_conformance assert_valid_json(well_known_configuration_response.body) @well_known_configuration = JSON.parse(well_known_configuration_response.body) - @well_known_authorize_url = @well_known_configuration['authorization_endpoint'] @well_known_token_url = @well_known_configuration['token_endpoint'] @well_known_register_url = @well_known_configuration['registration_endpoint'] - @well_known_manage_url = @well_known_configuration['management_endpoint'] - @well_known_introspect_url = @well_known_configuration['introspection_endpoint'] - @well_known_revoke_url = @well_known_configuration['revocation_endpoint'] + @well_known_token_auth_methods = @well_known_configuration['token_endpoint_auth_methods_supported'] + @well_known_token_auth_signings = @well_known_configuration['token_endpoint_auth_signing_alg_values_supported'] + @well_known_scopes = @well_known_configuration['scopes_supported'] @instance.update( - oauth_authorize_endpoint: @well_known_authorize_url, oauth_token_endpoint: @well_known_token_url, - oauth_register_endpoint: @well_known_configuration['registration_endpoint'] + oauth_register_endpoint: @well_known_register_url ) assert @well_known_configuration.present?, 'No .well-known/smart-configuration body' diff --git a/test/sequence/bulk_data/discovery_sequence_test.rb b/test/sequence/bulk_data/discovery_sequence_test.rb new file mode 100644 index 000000000..6bf61f93a --- /dev/null +++ b/test/sequence/bulk_data/discovery_sequence_test.rb @@ -0,0 +1,55 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +describe Inferno::Sequence::BulkDataDiscoverySequence do + SEQUENCE = Inferno::Sequence::BulkDataDiscoverySequence + + before do + @instance = Inferno::Models::TestingInstance.create( + url: 'http://www.example.com' + ) + + @client = FHIR::Client.new(@instance.url) + @well_known_endpoint = @instance.url + '/.well-known/smart-configuration' + @smart_configuration = { + 'token_endpoint' => 'https://www.example.com/auth/token', + 'token_endpoint_auth_methods_supported' => ['private_key_jwt'], + 'token_endpoint_auth_signing_alg_values_supported' => ['RS384', 'ES384'], + 'scopes_supported' => ['system/*.read'], + 'registration_endpoint' => 'https://www.example.com/auth/register' + } + end + + describe 'read well known endpoints tests' do + before do + @test = SEQUENCE[:read_well_known_endpoint] + @sequence = SEQUENCE.new(@instance, @client) + end + + it 'succeeds when server returns smart configuration' do + stub_request(:get, @well_known_endpoint) + .to_return( + status: 200, + headers: {content_type: 'application/json'}, + body: @smart_configuration.to_json + ) + + @sequence.run_test(@test) + assert @instance.oauth_token_endpoint == @smart_configuration['token_endpoint'] + assert @instance.oauth_register_endpoint == @smart_configuration['registration_endpoint'] + end + + it 'fails when server returns 400' do + stub_request(:get, @well_known_endpoint) + .to_return( + status: 400 + ) + + assert_raises(Inferno::AssertionException){ + @sequence.run_test(@test) + } + end + end + +end \ No newline at end of file From efdc39f7fde8b5fb339ff6bb802432bd10ef6c05 Mon Sep 17 00:00:00 2001 From: Michael O'Keefe Date: Tue, 22 Oct 2019 09:29:53 -0400 Subject: [PATCH 019/173] Add Bundler caching in Travis to speed up test runs --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index a3a89f791..e9432c0bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: ruby +cache: bundler services: - docker before_install: From f35f50b5ae84f4ea027381e9a2a2bfa98c52c509 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Tue, 22 Oct 2019 10:51:34 -0400 Subject: [PATCH 020/173] Add more unit tests --- .../bulk_data/bulk_data_discovery_sequence.rb | 14 +- .../bulk_data/discovery_sequence_test.rb | 139 ++++++++++++++++-- 2 files changed, 136 insertions(+), 17 deletions(-) diff --git a/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb b/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb index 6fddf2bcd..1b27f8eaa 100644 --- a/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb +++ b/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb @@ -33,6 +33,8 @@ class BulkDataDiscoverySequence < SequenceBase { url: 'token', description: 'token' } ].freeze + attr_accessor :well_known_configuration, :conformance + def oauth2_metadata_from_conformance options = { token_url: nil @@ -65,9 +67,9 @@ def oauth2_metadata_from_conformance well_known_configuration_response = LoggedRestClient.get(well_known_configuration_url) assert_response_ok(well_known_configuration_response) assert_response_content_type(well_known_configuration_response, 'application/json') - assert_valid_json(well_known_configuration_response.body) - @well_known_configuration = JSON.parse(well_known_configuration_response.body) + @well_known_configuration = assert_valid_json(well_known_configuration_response.body) + @well_known_token_url = @well_known_configuration['token_endpoint'] @well_known_register_url = @well_known_configuration['registration_endpoint'] @well_known_token_auth_methods = @well_known_configuration['token_endpoint_auth_methods_supported'] @@ -78,13 +80,12 @@ def oauth2_metadata_from_conformance oauth_token_endpoint: @well_known_token_url, oauth_register_endpoint: @well_known_register_url ) - - assert @well_known_configuration.present?, 'No .well-known/smart-configuration body' end - test 'Configuration from well-known endpoint contains required fields' do + test :validate_well_known_configuration do metadata do id '02' + name 'Well-Known Configuration contains required fields' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#advertising-server-conformance-with-smart-backend-services' description %( The JSON from .well-known/smart-configuration contains the following @@ -99,9 +100,10 @@ def oauth2_metadata_from_conformance assert missing_fields.empty?, "The following required fields are missing: #{missing_fields.join(', ')}" end - test 'Conformance/Capability Statement provides OAuth 2.0 endpoints' do + test :read_conformance_oauth_endpoins do metadata do id '03' + name 'Conformance/Capability Statement provides OAuth 2.0 endpoints' link 'http://hl7.org/fhir/smart-app-launch/conformance/index.html#using-cs' description %( If a server requires SMART on FHIR authorization for access, its diff --git a/test/sequence/bulk_data/discovery_sequence_test.rb b/test/sequence/bulk_data/discovery_sequence_test.rb index 6bf61f93a..54e4e9b37 100644 --- a/test/sequence/bulk_data/discovery_sequence_test.rb +++ b/test/sequence/bulk_data/discovery_sequence_test.rb @@ -3,15 +3,18 @@ require_relative '../../test_helper' describe Inferno::Sequence::BulkDataDiscoverySequence do - SEQUENCE = Inferno::Sequence::BulkDataDiscoverySequence - before do + @sequence_class = Inferno::Sequence::BulkDataDiscoverySequence + @instance = Inferno::Models::TestingInstance.create( url: 'http://www.example.com' ) @client = FHIR::Client.new(@instance.url) + @well_known_endpoint = @instance.url + '/.well-known/smart-configuration' + @conformance_endpoint = @instance.url + '/metadata' + @smart_configuration = { 'token_endpoint' => 'https://www.example.com/auth/token', 'token_endpoint_auth_methods_supported' => ['private_key_jwt'], @@ -19,22 +22,24 @@ 'scopes_supported' => ['system/*.read'], 'registration_endpoint' => 'https://www.example.com/auth/register' } + + @conformance = load_json_fixture(:bulk_data_conformance) end describe 'read well known endpoints tests' do before do - @test = SEQUENCE[:read_well_known_endpoint] - @sequence = SEQUENCE.new(@instance, @client) + @test = @sequence_class[:read_well_known_endpoint] + @sequence = @sequence_class.new(@instance, @client) end it 'succeeds when server returns smart configuration' do stub_request(:get, @well_known_endpoint) .to_return( status: 200, - headers: {content_type: 'application/json'}, + headers: { content_type: 'application/json' }, body: @smart_configuration.to_json ) - + @sequence.run_test(@test) assert @instance.oauth_token_endpoint == @smart_configuration['token_endpoint'] assert @instance.oauth_register_endpoint == @smart_configuration['registration_endpoint'] @@ -45,11 +50,123 @@ .to_return( status: 400 ) - - assert_raises(Inferno::AssertionException){ + + assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + end + + it 'fails when response header is not application/json' do + stub_request(:get, @well_known_endpoint) + .to_return( + status: 200, + headers: { content_type: 'application/text' } + ) + + assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + end + + it 'fails when response body is not JSON object' do + stub_request(:get, @well_known_endpoint) + .to_return( + status: 200, + headers: { content_type: 'application/json' }, + body: 'This is a string' + ) + + assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + end + end + + describe 'well-known configuration test' do + before do + @test = @sequence_class[:validate_well_known_configuration] + @sequence = @sequence_class.new(@instance, @client) + @sequence.well_known_configuration = @smart_configuration.clone + end + + it 'succeeds when well-known configuration is valid' do + @sequence.run_test(@test) + end + + it 'fails when well-known configuration does not have required fields' do + @sequence.well_known_configuration.delete('token_endpoint') + + assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + end + + it 'skips when well-known configuration is empty' do + @sequence.well_known_configuration = nil + + assert_raises(Inferno::SkipException) do + @sequence.run_test(@test) + end + end + end + + describe 'conformance oauth endpoints test' do + before do + @test = @sequence_class[:read_conformance_oauth_endpoins] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'succeeds when conformance has required oauth endpoints' do + stub_request(:get, @conformance_endpoint) + .to_return( + status: 200, + body: @conformance.to_json + ) + + @sequence.run_test(@test) + assert @instance.oauth_token_endpoint == 'https://bulk-data.smarthealthit.org/auth/token' + end + + it 'fails when conformance does not have oauth extension' do + invalid_conformance = @conformance.clone + invalid_conformance['rest'][0]['security']['extension'] = nil + stub_request(:get, @conformance_endpoint) + .to_return( + status: 200, + body: @conformance.to_json + ) + + assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + end + + it 'fails when conformance does not have token endpoint' do + invalid_conformance = @conformance.clone + invalid_conformance['rest'][0]['security']['extension'][0]['extension'].shift + stub_request(:get, @conformance_endpoint) + .to_return( + status: 200, + body: @conformance.to_json + ) + + assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + end + + it 'fails when conformance token endpoint does not have url' do + invalid_conformance = @conformance.clone + invalid_conformance['rest'][0]['security']['extension'][0]['extension'][0]['url'] = 'This is not a url' + stub_request(:get, @conformance_endpoint) + .to_return( + status: 200, + body: @conformance.to_json + ) + + assert_raises(Inferno::AssertionException) do @sequence.run_test(@test) - } + end end end - -end \ No newline at end of file +end From f9e80c9a73ef676edc0ef5f3592006365452f4fc Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 22 Oct 2019 15:04:52 -0400 Subject: [PATCH 021/173] address github issues --- generator/uscore/uscore_generator.rb | 4 ++-- .../modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb | 4 ++-- .../uscore_v3.0.1/pediatric_weight_for_height_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_allergyintolerance_sequence.rb | 4 ++-- lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb | 4 ++-- lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb | 4 ++-- lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_documentreference_sequence.rb | 4 ++-- lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb | 4 ++-- lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_immunization_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_implantable_device_sequence.rb | 4 ++-- lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb | 4 ++-- lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_medicationrequest_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_organization_sequence.rb | 4 ++-- lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_practitioner_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_practitionerrole_sequence.rb | 4 ++-- lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb | 4 ++-- 25 files changed, 50 insertions(+), 50 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 5e3769856..0e43d1c4f 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -148,8 +148,8 @@ def create_revinclude_test(sequence) reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - #{resource_type}_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == '#{revinclude.split(':').first}' } - assert #{resource_type}_results.any?, 'No #{resource_type} resources were returned from this search' + #{resource_type}_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == '#{resource_type.capitalize}' } + assert #{resource_type}_results, 'No #{resource_type} resources were returned from this search' ) end sequence[:tests] << revinclude_test diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb index 54368edc8..ee2337158 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb @@ -247,8 +247,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Observation resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb index 807917187..9e6ce5b83 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb @@ -247,8 +247,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Observation resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb index dad55ecd9..7679621a7 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb @@ -169,8 +169,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'AllergyIntolerance resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb index 0ad40826e..fd518f21b 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb @@ -239,8 +239,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'CarePlan resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb index aa807ebeb..2bd5b7aae 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb @@ -140,8 +140,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'CareTeam resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb index e025515e3..01608a99d 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb @@ -260,8 +260,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Condition resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb index f7227431c..cf534fd12 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb @@ -350,8 +350,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb index 752b9a45c..227d139a4 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb @@ -350,8 +350,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb index cd4a6ff1e..964f3310c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb @@ -318,8 +318,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'DocumentReference resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb index 0a9954c44..c7bad0d4b 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb @@ -310,8 +310,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Encounter resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb index 7d6a5a935..c55c0f262 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb @@ -206,8 +206,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Goal resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb index 11d95049d..c74f7e0d0 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb @@ -206,8 +206,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Immunization resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb index 6b5eadaf1..31ecc2aa1 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb @@ -169,8 +169,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Device'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Device resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb index ab65d58a3..f47c7902e 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb @@ -246,8 +246,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Location'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Location resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb index 6321cbf61..8451f104f 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb @@ -80,8 +80,8 @@ class USCore301MedicationSequence < SequenceBase reply = get_resource_by_params(versioned_resource_class('Medication'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Medication resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb index 741202f12..05ad2716a 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb @@ -232,8 +232,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb index 61471e687..21c66cf0f 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb @@ -247,8 +247,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Observation resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb index 0361fd766..3af190d01 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb @@ -168,8 +168,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Organization resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb index e88f48c27..2ff05ed6f 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb @@ -301,8 +301,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Patient resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb index baeea02fd..f409f6f40 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb @@ -175,8 +175,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Practitioner resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb index 52de5d2fd..8d8d0ffa1 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb @@ -168,8 +168,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb index 70d4cb3bb..8d7cf8d53 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb @@ -225,8 +225,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Procedure resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb index 6632cb990..ad6845ac2 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb @@ -256,8 +256,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Observation resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb index 4a6ed0561..776426b4f 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb @@ -247,8 +247,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Provenance' } - assert provenance_results.any?, 'No provenance resources were returned from this search' + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No provenance resources were returned from this search' end test 'Observation resources associated with Patient conform to US Core R4 profiles' do From f5d6c4678ef9f1a560a9275bdf09b52f04a96ed9 Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 22 Oct 2019 16:20:35 -0400 Subject: [PATCH 022/173] Change test description and variable name --- generator/uscore/uscore_generator.rb | 9 +++++---- .../uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb | 4 ++-- .../pediatric_weight_for_height_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_allergyintolerance_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_careplan_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_careteam_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_condition_sequence.rb | 4 ++-- .../us_core_diagnosticreport_lab_sequence.rb | 4 ++-- .../us_core_diagnosticreport_note_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_documentreference_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_encounter_sequence.rb | 4 ++-- lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_immunization_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_implantable_device_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_location_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_medication_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_medicationrequest_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_observation_lab_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_organization_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_patient_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_practitioner_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_practitionerrole_sequence.rb | 4 ++-- .../modules/uscore_v3.0.1/us_core_procedure_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_smokingstatus_sequence.rb | 4 ++-- 25 files changed, 53 insertions(+), 52 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 0e43d1c4f..a7f6e64df 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -134,7 +134,7 @@ def create_authorization_test(sequence) def create_revinclude_test(sequence) revinclude_test = { - tests_that: "A Server SHALL be capable of supporting the following _revincludes: #{sequence[:revincludes].join(',')}", + tests_that: "Server returns the appropriate resources from the following _revincludes: #{sequence[:revincludes].join(',')}", index: sequence[:tests].length + 1, link: 'https://www.hl7.org/fhir/search.html#revinclude' } @@ -142,14 +142,15 @@ def create_revinclude_test(sequence) search_params = first_search.nil? ? "\nsearch_params = {}" : get_search_params(first_search[:names], sequence) revinclude_test[:test_code] = search_params sequence[:revincludes].each do |revinclude| - resource_type = revinclude.split(':').first.downcase + resource_name = revinclude.split(':').first + resource_variable = "#{resource_name.downcase}_results" revinclude_test[:test_code] += %( search_params['_revinclude'] = '#{revinclude}' reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - #{resource_type}_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == '#{resource_type.capitalize}' } - assert #{resource_type}_results, 'No #{resource_type} resources were returned from this search' + #{resource_variable} = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == '#{resource_name}' } + assert #{resource_variable}, 'No #{resource_name} resources were returned from this search' ) end sequence[:tests] << revinclude_test diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb index ee2337158..c9e048f33 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb @@ -232,7 +232,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@observation, versioned_resource_class('Observation')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -248,7 +248,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Observation resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb index 9e6ce5b83..c99d22cc3 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb @@ -232,7 +232,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@observation, versioned_resource_class('Observation')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -248,7 +248,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Observation resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb index 7679621a7..ad9db7641 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb @@ -152,7 +152,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '07' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -170,7 +170,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'AllergyIntolerance resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb index fd518f21b..fdd97bb15 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb @@ -224,7 +224,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@careplan, versioned_resource_class('CarePlan')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '09' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -240,7 +240,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'CarePlan resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb index 2bd5b7aae..ba69ecc71 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb @@ -125,7 +125,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@careteam, versioned_resource_class('CareTeam')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '06' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -141,7 +141,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'CareTeam resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb index 01608a99d..23e2ee471 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb @@ -243,7 +243,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@condition, versioned_resource_class('Condition')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -261,7 +261,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Condition resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb index cf534fd12..57bfd601b 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb @@ -335,7 +335,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '14' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -351,7 +351,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb index 227d139a4..67deb72bd 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb @@ -335,7 +335,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '14' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -351,7 +351,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb index 964f3310c..c1ee4f549 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb @@ -301,7 +301,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@documentreference, versioned_resource_class('DocumentReference')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '13' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -319,7 +319,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'DocumentReference resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb index c7bad0d4b..5aa2c4c17 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb @@ -293,7 +293,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@encounter, versioned_resource_class('Encounter')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '12' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -311,7 +311,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Encounter resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb index c55c0f262..cd8a11ec0 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb @@ -189,7 +189,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@goal, versioned_resource_class('Goal')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '08' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -207,7 +207,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Goal resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb index c74f7e0d0..70e67b639 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb @@ -189,7 +189,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@immunization, versioned_resource_class('Immunization')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '08' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -207,7 +207,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Immunization resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb index 31ecc2aa1..966f2fc0c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb @@ -152,7 +152,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@device, versioned_resource_class('Device')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '07' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -170,7 +170,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Device resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb index f47c7902e..b67649e5a 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb @@ -229,7 +229,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@location, versioned_resource_class('Location')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -247,7 +247,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Location resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb index 8451f104f..ae4b097e1 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb @@ -66,7 +66,7 @@ class USCore301MedicationSequence < SequenceBase validate_history_reply(@medication, versioned_resource_class('Medication')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '04' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -81,7 +81,7 @@ class USCore301MedicationSequence < SequenceBase assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Medication resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb index 05ad2716a..db93c7433 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb @@ -214,7 +214,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '09' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -233,7 +233,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb index 21c66cf0f..4d2148f3c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb @@ -232,7 +232,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@observation, versioned_resource_class('Observation')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -248,7 +248,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Observation resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb index 3af190d01..497dd689c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb @@ -151,7 +151,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@organization, versioned_resource_class('Organization')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '07' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -169,7 +169,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Organization resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb index 2ff05ed6f..de82e3e86 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb @@ -286,7 +286,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@patient, versioned_resource_class('Patient')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '12' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -302,7 +302,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Patient resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb index f409f6f40..076a5a6c1 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb @@ -158,7 +158,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@practitioner, versioned_resource_class('Practitioner')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '07' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -176,7 +176,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Practitioner resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb index 8d8d0ffa1..fc2030711 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb @@ -151,7 +151,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '07' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -169,7 +169,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb index 8d7cf8d53..9068352fd 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb @@ -208,7 +208,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@procedure, versioned_resource_class('Procedure')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '09' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -226,7 +226,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Procedure resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb index ad6845ac2..d92b536aa 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb @@ -238,7 +238,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@observation, versioned_resource_class('Observation')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -257,7 +257,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Observation resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb index 776426b4f..f31cecbdd 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb @@ -232,7 +232,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@observation, versioned_resource_class('Observation')) end - test 'A Server SHALL be capable of supporting the following _revincludes: Provenance:target' do + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' @@ -248,7 +248,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) assert_bundle_response(reply) provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No provenance resources were returned from this search' + assert provenance_results, 'No Provenance resources were returned from this search' end test 'Observation resources associated with Patient conform to US Core R4 profiles' do From 65e2b957dab6d83fc298703f89411a7532ad1cc1 Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 22 Oct 2019 19:42:27 -0400 Subject: [PATCH 023/173] address github issues --- generator/uscore/uscore_generator.rb | 7 ++++--- .../uscore_v3.0.1/us_core_medicationrequest_sequence.rb | 4 ++-- .../uscore_v3.0.1/us_core_practitionerrole_sequence.rb | 8 ++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 44b76aa73..21d3ad24d 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -142,14 +142,15 @@ def create_include_test(sequence) search_params = first_search.nil? ? 'search_params = {}' : get_search_params(first_search[:names], sequence) include_test[:test_code] = search_params sequence[:include_params].each do |include| - included_resource = include.split(':').last.capitalize # kind of a hack, but works for now - would have to otherwise figure out resource type of target profile + resource_name = include.split(':').last.capitalize + resource_variable = "#{resource_name.downcase}_results" # kind of a hack, but works for now - would have to otherwise figure out resource type of target profile include_test[:test_code] += %( search_params['_include'] = '#{include}' reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - #{included_resource.downcase}_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == '#{included_resource}' } - assert #{included_resource.downcase}_results.any?, 'No #{included_resource.downcase} resources were returned from this search' + #{resource_variable} = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == '#{resource_name}' } + assert #{resource_variable}, 'No #{resource_name} resources were returned from this search' ) end sequence[:tests] << include_test diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb index bafee3c4d..9fc0faac5 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb @@ -232,8 +232,8 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - medication_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Medication' } - assert medication_results.any?, 'No medication resources were returned from this search' + medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } + assert medication_results, 'No Medication resources were returned from this search' end test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb index 6d3118b47..fee7f66a7 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb @@ -168,15 +168,15 @@ def validate_resource_item(resource, property, value) reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - endpoint_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Endpoint' } - assert endpoint_results.any?, 'No endpoint resources were returned from this search' + endpoint_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Endpoint' } + assert endpoint_results, 'No Endpoint resources were returned from this search' search_params['_include'] = 'PractitionerRole:practitioner' reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) assert_response_ok(reply) assert_bundle_response(reply) - practitioner_results = reply&.resource&.entry&.map(&:resource)&.select { |resource| resource.resourceType == 'Practitioner' } - assert practitioner_results.any?, 'No practitioner resources were returned from this search' + practitioner_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Practitioner' } + assert practitioner_results, 'No Practitioner resources were returned from this search' end test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do From b28131563018db4b213e5a93de6afb05d74a3768 Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 24 Oct 2019 10:21:42 -0400 Subject: [PATCH 024/173] fix parameter fetching in delayed resources --- generator/uscore/uscore_generator.rb | 1 + .../pediatric_bmi_for_age_sequence.rb | 2 +- .../pediatric_weight_for_height_sequence.rb | 2 +- .../us_core_allergyintolerance_sequence.rb | 2 +- .../us_core_careplan_sequence.rb | 2 +- .../us_core_careteam_sequence.rb | 2 +- .../us_core_condition_sequence.rb | 2 +- .../uscore_v3.0.0/us_core_device_sequence.rb | 2 +- .../us_core_diagnosticreport_lab_sequence.rb | 2 +- .../us_core_diagnosticreport_note_sequence.rb | 2 +- .../us_core_documentreference_sequence.rb | 2 +- .../us_core_encounter_sequence.rb | 2 +- .../uscore_v3.0.0/us_core_goal_sequence.rb | 2 +- .../us_core_immunization_sequence.rb | 2 +- .../us_core_location_sequence.rb | 3 +- .../us_core_medication_sequence.rb | 1 + .../us_core_medicationrequest_sequence.rb | 29 +++++++++++++-- .../us_core_medicationstatement_sequence.rb | 29 +++++++++++++-- .../us_core_observation_lab_sequence.rb | 2 +- .../us_core_organization_sequence.rb | 3 +- .../uscore_v3.0.0/us_core_patient_sequence.rb | 2 +- .../us_core_practitioner_sequence.rb | 3 +- .../us_core_practitionerrole_sequence.rb | 37 +++++++++++++++++-- .../us_core_procedure_sequence.rb | 2 +- .../us_core_smokingstatus_sequence.rb | 2 +- .../us_core_location_sequence.rb | 1 + .../us_core_medication_sequence.rb | 1 + .../us_core_medicationrequest_sequence.rb | 2 +- .../us_core_organization_sequence.rb | 1 + .../us_core_practitioner_sequence.rb | 1 + .../us_core_practitionerrole_sequence.rb | 3 +- .../us_core_provenance_sequence.rb | 1 + 32 files changed, 116 insertions(+), 34 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index cd9656204..5fce4ce5a 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -107,6 +107,7 @@ def create_read_test(sequence) #{sequence[:resource].downcase}_id = @instance.resource_references.find { |reference| reference.resource_type == '#{sequence[:resource]}' }&.resource_id skip 'No #{sequence[:resource]} references found from the prior searches' if #{sequence[:resource].downcase}_id.nil? @#{sequence[:resource].downcase} = fetch_resource('#{sequence[:resource]}', #{sequence[:resource].downcase}_id) + @#{sequence[:resource].downcase}_ary = Array.wrap(@#{sequence[:resource].downcase}) @resources_found = !@#{sequence[:resource].downcase}.nil?) sequence[:tests] << read_test end diff --git a/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb index d21133bc7..594ecc6f3 100644 --- a/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - save_delayed_sequence_references(@observation) + save_delayed_sequence_references(@observation_ary) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb index 4d715fae2..daf77caf6 100644 --- a/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - save_delayed_sequence_references(@observation) + save_delayed_sequence_references(@observation_ary) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb index 6caf78dbd..0f386e65d 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb @@ -80,7 +80,7 @@ def validate_resource_item(resource, property, value) @allergyintolerance = reply&.resource&.entry&.first&.resource @allergyintolerance_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('AllergyIntolerance'), reply) - save_delayed_sequence_references(@allergyintolerance) + save_delayed_sequence_references(@allergyintolerance_ary) validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb index 8343eceed..357e82f02 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb @@ -86,7 +86,7 @@ def validate_resource_item(resource, property, value) @careplan = reply&.resource&.entry&.first&.resource @careplan_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) - save_delayed_sequence_references(@careplan) + save_delayed_sequence_references(@careplan_ary) validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb index f805ead48..bf05d7e36 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb @@ -76,7 +76,7 @@ def validate_resource_item(resource, property, value) @careteam = reply&.resource&.entry&.first&.resource @careteam_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) - save_delayed_sequence_references(@careteam) + save_delayed_sequence_references(@careteam_ary) validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb index 9e9b64d1b..c7f6b07dd 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb @@ -94,7 +94,7 @@ def validate_resource_item(resource, property, value) @condition = reply&.resource&.entry&.first&.resource @condition_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Condition'), reply) - save_delayed_sequence_references(@condition) + save_delayed_sequence_references(@condition_ary) validate_search_reply(versioned_resource_class('Condition'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb index 6c9a97b6e..1a67dcaf1 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb @@ -80,7 +80,7 @@ def validate_resource_item(resource, property, value) @device = reply&.resource&.entry&.first&.resource @device_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Device'), reply) - save_delayed_sequence_references(@device) + save_delayed_sequence_references(@device_ary) validate_search_reply(versioned_resource_class('Device'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb index 1aeadab03..c1194bcb9 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @diagnosticreport = reply&.resource&.entry&.first&.resource @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - save_delayed_sequence_references(@diagnosticreport) + save_delayed_sequence_references(@diagnosticreport_ary) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb index 8d419ff03..3d63f6511 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @diagnosticreport = reply&.resource&.entry&.first&.resource @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - save_delayed_sequence_references(@diagnosticreport) + save_delayed_sequence_references(@diagnosticreport_ary) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb index 99c5dcefd..1c0770350 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb @@ -102,7 +102,7 @@ def validate_resource_item(resource, property, value) @documentreference = reply&.resource&.entry&.first&.resource @documentreference_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('DocumentReference'), reply) - save_delayed_sequence_references(@documentreference) + save_delayed_sequence_references(@documentreference_ary) validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb index 049d10e86..f0eb41009 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb @@ -102,7 +102,7 @@ def validate_resource_item(resource, property, value) @encounter = reply&.resource&.entry&.first&.resource @encounter_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Encounter'), reply) - save_delayed_sequence_references(@encounter) + save_delayed_sequence_references(@encounter_ary) validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb index 4aca4f798..1667e946f 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb @@ -86,7 +86,7 @@ def validate_resource_item(resource, property, value) @goal = reply&.resource&.entry&.first&.resource @goal_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Goal'), reply) - save_delayed_sequence_references(@goal) + save_delayed_sequence_references(@goal_ary) validate_search_reply(versioned_resource_class('Goal'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb index c5e5d8464..e0bd19e43 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb @@ -86,7 +86,7 @@ def validate_resource_item(resource, property, value) @immunization = reply&.resource&.entry&.first&.resource @immunization_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Immunization'), reply) - save_delayed_sequence_references(@immunization) + save_delayed_sequence_references(@immunization_ary) validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb index ed432c4f6..1d78133bd 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb @@ -65,6 +65,7 @@ def validate_resource_item(resource, property, value) location_id = @instance.resource_references.find { |reference| reference.resource_type == 'Location' }&.resource_id skip 'No Location references found from the prior searches' if location_id.nil? @location = fetch_resource('Location', location_id) + @location_ary = Array.wrap(@location) @resources_found = !@location.nil? end @@ -114,7 +115,7 @@ def validate_resource_item(resource, property, value) @location = reply&.resource&.entry&.first&.resource @location_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Location'), reply) - save_delayed_sequence_references(@location) + save_delayed_sequence_references(@location_ary) validate_search_reply(versioned_resource_class('Location'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medication_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medication_sequence.rb index 4ed9e70cf..1bbc2d208 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_medication_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_medication_sequence.rb @@ -33,6 +33,7 @@ class USCore300MedicationSequence < SequenceBase medication_id = @instance.resource_references.find { |reference| reference.resource_type == 'Medication' }&.resource_id skip 'No Medication references found from the prior searches' if medication_id.nil? @medication = fetch_resource('Medication', medication_id) + @medication_ary = Array.wrap(@medication) @resources_found = !@medication.nil? end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb index 99aaf6920..0ff389964 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb @@ -84,7 +84,7 @@ def validate_resource_item(resource, property, value) @medicationrequest = reply&.resource&.entry&.first&.resource @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) - save_delayed_sequence_references(@medicationrequest) + save_delayed_sequence_references(@medicationrequest_ary) validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) end @@ -178,9 +178,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) end - test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHOULD be capable of supporting the following _includes: MedicationRequest:medication' do metadata do id '08' + link 'https://www.hl7.org/fhir/search.html#include' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_include'] = 'MedicationRequest:medication' + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } + assert medication_results, 'No Medication resources were returned from this search' + end + + test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '09' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest' description %( ) @@ -193,7 +214,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any MedicationRequest for this patient.' do metadata do - id '09' + id '10' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -227,7 +248,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '10' + id '11' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb index f07a68ef3..9cfa78f31 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb @@ -86,7 +86,7 @@ def validate_resource_item(resource, property, value) @medicationstatement = reply&.resource&.entry&.first&.resource @medicationstatement_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('MedicationStatement'), reply) - save_delayed_sequence_references(@medicationstatement) + save_delayed_sequence_references(@medicationstatement_ary) validate_search_reply(versioned_resource_class('MedicationStatement'), reply, search_params) end @@ -189,9 +189,30 @@ def validate_resource_item(resource, property, value) validate_history_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) end - test 'MedicationStatement resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHOULD be capable of supporting the following _includes: MedicationStatement:medication' do metadata do id '08' + link 'https://www.hl7.org/fhir/search.html#include' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_include'] = 'MedicationStatement:medication' + reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } + assert medication_results, 'No Medication resources were returned from this search' + end + + test 'MedicationStatement resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '09' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationstatement' description %( ) @@ -204,7 +225,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any MedicationStatement for this patient.' do metadata do - id '09' + id '10' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -238,7 +259,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '10' + id '11' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb index a1a0fd727..a20abc14f 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - save_delayed_sequence_references(@observation) + save_delayed_sequence_references(@observation_ary) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb index 3860a72db..5f3827fe6 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb @@ -53,6 +53,7 @@ def validate_resource_item(resource, property, value) organization_id = @instance.resource_references.find { |reference| reference.resource_type == 'Organization' }&.resource_id skip 'No Organization references found from the prior searches' if organization_id.nil? @organization = fetch_resource('Organization', organization_id) + @organization_ary = Array.wrap(@organization) @resources_found = !@organization.nil? end @@ -102,7 +103,7 @@ def validate_resource_item(resource, property, value) @organization = reply&.resource&.entry&.first&.resource @organization_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Organization'), reply) - save_delayed_sequence_references(@organization) + save_delayed_sequence_references(@organization_ary) validate_search_reply(versioned_resource_class('Organization'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb index 8537fc646..fcccc2ac0 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb @@ -105,7 +105,7 @@ def validate_resource_item(resource, property, value) @patient = reply&.resource&.entry&.first&.resource @patient_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Patient'), reply) - save_delayed_sequence_references(@patient) + save_delayed_sequence_references(@patient_ary) validate_search_reply(versioned_resource_class('Patient'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb index 5de9272db..95350e769 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb @@ -54,6 +54,7 @@ def validate_resource_item(resource, property, value) practitioner_id = @instance.resource_references.find { |reference| reference.resource_type == 'Practitioner' }&.resource_id skip 'No Practitioner references found from the prior searches' if practitioner_id.nil? @practitioner = fetch_resource('Practitioner', practitioner_id) + @practitioner_ary = Array.wrap(@practitioner) @resources_found = !@practitioner.nil? end @@ -103,7 +104,7 @@ def validate_resource_item(resource, property, value) @practitioner = reply&.resource&.entry&.first&.resource @practitioner_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Practitioner'), reply) - save_delayed_sequence_references(@practitioner) + save_delayed_sequence_references(@practitioner_ary) validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb index 92fcca334..bd546017a 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb @@ -47,6 +47,7 @@ def validate_resource_item(resource, property, value) practitionerrole_id = @instance.resource_references.find { |reference| reference.resource_type == 'PractitionerRole' }&.resource_id skip 'No PractitionerRole references found from the prior searches' if practitionerrole_id.nil? @practitionerrole = fetch_resource('PractitionerRole', practitionerrole_id) + @practitionerrole_ary = Array.wrap(@practitionerrole) @resources_found = !@practitionerrole.nil? end @@ -96,7 +97,7 @@ def validate_resource_item(resource, property, value) @practitionerrole = reply&.resource&.entry&.first&.resource @practitionerrole_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('PractitionerRole'), reply) - save_delayed_sequence_references(@practitionerrole) + save_delayed_sequence_references(@practitionerrole_ary) validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) end @@ -151,9 +152,37 @@ def validate_resource_item(resource, property, value) validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) end - test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do + test 'A Server SHOULD be capable of supporting the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do metadata do id '07' + link 'https://www.hl7.org/fhir/search.html#include' + description %( + ) + versions :r4 + end + + specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + search_params = { 'specialty': specialty_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_include'] = 'PractitionerRole:endpoint' + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + endpoint_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Endpoint' } + assert endpoint_results, 'No Endpoint resources were returned from this search' + + search_params['_include'] = 'PractitionerRole:practitioner' + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + practitioner_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Practitioner' } + assert practitioner_results, 'No Practitioner resources were returned from this search' + end + + test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole' description %( ) @@ -166,7 +195,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any PractitionerRole for this patient.' do metadata do - id '08' + id '09' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -201,7 +230,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '09' + id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb index 3f92f780e..89d882fce 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @procedure = reply&.resource&.entry&.first&.resource @procedure_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Procedure'), reply) - save_delayed_sequence_references(@procedure) + save_delayed_sequence_references(@procedure_ary) validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb index e91bcd3fd..bdb466ee0 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb @@ -90,7 +90,7 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - save_delayed_sequence_references(@observation) + save_delayed_sequence_references(@observation_ary) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb index 6ad7d3f2a..c39b174e3 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb @@ -65,6 +65,7 @@ def validate_resource_item(resource, property, value) location_id = @instance.resource_references.find { |reference| reference.resource_type == 'Location' }&.resource_id skip 'No Location references found from the prior searches' if location_id.nil? @location = fetch_resource('Location', location_id) + @location_ary = Array.wrap(@location) @resources_found = !@location.nil? end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb index 421711bc6..640fb83c1 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb @@ -33,6 +33,7 @@ class USCore301MedicationSequence < SequenceBase medication_id = @instance.resource_references.find { |reference| reference.resource_type == 'Medication' }&.resource_id skip 'No Medication references found from the prior searches' if medication_id.nil? @medication = fetch_resource('Medication', medication_id) + @medication_ary = Array.wrap(@medication) @resources_found = !@medication.nil? end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb index c223d9aa9..4a459c4fe 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb @@ -224,7 +224,7 @@ def validate_resource_item(resource, property, value) end patient_val = @instance.patient_id - intent_val = resolve_element_from_path(@medicationrequest, 'intent') + intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) search_params = { 'patient': patient_val, 'intent': intent_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb index 71e5146d4..848f52f81 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb @@ -53,6 +53,7 @@ def validate_resource_item(resource, property, value) organization_id = @instance.resource_references.find { |reference| reference.resource_type == 'Organization' }&.resource_id skip 'No Organization references found from the prior searches' if organization_id.nil? @organization = fetch_resource('Organization', organization_id) + @organization_ary = Array.wrap(@organization) @resources_found = !@organization.nil? end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb index 831f97b1d..097d3c9b5 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb @@ -54,6 +54,7 @@ def validate_resource_item(resource, property, value) practitioner_id = @instance.resource_references.find { |reference| reference.resource_type == 'Practitioner' }&.resource_id skip 'No Practitioner references found from the prior searches' if practitioner_id.nil? @practitioner = fetch_resource('Practitioner', practitioner_id) + @practitioner_ary = Array.wrap(@practitioner) @resources_found = !@practitioner.nil? end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb index ef52aa388..fa4a0adcc 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb @@ -47,6 +47,7 @@ def validate_resource_item(resource, property, value) practitionerrole_id = @instance.resource_references.find { |reference| reference.resource_type == 'PractitionerRole' }&.resource_id skip 'No PractitionerRole references found from the prior searches' if practitionerrole_id.nil? @practitionerrole = fetch_resource('PractitionerRole', practitionerrole_id) + @practitionerrole_ary = Array.wrap(@practitionerrole) @resources_found = !@practitionerrole.nil? end @@ -160,7 +161,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - specialty_val = resolve_element_from_path(@practitionerrole, 'specialty.coding.code') + specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) search_params = { 'specialty': specialty_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/app/modules/uscore_v3.0.1/us_core_provenance_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_provenance_sequence.rb index 1a9195396..0421a35de 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_provenance_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_provenance_sequence.rb @@ -33,6 +33,7 @@ class USCore301ProvenanceSequence < SequenceBase provenance_id = @instance.resource_references.find { |reference| reference.resource_type == 'Provenance' }&.resource_id skip 'No Provenance references found from the prior searches' if provenance_id.nil? @provenance = fetch_resource('Provenance', provenance_id) + @provenance_ary = Array.wrap(@provenance) @resources_found = !@provenance.nil? end From af4865db865e929aea8a2559a32aa76ab9cd988b Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Mon, 21 Oct 2019 15:55:12 -0400 Subject: [PATCH 025/173] WIP track assertions in helper methods --- lib/app/utils/assertions.rb | 7 +- test/support/sequence_coverage_reporting.rb | 93 +++++++++++++++------ 2 files changed, 70 insertions(+), 30 deletions(-) diff --git a/lib/app/utils/assertions.rb b/lib/app/utils/assertions.rb index 12006cd22..560c134b2 100644 --- a/lib/app/utils/assertions.rb +++ b/lib/app/utils/assertions.rb @@ -7,12 +7,7 @@ module Inferno module Assertions def assert(test, message = 'assertion failed, no message', data = '') if ENV['RACK_ENV'] == 'test' && create_assertion_report? - sequence_line_regex = %r{inferno/lib/app/modules/(\w+/\w+\.rb:\d+)} - backtrace_location = caller_locations.find { |location| location.to_s.match? sequence_line_regex } - call_site = backtrace_location&.to_s&.match(sequence_line_regex)&.[](1) - if call_site.present? - AssertionTracker.add_assertion_call(call_site, !!test) # rubocop:disable Style/DoubleNegation - end + AssertionTracker.add_assertion_call(!!test) # rubocop:disable Style/DoubleNegation end raise AssertionException.new message, data unless test diff --git a/test/support/sequence_coverage_reporting.rb b/test/support/sequence_coverage_reporting.rb index 6c0cb3b4e..d373f7deb 100644 --- a/test/support/sequence_coverage_reporting.rb +++ b/test/support/sequence_coverage_reporting.rb @@ -30,7 +30,7 @@ def location(node) end def stripped_file_name - @stripped_file_name ||= file_name.split('lib/app/modules/').last + @stripped_file_name ||= file_name.split('lib/app/').last end end @@ -38,13 +38,14 @@ def stripped_file_name # assertion is called class AssertionTracker class << self + def assertion_method_names @assertion_method_names ||= Set.new(Inferno::Assertions.instance_methods) end # Assertion locations determined through analyzing the AST def assertion_locations - @assertion_locations ||= [] + @assertion_locations ||= Set.new end # Assertion calls detected at runtime @@ -60,49 +61,93 @@ def add_assertion_location(location) assertion_locations << location end - def add_assertion_call(location, result) + def add_assertion_call(result) + location = AssertionCallLocationFormatter.new.location + return if location.blank? + + add_assertion_location(location) assertion_calls[location] << result end end end +class AssertionCallLocationFormatter + SEQUENCE_LINE_REGEX = %r{inferno/lib/app/(modules/\w+/\w+\.rb:\d+)} + LINE_REGEX = %r{inferno/lib/app/((?:\w+/?)+\.rb:\d+)} + ASSERTION_CALL_REGEX = %r{inferno/lib/app/utils/assertions.rb:\d+} + + attr_accessor :sequence_call_index, :assertion_call_index + + def initialize + generate_sequence_call_index + generate_assertion_call_index + end + + def backtrace + @backtrace ||= caller_locations + end + + def generate_sequence_call_index + self.sequence_call_index = backtrace.rindex { |location| location.to_s.match? SEQUENCE_LINE_REGEX } + + adjust_index_to_handle_blocks + end + + def generate_assertion_call_index + self.assertion_call_index = backtrace.rindex { |location| location.to_s.match? ASSERTION_CALL_REGEX } + end + + def method_name + @method_name ||= backtrace[sequence_call_index].to_s.match(/`(.*)'/)&.[](1) + end + + # This adjusts sequence_call_index so that when assertions are wrapped in a + # warning block, this index refers to the method call inside the warning block + # rather than the warning call itself + def adjust_index_to_handle_blocks + return if sequence_call_index.blank? || assertion_call_index.blank? + + (assertion_call_index...sequence_call_index).to_a.reverse.each do |index| + if backtrace[index].to_s.match?(/block .*in #{method_name}/) + self.sequence_call_index = index + end + end + end + + def location + return unless sequence_call_index.present? && assertion_call_index.present? + [backtrace[sequence_call_index], backtrace[assertion_call_index + 1]] + .uniq + .map { |location| location&.to_s&.match(LINE_REGEX)&.[](1) } + .join(' -> ') + end +end + class AssertionReporter class << self def report create_csv - print_unknown_call_sites end def create_csv CSV.open(File.join(__dir__, '..', '..', 'sequence_coverage.csv'), 'wb') do |csv| csv << ['Assertion Location', 'Pass Count', 'Fail Count'] AssertionTracker.assertion_locations.sort.each do |location| - results = AssertionTracker.assertion_calls[location] - csv << [location, pass_count(results), fail_count(results)] + csv << [location, pass_count(location), fail_count(location)] end end end - def pass_count(results) - results.count { |result| result } - end - - def fail_count(results) - results.count(&:!) - end - - # Locations which called an assertion which was not detected in the AST. - # This happens when a method from outside of the sequence makes an assertion - # (e.g., a method from SequenceBase). - def unknown_call_sites - AssertionTracker.assertion_calls.keys - AssertionTracker.assertion_locations + def pass_count(location) + AssertionTracker.assertion_calls.reduce(0) do |count, (key, results)| + key.end_with?(location) ? count + results.count { |result| result } : count + end end - def print_unknown_call_sites - return if unknown_call_sites.blank? - - puts "\nUnrecognized assertion call sites:" - puts unknown_call_sites.join("\n") + def fail_count(location) + AssertionTracker.assertion_calls.reduce(0) do |count, (key, results)| + key.end_with?(location) ? count + results.count(&:!) : count + end end end end From 6573cf01498ee43ce143312fcdb8bcabe3686660 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 24 Oct 2019 13:21:24 -0400 Subject: [PATCH 026/173] distinguish direct and indirect assertion calls --- test/support/sequence_coverage_reporting.rb | 82 +++++++++++++++++---- 1 file changed, 67 insertions(+), 15 deletions(-) diff --git a/test/support/sequence_coverage_reporting.rb b/test/support/sequence_coverage_reporting.rb index d373f7deb..124cc7783 100644 --- a/test/support/sequence_coverage_reporting.rb +++ b/test/support/sequence_coverage_reporting.rb @@ -5,6 +5,11 @@ require 'pry' require_relative '../../lib/app/utils/assertions' +# To generate a sequence coverage report, run the unit tests with the +# ASSERTION_REPORT environment variable set to true: +# +# ASSERTION_REPORT=true bundle exec rake + # AST processor which finds the location of each assertion in a sequence class SequenceProcessor include AST::Processor::Mixin @@ -38,7 +43,6 @@ def stripped_file_name # assertion is called class AssertionTracker class << self - def assertion_method_names @assertion_method_names ||= Set.new(Inferno::Assertions.instance_methods) end @@ -72,15 +76,16 @@ def add_assertion_call(result) end class AssertionCallLocationFormatter - SEQUENCE_LINE_REGEX = %r{inferno/lib/app/(modules/\w+/\w+\.rb:\d+)} - LINE_REGEX = %r{inferno/lib/app/((?:\w+/?)+\.rb:\d+)} - ASSERTION_CALL_REGEX = %r{inferno/lib/app/utils/assertions.rb:\d+} + SEQUENCE_LINE_REGEX = %r{inferno/lib/app/(modules/\w+/\w+\.rb:\d+)}.freeze + LINE_REGEX = %r{inferno/lib/app/((?:\w+/?)+\.rb:\d+)}.freeze + ASSERTION_CALL_REGEX = %r{inferno/lib/app/utils/assertions.rb:\d+}.freeze + CALL_SEPARATOR = ' => ' attr_accessor :sequence_call_index, :assertion_call_index def initialize - generate_sequence_call_index generate_assertion_call_index + generate_sequence_call_index end def backtrace @@ -108,21 +113,40 @@ def adjust_index_to_handle_blocks return if sequence_call_index.blank? || assertion_call_index.blank? (assertion_call_index...sequence_call_index).to_a.reverse.each do |index| - if backtrace[index].to_s.match?(/block .*in #{method_name}/) - self.sequence_call_index = index - end + self.sequence_call_index = index if backtrace[index].to_s.match?(/block .*in #{method_name}/) end end def location return unless sequence_call_index.present? && assertion_call_index.present? + [backtrace[sequence_call_index], backtrace[assertion_call_index + 1]] .uniq .map { |location| location&.to_s&.match(LINE_REGEX)&.[](1) } - .join(' -> ') + .join(CALL_SEPARATOR) end end +# This class generates a csv file with information on how many times each +# assertion passed or failed in unit tests. The output differentiates direct and +# indirect assertion calls. Direct assertion calls are assertions that are +# called directly in a test or method being tested. Indirect assertion calls are +# assertions that are called within a method that is called by the test being +# tested. +# +# test '1' do +# assert true # direct assertion call +# end +# +# test '2' do +# validate +# end +# +# def validate +# assert true # Direct assertion call if we are unit testing the validate +# # method. +# # Indirect assertion call if we are unit testing test '2'. +# end class AssertionReporter class << self def report @@ -131,22 +155,50 @@ def report def create_csv CSV.open(File.join(__dir__, '..', '..', 'sequence_coverage.csv'), 'wb') do |csv| - csv << ['Assertion Location', 'Pass Count', 'Fail Count'] + csv << [ + 'Assertion Location', + 'Direct Pass Count', + 'Direct Fail Count', + 'Indirect Pass Count', + 'Indirect Fail Count' + ] AssertionTracker.assertion_locations.sort.each do |location| - csv << [location, pass_count(location), fail_count(location)] + csv << [ + location, + direct_pass_count(location), + direct_fail_count(location), + indirect_pass_count(location), + indirect_fail_count(location) + ] end end end - def pass_count(location) + def direct_call?(location) + location.include? AssertionCallLocationFormatter::CALL_SEPARATOR + end + + def direct_pass_count(location) + AssertionTracker.assertion_calls[location].count { |result| result } + end + + def direct_fail_count(location) + AssertionTracker.assertion_calls[location].count(&:!) + end + + def indirect_pass_count(location) + return if direct_call? location + AssertionTracker.assertion_calls.reduce(0) do |count, (key, results)| - key.end_with?(location) ? count + results.count { |result| result } : count + key.end_with?(location) && key != location ? count + results.count { |result| result } : count end end - def fail_count(location) + def indirect_fail_count(location) + return if direct_call? location + AssertionTracker.assertion_calls.reduce(0) do |count, (key, results)| - key.end_with?(location) ? count + results.count(&:!) : count + key.end_with?(location) && key != location ? count + results.count(&:!) : count end end end From cefd7a2014b6c4296edcd0b019943ad9ad079c3b Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 24 Oct 2019 15:49:05 -0400 Subject: [PATCH 027/173] use reverse_each --- test/support/sequence_coverage_reporting.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/support/sequence_coverage_reporting.rb b/test/support/sequence_coverage_reporting.rb index 124cc7783..fd5d63b0e 100644 --- a/test/support/sequence_coverage_reporting.rb +++ b/test/support/sequence_coverage_reporting.rb @@ -112,7 +112,7 @@ def method_name def adjust_index_to_handle_blocks return if sequence_call_index.blank? || assertion_call_index.blank? - (assertion_call_index...sequence_call_index).to_a.reverse.each do |index| + (assertion_call_index...sequence_call_index).to_a.reverse_each do |index| self.sequence_call_index = index if backtrace[index].to_s.match?(/block .*in #{method_name}/) end end From ab933249a6ef483b06b9ddd9d00a1508fa3ac8a0 Mon Sep 17 00:00:00 2001 From: Chase Date: Thu, 24 Oct 2019 22:41:51 -0400 Subject: [PATCH 028/173] fix bug with starts_with --- generator/uscore/uscore_generator.rb | 11 ++++++----- .../uscore_v3.0.0/us_core_location_sequence.rb | 10 +++++----- .../uscore_v3.0.0/us_core_organization_sequence.rb | 10 +++++----- .../uscore_v3.0.1/us_core_location_sequence.rb | 10 +++++----- .../uscore_v3.0.1/us_core_organization_sequence.rb | 10 +++++----- 5 files changed, 26 insertions(+), 25 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 43dd1197b..d7c115ee7 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -331,6 +331,7 @@ def get_search_params(search_parameters, sequence) if param == 'patient' '@instance.patient_id' else + resolve_element_path(sequence[:search_param_descriptions][param.to_sym]) end search_values << "#{variable_name} = #{variable_value}" @@ -432,11 +433,11 @@ def create_search_validation(sequence) when 'Address' search_validators += %( value_found = can_resolve_path(resource, '#{path_parts.join('.')}') do |address| - address&.text&.starts_with(value) || - address&.city&.starts_with(value) || - address&.state&.starts_with(value) || - address&.postalCode&.starts_with(value) || - address&.country&.starts_with(value) + address&.text&.start_with?(value) || + address&.city&.start_with?(value) || + address&.state&.start_with?(value) || + address&.postalCode&.start_with?(value) || + address&.country&.start_with?(value) end assert value_found, '#{element} on resource does not match #{element} requested' ) diff --git a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb index ed432c4f6..f2e21fcb8 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb @@ -22,11 +22,11 @@ def validate_resource_item(resource, property, value) when 'address' value_found = can_resolve_path(resource, 'address') do |address| - address&.text&.starts_with(value) || - address&.city&.starts_with(value) || - address&.state&.starts_with(value) || - address&.postalCode&.starts_with(value) || - address&.country&.starts_with(value) + address&.text&.start_with?(value) || + address&.city&.start_with?(value) || + address&.state&.start_with?(value) || + address&.postalCode&.start_with?(value) || + address&.country&.start_with?(value) end assert value_found, 'address on resource does not match address requested' diff --git a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb index 3860a72db..60fd28148 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb @@ -22,11 +22,11 @@ def validate_resource_item(resource, property, value) when 'address' value_found = can_resolve_path(resource, 'address') do |address| - address&.text&.starts_with(value) || - address&.city&.starts_with(value) || - address&.state&.starts_with(value) || - address&.postalCode&.starts_with(value) || - address&.country&.starts_with(value) + address&.text&.start_with?(value) || + address&.city&.start_with?(value) || + address&.state&.start_with?(value) || + address&.postalCode&.start_with?(value) || + address&.country&.start_with?(value) end assert value_found, 'address on resource does not match address requested' diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb index 085cb1d5b..4cacb944f 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb @@ -22,11 +22,11 @@ def validate_resource_item(resource, property, value) when 'address' value_found = can_resolve_path(resource, 'address') do |address| - address&.text&.starts_with(value) || - address&.city&.starts_with(value) || - address&.state&.starts_with(value) || - address&.postalCode&.starts_with(value) || - address&.country&.starts_with(value) + address&.text&.start_with?(value) || + address&.city&.start_with?(value) || + address&.state&.start_with?(value) || + address&.postalCode&.start_with?(value) || + address&.country&.start_with?(value) end assert value_found, 'address on resource does not match address requested' diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb index ac526270f..5c7ea17c0 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb @@ -22,11 +22,11 @@ def validate_resource_item(resource, property, value) when 'address' value_found = can_resolve_path(resource, 'address') do |address| - address&.text&.starts_with(value) || - address&.city&.starts_with(value) || - address&.state&.starts_with(value) || - address&.postalCode&.starts_with(value) || - address&.country&.starts_with(value) + address&.text&.start_with?(value) || + address&.city&.start_with?(value) || + address&.state&.start_with?(value) || + address&.postalCode&.start_with?(value) || + address&.country&.start_with?(value) end assert value_found, 'address on resource does not match address requested' From c31a1e333ae0eb5f02c8cf1533a46e05d4e30d49 Mon Sep 17 00:00:00 2001 From: Chase Date: Fri, 25 Oct 2019 10:13:51 -0400 Subject: [PATCH 029/173] remove extra line --- generator/uscore/uscore_generator.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index d7c115ee7..267ee6bf2 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -331,7 +331,6 @@ def get_search_params(search_parameters, sequence) if param == 'patient' '@instance.patient_id' else - resolve_element_path(sequence[:search_param_descriptions][param.to_sym]) end search_values << "#{variable_name} = #{variable_value}" From 73c89a3048b9a72ef09bbb99e54bc896a8e02879 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 28 Oct 2019 12:41:24 -0400 Subject: [PATCH 030/173] fix merge and change test description --- generator/uscore/metadata_extractor.rb | 1 + generator/uscore/uscore_generator.rb | 2 +- .../uscore_v3.0.1/us_core_location_sequence.rb | 2 +- .../us_core_medicationrequest_sequence.rb | 12 ++++++------ .../uscore_v3.0.1/us_core_organization_sequence.rb | 2 +- .../uscore_v3.0.1/us_core_practitioner_sequence.rb | 2 +- .../us_core_practitionerrole_sequence.rb | 12 ++++++------ .../uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb | 5 +---- 8 files changed, 18 insertions(+), 20 deletions(-) diff --git a/generator/uscore/metadata_extractor.rb b/generator/uscore/metadata_extractor.rb index fe69cb57a..c12b51905 100644 --- a/generator/uscore/metadata_extractor.rb +++ b/generator/uscore/metadata_extractor.rb @@ -154,6 +154,7 @@ def add_interactions(resource, sequence) def add_include_search(resource, sequence) sequence[:include_params] = resource['searchInclude'] || [] + end def add_revinclude_targets(resource, sequence) sequence[:revincludes] = resource['searchRevInclude'] || [] diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 9f57cc651..6f2ac50bf 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -136,7 +136,7 @@ def create_authorization_test(sequence) def create_include_test(sequence) include_test = { - tests_that: "A Server SHOULD be capable of supporting the following _includes: #{sequence[:include_params].join(', ')}", + tests_that: "Server returns the appropriate resource from the following _includes: #{sequence[:include_params].join(', ')}", index: sequence[:tests].length + 1, link: 'https://www.hl7.org/fhir/search.html#include' } diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb index 1bca32779..3f4b7ba46 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb @@ -245,7 +245,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - name_val = resolve_element_from_path(@location, 'name') + name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) search_params = { 'name': name_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb index e6b2a7b94..22187308e 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb @@ -214,7 +214,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) end - test 'A Server SHOULD be capable of supporting the following _includes: MedicationRequest:medication' do + test 'Server returns the appropriate resource from the following _includes: MedicationRequest:medication' do metadata do id '09' link 'https://www.hl7.org/fhir/search.html#include' @@ -238,7 +238,7 @@ def validate_resource_item(resource, property, value) test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do - id '09' + id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( ) @@ -246,7 +246,7 @@ def validate_resource_item(resource, property, value) end patient_val = @instance.patient_id - intent_val = resolve_element_from_path(@medicationrequest, 'intent') + intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) search_params = { 'patient': patient_val, 'intent': intent_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -260,7 +260,7 @@ def validate_resource_item(resource, property, value) test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do metadata do - id '10' + id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest' description %( ) @@ -273,7 +273,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any MedicationRequest for this patient.' do metadata do - id '11' + id '12' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -311,7 +311,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '12' + id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb index 3be7358e4..3b1b04806 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb @@ -167,7 +167,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - name_val = resolve_element_from_path(@organization, 'name') + name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) search_params = { 'name': name_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb index e505e7566..0958f5631 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb @@ -168,7 +168,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - name_val = resolve_element_from_path(@practitioner, 'name.family') + name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) search_params = { 'name': name_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb index ac904ae41..7b619fbfe 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb @@ -152,7 +152,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) end - test 'A Server SHOULD be capable of supporting the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do + test 'Server returns the appropriate resource from the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do metadata do id '07' link 'https://www.hl7.org/fhir/search.html#include' @@ -182,14 +182,14 @@ def validate_resource_item(resource, property, value) test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do metadata do - id '07' + id '08' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( ) versions :r4 end - specialty_val = resolve_element_from_path(@practitionerrole, 'specialty.coding.code') + specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) search_params = { 'specialty': specialty_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -203,7 +203,7 @@ def validate_resource_item(resource, property, value) test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do metadata do - id '08' + id '09' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole' description %( ) @@ -216,7 +216,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any PractitionerRole for this patient.' do metadata do - id '09' + id '10' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -251,7 +251,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '10' + id '11' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb index d0cbda801..d23351eb5 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb @@ -241,10 +241,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - code_val = resolve_element_from_path(@observation, 'code.coding.code') - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { patient: @instance.patient_id, code: '59408-5' } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) From e6e42cce621ae5c7623005c1f9ddd90f7715db59 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Mon, 28 Oct 2019 14:20:01 -0400 Subject: [PATCH 031/173] address PR comments --- test/support/sequence_coverage_reporting.rb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/test/support/sequence_coverage_reporting.rb b/test/support/sequence_coverage_reporting.rb index fd5d63b0e..79530969e 100644 --- a/test/support/sequence_coverage_reporting.rb +++ b/test/support/sequence_coverage_reporting.rb @@ -2,7 +2,6 @@ require 'ast' require 'parser/current' -require 'pry' require_relative '../../lib/app/utils/assertions' # To generate a sequence coverage report, run the unit tests with the @@ -103,7 +102,7 @@ def generate_assertion_call_index end def method_name - @method_name ||= backtrace[sequence_call_index].to_s.match(/`(.*)'/)&.[](1) + @method_name ||= backtrace[sequence_call_index].to_s.match(/`(.*)'/)&.captures&.first end # This adjusts sequence_call_index so that when assertions are wrapped in a @@ -112,7 +111,7 @@ def method_name def adjust_index_to_handle_blocks return if sequence_call_index.blank? || assertion_call_index.blank? - (assertion_call_index...sequence_call_index).to_a.reverse_each do |index| + (assertion_call_index...sequence_call_index).reverse_each do |index| self.sequence_call_index = index if backtrace[index].to_s.match?(/block .*in #{method_name}/) end end @@ -122,7 +121,7 @@ def location [backtrace[sequence_call_index], backtrace[assertion_call_index + 1]] .uniq - .map { |location| location&.to_s&.match(LINE_REGEX)&.[](1) } + .map { |location| location&.to_s&.match(LINE_REGEX)&.captures&.first } .join(CALL_SEPARATOR) end end @@ -179,7 +178,7 @@ def direct_call?(location) end def direct_pass_count(location) - AssertionTracker.assertion_calls[location].count { |result| result } + AssertionTracker.assertion_calls[location].count(&:itself) end def direct_fail_count(location) @@ -190,7 +189,8 @@ def indirect_pass_count(location) return if direct_call? location AssertionTracker.assertion_calls.reduce(0) do |count, (key, results)| - key.end_with?(location) && key != location ? count + results.count { |result| result } : count + indirect_call = key.end_with?(location) && key != location + indirect_call ? count + results.count(&:itself) : count end end @@ -198,7 +198,8 @@ def indirect_fail_count(location) return if direct_call? location AssertionTracker.assertion_calls.reduce(0) do |count, (key, results)| - key.end_with?(location) && key != location ? count + results.count(&:!) : count + indirect_call = key.end_with?(location) && key != location + indirect_call ? count + results.count(&:!) : count end end end From 9988bca307a048b62453a1a284011767800d011d Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Tue, 29 Oct 2019 16:14:23 -0400 Subject: [PATCH 032/173] Regenerate tests that were missed in last merge. --- .../modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb | 2 +- .../uscore_v3.0.0/us_core_medicationstatement_sequence.rb | 2 +- .../modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb index 0ff389964..e1cb81b4a 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb @@ -178,7 +178,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) end - test 'A Server SHOULD be capable of supporting the following _includes: MedicationRequest:medication' do + test 'Server returns the appropriate resource from the following _includes: MedicationRequest:medication' do metadata do id '08' link 'https://www.hl7.org/fhir/search.html#include' diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb index 9cfa78f31..7f05a5d99 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb @@ -189,7 +189,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) end - test 'A Server SHOULD be capable of supporting the following _includes: MedicationStatement:medication' do + test 'Server returns the appropriate resource from the following _includes: MedicationStatement:medication' do metadata do id '08' link 'https://www.hl7.org/fhir/search.html#include' diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb index bd546017a..0e330a23f 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb @@ -152,7 +152,7 @@ def validate_resource_item(resource, property, value) validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) end - test 'A Server SHOULD be capable of supporting the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do + test 'Server returns the appropriate resource from the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do metadata do id '07' link 'https://www.hl7.org/fhir/search.html#include' From 7cf8ad5128f8d63ea030a7c9bf26c6ee64939c11 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 30 Oct 2019 11:45:57 -0400 Subject: [PATCH 033/173] check for duplicate keys --- lib/app/sequence_base.rb | 7 ++++++- lib/app/utils/exceptions.rb | 3 +++ test/unit/sequence_base_test.rb | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/app/sequence_base.rb b/lib/app/sequence_base.rb index b6aabe2b7..fe9d8d7c1 100644 --- a/lib/app/sequence_base.rb +++ b/lib/app/sequence_base.rb @@ -364,8 +364,13 @@ def self.extends_sequence(klass) # block - The Block test to be executed def self.test(name, &block) @@test_index += 1 + new_test = InfernoTest.new(name, @@test_index, @@test_id_prefixes[sequence_name], &block) - tests << InfernoTest.new(name, @@test_index, @@test_id_prefixes[sequence_name], &block) + if new_test.key.present? && tests.any? { |test| test.key == new_test.key } + raise InvalidKeyException, "Duplicate test key #{new_test.key.inspect} in #{self.name.demodulize}" + end + + tests << new_test end def wrap_test(test) diff --git a/lib/app/utils/exceptions.rb b/lib/app/utils/exceptions.rb index f0e35bcfd..c44ca516c 100644 --- a/lib/app/utils/exceptions.rb +++ b/lib/app/utils/exceptions.rb @@ -101,6 +101,9 @@ class MetadataException < RuntimeError class InvalidMetadataException < RuntimeError end + + class InvalidKeyException < RuntimeError + end end # monkey patch this exception from fhir_client diff --git a/test/unit/sequence_base_test.rb b/test/unit/sequence_base_test.rb index 29c2a3c7a..b0879b53d 100644 --- a/test/unit/sequence_base_test.rb +++ b/test/unit/sequence_base_test.rb @@ -110,4 +110,23 @@ def set_resource_reference(resource, type) assert all_resources.map(&:id) == ['2'] end end + + describe '.test' do + it 'raises an error if two tests have duplicate keys' do + assert_raises(Inferno::InvalidKeyException) do + class InvalidKeySequence < Inferno::Sequence::SequenceBase + 2.times do |index| + test :a do + metadata do + id "0#{index}" + name 'a' + description 'a' + link 'http://example.com' + end + end + end + end + end + end + end end From 72d689d2c2a1499f7a0dc7dd71b202ba525b457e Mon Sep 17 00:00:00 2001 From: Chase Date: Wed, 30 Oct 2019 22:32:58 -0400 Subject: [PATCH 034/173] update capability statement and search for multiple possible values --- generator/uscore/metadata_extractor.rb | 25 ++++- generator/uscore/uscore_generator.rb | 87 ++++++++++------ .../pediatric_bmi_for_age_sequence.rb | 42 ++++---- .../pediatric_weight_for_height_sequence.rb | 42 ++++---- .../us_core_allergyintolerance_sequence.rb | 6 +- .../us_core_careplan_sequence.rb | 60 +++++------ .../us_core_careteam_sequence.rb | 4 +- .../us_core_condition_sequence.rb | 24 ++--- .../us_core_diagnosticreport_lab_sequence.rb | 99 +++++-------------- .../us_core_diagnosticreport_note_sequence.rb | 99 +++++-------------- .../us_core_documentreference_sequence.rb | 38 ++++--- .../us_core_encounter_sequence.rb | 18 ++-- .../uscore_v3.0.1/us_core_goal_sequence.rb | 6 +- .../us_core_immunization_sequence.rb | 34 +++---- .../us_core_implantable_device_sequence.rb | 6 +- .../us_core_location_sequence.rb | 6 +- .../us_core_medicationrequest_sequence.rb | 32 +++--- .../us_core_observation_lab_sequence.rb | 42 ++++---- .../us_core_organization_sequence.rb | 6 +- .../uscore_v3.0.1/us_core_patient_sequence.rb | 28 +++--- .../us_core_practitioner_sequence.rb | 6 +- .../us_core_practitionerrole_sequence.rb | 6 +- .../us_core_procedure_sequence.rb | 6 +- .../us_core_pulse_oximetry_sequence.rb | 20 ++-- .../us_core_smokingstatus_sequence.rb | 20 ++-- .../CapabilityStatement-us-core-server.json | 2 +- 26 files changed, 329 insertions(+), 435 deletions(-) diff --git a/generator/uscore/metadata_extractor.rb b/generator/uscore/metadata_extractor.rb index 264a2784a..9edc2d302 100644 --- a/generator/uscore/metadata_extractor.rb +++ b/generator/uscore/metadata_extractor.rb @@ -196,11 +196,21 @@ def add_search_param_descriptions(profile_definition, sequence) profile_element = profile_definition['snapshot']['element'].select { |el| el['id'] == path }.first param_metadata = { path: path, - comparators: {} + comparators: {}, + values: [] } if !profile_element.nil? param_metadata[:type] = profile_element['type'].first['code'] param_metadata[:contains_multiple] = (profile_element['max'] == '*') + if param_metadata[:contains_multiple] + slices = profile_definition['snapshot']['element'].select { |el| el['path'] == path && el['sliceName'] } + slices.each do |slice| + param_metadata[:values] << slice['patternCodeableConcept']['coding'].first['code'] if slice['patternCodeableConcept'] + end + end + param_metadata[:values] << profile_element['patternCodeableConcept']['coding'].first['code'] if profile_element['patternCodeableConcept'] + fhir_metadata = FHIR.const_get(sequence[:resource])::METADATA[param.to_s] + param_metadata[:values] = fhir_metadata['valid_codes'].values.flatten unless param_metadata[:values].any? || fhir_metadata.nil? || fhir_metadata['valid_codes'].nil? else # search is a variable type eg.) Condition.onsetDateTime - element in profile def is Condition.onset[x] param_metadata[:type] = search_param_definition['type'] @@ -233,9 +243,7 @@ def add_element_definitions(profile_definition, sequence) def add_special_cases(metadata) category_first_profiles = [ - PROFILE_URIS[:diagnostic_report_lab], - PROFILE_URIS[:lab_results], - PROFILE_URIS[:diagnostic_report_note] + PROFILE_URIS[:lab_results] ] # search by patient first @@ -255,6 +263,15 @@ def add_special_cases(metadata) sequence[:searches].unshift(category_search) end end + + # search by patient + intent first for medication request sequence + medication_request_sequence = metadata[:sequences].find { |sequence| sequence[:resource] == 'MedicationRequest' } + intent_search = medication_request_sequence[:searches].find { |param| param[:names] == ['patient', 'intent'] } + unless intent_search.nil? + medication_request_sequence[:searches].delete(intent_search) + medication_request_sequence[:searches].unshift(intent_search) + end + metadata end end diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 43dd1197b..76a3be002 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -123,7 +123,7 @@ def create_authorization_test(sequence) authorization_test[:test_code] = %( @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - #{get_search_params(first_search[:names], sequence)} + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply) @@ -140,29 +140,10 @@ def create_search_test(sequence, search_param) } is_first_search = search_param == find_first_search(sequence) - save_resource_ids_in_bundle_arguments = [ - "versioned_resource_class('#{sequence[:resource]}')", - 'reply', - validation_profile_uri(sequence) - ].compact.join(', ') search_test[:test_code] = if is_first_search - %(#{get_search_params(search_param[:names], sequence)} - reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @#{sequence[:resource].downcase} = reply&.resource&.entry&.first&.resource - @#{sequence[:resource].downcase}_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(#{save_resource_ids_in_bundle_arguments}) - save_delayed_sequence_references(@#{sequence[:resource].downcase}) - validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params)) + get_first_search(search_param[:names], sequence) else %( skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found @@ -318,6 +299,62 @@ def param_value_name(param) end end + def get_first_search(search_parameters, sequence) + search_code = '' + + save_resource_ids_in_bundle_arguments = [ + "versioned_resource_class('#{sequence[:resource]}')", + 'reply', + validation_profile_uri(sequence) + ].compact.join(', ') + + if search_parameters == ['patient'] || sequence[:delayed_sequence] || search_param_constants(search_parameters, sequence) + search_code = %( + #{get_search_params(search_parameters, sequence)} + reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @#{sequence[:resource].downcase} = reply&.resource&.entry&.first&.resource + @#{sequence[:resource].downcase}_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(#{save_resource_ids_in_bundle_arguments}) + save_delayed_sequence_references(@#{sequence[:resource].downcase}) + validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params) + ) + else + non_patient_search_param = search_parameters.find { |param| param != 'patient' } + non_patient_values = sequence[:search_param_descriptions][non_patient_search_param.to_sym][:values] + values_variable_name = param_value_name(non_patient_search_param) + search_code = %( + #{values_variable_name} = [#{non_patient_values.map { |val| "'#{val}'" }.join(', ')}] + #{values_variable_name}.each do |val| + search_params = { 'patient': @instance.patient_id, '#{non_patient_search_param}': val } + reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found + + @#{sequence[:resource].downcase} = reply&.resource&.entry&.first&.resource + @#{sequence[:resource].downcase}_ary = fetch_all_bundled_resources(reply&.resource) + break + end + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + save_resource_ids_in_bundle(#{save_resource_ids_in_bundle_arguments}) + save_delayed_sequence_references(@#{sequence[:resource].downcase}) + validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params)) + end + search_code + end + def get_search_params(search_parameters, sequence) unless search_param_constants(search_parameters, sequence).nil? return %( @@ -378,15 +415,9 @@ def get_comparator_searches(search_params, sequence) end def search_param_constants(search_parameters, sequence) - return "patient: @instance.patient_id, category: 'assess-plan'" if search_parameters == ['patient', 'category'] && sequence[:resource] == 'CarePlan' return "patient: @instance.patient_id, status: 'active'" if search_parameters == ['patient', 'status'] && sequence[:resource] == 'CareTeam' - return "'_id': @instance.patient_id" if search_parameters == ['_id'] && sequence[:resource] == 'Patient' return "patient: @instance.patient_id, code: '72166-2'" if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:smoking_status] - return "patient: @instance.patient_id, category: 'laboratory'" if search_parameters == ['patient', 'category'] && sequence[:profile] == PROFILE_URIS[:lab_results] - return "patient: @instance.patient_id, code: '77606-2'" if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:pediatric_weight_height] - return "patient: @instance.patient_id, code: '59576-9'" if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:pediatric_bmi_age] - return "patient: @instance.patient_id, category: 'LAB'" if search_parameters == ['patient', 'category'] && sequence[:profile] == PROFILE_URIS[:diagnostic_report_lab] - return "patient: @instance.patient_id, code: 'LP29684-5'" if search_parameters == ['patient', 'category'] && sequence[:profile] == PROFILE_URIS[:diagnostic_report_note] + return "'_id': @instance.patient_id" if search_parameters == ['_id'] && sequence[:resource] == 'Patient' return "patient: @instance.patient_id, code: '59408-5'" if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:pulse_oximetry] end diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb index af4677115..ed472a21d 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb @@ -59,9 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '59576-9' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -76,19 +74,23 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '59576-9' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + code_val = ['59576-9'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) save_delayed_sequence_references(@observation) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) @@ -139,7 +141,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Observation search by patient+category+status' do + test 'Server returns expected results from Observation search by patient+code+date' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -153,9 +155,9 @@ def validate_resource_item(resource, property, value) assert !@observation.nil?, 'Expected valid Observation resource to be present' patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -163,7 +165,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Observation search by patient+code+date' do + test 'Server returns expected results from Observation search by patient+category+status' do metadata do id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -177,9 +179,9 @@ def validate_resource_item(resource, property, value) assert !@observation.nil?, 'Expected valid Observation resource to be present' patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb index cf6aed5d7..bab0aca3c 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb @@ -59,9 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '77606-2' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -76,19 +74,23 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '77606-2' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + code_val = ['77606-2'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) save_delayed_sequence_references(@observation) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) @@ -139,7 +141,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Observation search by patient+category+status' do + test 'Server returns expected results from Observation search by patient+code+date' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -153,9 +155,9 @@ def validate_resource_item(resource, property, value) assert !@observation.nil?, 'Expected valid Observation resource to be present' patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -163,7 +165,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Observation search by patient+code+date' do + test 'Server returns expected results from Observation search by patient+category+status' do metadata do id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -177,9 +179,9 @@ def validate_resource_item(resource, property, value) assert !@observation.nil?, 'Expected valid Observation resource to be present' patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb index 829b5e755..989825486 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb @@ -45,11 +45,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb index e64c54eb8..2b2d55dae 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb @@ -55,9 +55,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'assess-plan' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -72,25 +70,29 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, category: 'assess-plan' } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + category_val = ['assess-plan'] + category_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'category': val } + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found + @careplan = reply&.resource&.entry&.first&.resource + @careplan_ary = fetch_all_bundled_resources(reply&.resource) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @careplan = reply&.resource&.entry&.first&.resource - @careplan_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) save_delayed_sequence_references(@careplan) validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) end - test 'Server returns expected results from CarePlan search by patient+category+status' do + test 'Server returns expected results from CarePlan search by patient+category+date' do metadata do id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -105,16 +107,24 @@ def validate_resource_item(resource, property, value) patient_val = @instance.patient_id category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) + assert_response_ok(reply) + end end - test 'Server returns expected results from CarePlan search by patient+category+date' do + test 'Server returns expected results from CarePlan search by patient+category+status+date' do metadata do id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -129,8 +139,9 @@ def validate_resource_item(resource, property, value) patient_val = @instance.patient_id category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) @@ -139,14 +150,14 @@ def validate_resource_item(resource, property, value) ['gt', 'lt', 'le'].each do |comparator| comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': comparator_val } reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) assert_response_ok(reply) end end - test 'Server returns expected results from CarePlan search by patient+category+status+date' do + test 'Server returns expected results from CarePlan search by patient+category+status' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -162,21 +173,12 @@ def validate_resource_item(resource, property, value) patient_val = @instance.patient_id category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) - date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': date_val } + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) - assert_response_ok(reply) - end end test 'CarePlan read resource supported' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb index 132a5d32a..faa8bd018 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb @@ -45,9 +45,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, status: 'active' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb index 2c6012a5c..a9cb3a5c6 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb @@ -59,11 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -98,7 +94,7 @@ def validate_resource_item(resource, property, value) validate_search_reply(versioned_resource_class('Condition'), reply, search_params) end - test 'Server returns expected results from Condition search by patient+clinical-status' do + test 'Server returns expected results from Condition search by patient+category' do metadata do id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -112,8 +108,8 @@ def validate_resource_item(resource, property, value) assert !@condition.nil?, 'Expected valid Condition resource to be present' patient_val = @instance.patient_id - clinical_status_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'clinicalStatus')) - search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } + category_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) @@ -152,7 +148,7 @@ def validate_resource_item(resource, property, value) end end - test 'Server returns expected results from Condition search by patient+code' do + test 'Server returns expected results from Condition search by patient+clinical-status' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -166,8 +162,8 @@ def validate_resource_item(resource, property, value) assert !@condition.nil?, 'Expected valid Condition resource to be present' patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } + clinical_status_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'clinicalStatus')) + search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) @@ -175,7 +171,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Condition search by patient+category' do + test 'Server returns expected results from Condition search by patient+code' do metadata do id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -189,8 +185,8 @@ def validate_resource_item(resource, property, value) assert !@condition.nil?, 'Expected valid Condition resource to be present' patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } + code_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'code')) + search_params = { 'patient': patient_val, 'code': code_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb index 7fce449b0..36d2cbfc1 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb @@ -59,15 +59,13 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'LAB' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply end - test 'Server returns expected results from DiagnosticReport search by patient+category' do + test 'Server returns expected results from DiagnosticReport search by patient' do metadata do id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -76,7 +74,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, category: 'LAB' } + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) assert_response_ok(reply) @@ -94,30 +94,9 @@ def validate_resource_item(resource, property, value) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end - test 'Server returns expected results from DiagnosticReport search by patient' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - test 'Server returns expected results from DiagnosticReport search by patient+code' do metadata do - id '04' + id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -139,7 +118,7 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+category+date' do metadata do - id '05' + id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -168,11 +147,10 @@ def validate_resource_item(resource, property, value) end end - test 'Server returns expected results from DiagnosticReport search by patient+code+date' do + test 'Server returns expected results from DiagnosticReport search by patient+category' do metadata do - id '06' + id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional description %( ) versions :r4 @@ -182,27 +160,18 @@ def validate_resource_item(resource, property, value) assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end end test 'Server returns expected results from DiagnosticReport search by patient+status' do metadata do - id '07' + id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( @@ -223,29 +192,9 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { patient: @instance.patient_id, category: 'LAB' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do + test 'Server returns expected results from DiagnosticReport search by patient+code+date' do metadata do - id '09' + id '07' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( @@ -257,9 +206,9 @@ def validate_resource_item(resource, property, value) assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) + code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -268,7 +217,7 @@ def validate_resource_item(resource, property, value) ['gt', 'lt', 'le'].each do |comparator| comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) assert_response_ok(reply) @@ -277,7 +226,7 @@ def validate_resource_item(resource, property, value) test 'DiagnosticReport create resource supported' do metadata do - id '10' + id '08' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -292,7 +241,7 @@ def validate_resource_item(resource, property, value) test 'DiagnosticReport read resource supported' do metadata do - id '11' + id '09' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -307,7 +256,7 @@ def validate_resource_item(resource, property, value) test 'DiagnosticReport vread resource supported' do metadata do - id '12' + id '10' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -322,7 +271,7 @@ def validate_resource_item(resource, property, value) test 'DiagnosticReport history resource supported' do metadata do - id '13' + id '11' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -337,7 +286,7 @@ def validate_resource_item(resource, property, value) test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do metadata do - id '14' + id '12' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab' description %( ) @@ -350,7 +299,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do metadata do - id '15' + id '13' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -388,7 +337,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '16' + id '14' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb index 5803807ed..92d759362 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb @@ -59,15 +59,13 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply end - test 'Server returns expected results from DiagnosticReport search by patient+category' do + test 'Server returns expected results from DiagnosticReport search by patient' do metadata do id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -76,7 +74,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) assert_response_ok(reply) @@ -94,30 +94,9 @@ def validate_resource_item(resource, property, value) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end - test 'Server returns expected results from DiagnosticReport search by patient' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - test 'Server returns expected results from DiagnosticReport search by patient+code' do metadata do - id '04' + id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -139,7 +118,7 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+category+date' do metadata do - id '05' + id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -168,11 +147,10 @@ def validate_resource_item(resource, property, value) end end - test 'Server returns expected results from DiagnosticReport search by patient+code+date' do + test 'Server returns expected results from DiagnosticReport search by patient+category' do metadata do - id '06' + id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional description %( ) versions :r4 @@ -182,27 +160,18 @@ def validate_resource_item(resource, property, value) assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end end test 'Server returns expected results from DiagnosticReport search by patient+status' do metadata do - id '07' + id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( @@ -223,29 +192,9 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do + test 'Server returns expected results from DiagnosticReport search by patient+code+date' do metadata do - id '09' + id '07' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( @@ -257,9 +206,9 @@ def validate_resource_item(resource, property, value) assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) + code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -268,7 +217,7 @@ def validate_resource_item(resource, property, value) ['gt', 'lt', 'le'].each do |comparator| comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) assert_response_ok(reply) @@ -277,7 +226,7 @@ def validate_resource_item(resource, property, value) test 'DiagnosticReport create resource supported' do metadata do - id '10' + id '08' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -292,7 +241,7 @@ def validate_resource_item(resource, property, value) test 'DiagnosticReport read resource supported' do metadata do - id '11' + id '09' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -307,7 +256,7 @@ def validate_resource_item(resource, property, value) test 'DiagnosticReport vread resource supported' do metadata do - id '12' + id '10' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -322,7 +271,7 @@ def validate_resource_item(resource, property, value) test 'DiagnosticReport history resource supported' do metadata do - id '13' + id '11' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -337,7 +286,7 @@ def validate_resource_item(resource, property, value) test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do metadata do - id '14' + id '12' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note' description %( ) @@ -350,7 +299,7 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do metadata do - id '15' + id '13' link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' description %( ) @@ -387,7 +336,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do - id '16' + id '14' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( ) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb index 22ee4b4b4..5b07558be 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb @@ -67,11 +67,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -127,7 +123,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from DocumentReference search by patient+category+date' do + test 'Server returns expected results from DocumentReference search by patient+type' do metadata do id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -140,9 +136,8 @@ def validate_resource_item(resource, property, value) assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'date')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) + search_params = { 'patient': patient_val, 'type': type_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @@ -150,7 +145,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from DocumentReference search by patient+category' do + test 'Server returns expected results from DocumentReference search by patient+category+date' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -164,7 +159,8 @@ def validate_resource_item(resource, property, value) patient_val = @instance.patient_id category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } + date_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'date')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @@ -172,7 +168,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from DocumentReference search by patient+type' do + test 'Server returns expected results from DocumentReference search by patient+category' do metadata do id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -185,8 +181,8 @@ def validate_resource_item(resource, property, value) assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } + category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @@ -194,7 +190,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from DocumentReference search by patient+status' do + test 'Server returns expected results from DocumentReference search by patient+type+period' do metadata do id '07' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -208,8 +204,9 @@ def validate_resource_item(resource, property, value) assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } + type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) + period_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'context.period')) + search_params = { 'patient': patient_val, 'type': type_val, 'period': period_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @@ -217,7 +214,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from DocumentReference search by patient+type+period' do + test 'Server returns expected results from DocumentReference search by patient+status' do metadata do id '08' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -231,9 +228,8 @@ def validate_resource_item(resource, property, value) assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) - period_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'context.period')) - search_params = { 'patient': patient_val, 'type': type_val, 'period': period_val } + status_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb index af172093b..e828fc594 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb @@ -67,11 +67,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -202,7 +198,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Encounter search by patient+type' do + test 'Server returns expected results from Encounter search by class+patient' do metadata do id '07' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -215,9 +211,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + class_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'local_class')) patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } + search_params = { 'class': class_val, 'patient': patient_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @@ -225,7 +221,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Encounter search by class+patient' do + test 'Server returns expected results from Encounter search by patient+type' do metadata do id '08' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -238,9 +234,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - class_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'local_class')) patient_val = @instance.patient_id - search_params = { 'class': class_val, 'patient': patient_val } + type_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'type')) + search_params = { 'patient': patient_val, 'type': type_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb index 9b37c692b..e3651d7ed 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb @@ -51,11 +51,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb index a6287a945..9cf408233 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb @@ -51,11 +51,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -90,7 +86,7 @@ def validate_resource_item(resource, property, value) validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) end - test 'Server returns expected results from Immunization search by patient+status' do + test 'Server returns expected results from Immunization search by patient+date' do metadata do id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -104,16 +100,24 @@ def validate_resource_item(resource, property, value) assert !@immunization.nil?, 'Expected valid Immunization resource to be present' patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } + date_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'occurrenceDateTime')) + search_params = { 'patient': patient_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Immunization'), comparator_search_params) + validate_search_reply(versioned_resource_class('Immunization'), reply, comparator_search_params) + assert_response_ok(reply) + end end - test 'Server returns expected results from Immunization search by patient+date' do + test 'Server returns expected results from Immunization search by patient+status' do metadata do id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -127,21 +131,13 @@ def validate_resource_item(resource, property, value) assert !@immunization.nil?, 'Expected valid Immunization resource to be present' patient_val = @instance.patient_id - date_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'date': date_val } + status_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Immunization'), comparator_search_params) - validate_search_reply(versioned_resource_class('Immunization'), reply, comparator_search_params) - assert_response_ok(reply) - end end test 'Immunization read resource supported' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb index 42ab27a62..6e7922811 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb @@ -45,11 +45,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Device'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb index 085cb1d5b..c49f8711a 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb @@ -79,11 +79,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Location'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb index c51f8042f..305709d8b 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb @@ -57,12 +57,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - search_params = { 'patient': patient_val, 'intent': intent_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -77,22 +72,23 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - search_params = { 'patient': patient_val, 'intent': intent_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + intent_val = ['proposal', 'plan', 'order', 'original-order', 'reflex-order', 'filler-order', 'instance-order', 'option'] + intent_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'intent': val } + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found + @medicationrequest = reply&.resource&.entry&.first&.resource + @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @medicationrequest = reply&.resource&.entry&.first&.resource - @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) save_delayed_sequence_references(@medicationrequest) validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb index 5d46a763c..da7e3bc9b 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb @@ -59,9 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'laboratory' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -76,19 +74,23 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, category: 'laboratory' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + category_val = ['laboratory'] + category_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'category': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) save_delayed_sequence_references(@observation) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) @@ -139,7 +141,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Observation search by patient+category+status' do + test 'Server returns expected results from Observation search by patient+code+date' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -153,9 +155,9 @@ def validate_resource_item(resource, property, value) assert !@observation.nil?, 'Expected valid Observation resource to be present' patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -163,7 +165,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Observation search by patient+code+date' do + test 'Server returns expected results from Observation search by patient+category+status' do metadata do id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -177,9 +179,9 @@ def validate_resource_item(resource, property, value) assert !@observation.nil?, 'Expected valid Observation resource to be present' patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb index ac526270f..b27bd7084 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb @@ -67,11 +67,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb index 10a7a3147..1ea91283a 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb @@ -74,9 +74,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { '_id': @instance.patient_id } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -151,7 +149,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Patient search by birthdate+name' do + test 'Server returns expected results from Patient search by gender+name' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -163,9 +161,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@patient.nil?, 'Expected valid Patient resource to be present' - birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) + gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'birthdate': birthdate_val, 'name': name_val } + search_params = { 'gender': gender_val, 'name': name_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @@ -173,7 +171,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Patient search by gender+name' do + test 'Server returns expected results from Patient search by birthdate+name' do metadata do id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -185,9 +183,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@patient.nil?, 'Expected valid Patient resource to be present' - gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) + birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'gender': gender_val, 'name': name_val } + search_params = { 'birthdate': birthdate_val, 'name': name_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @@ -195,7 +193,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Patient search by family+gender' do + test 'Server returns expected results from Patient search by birthdate+family' do metadata do id '07' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -208,9 +206,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@patient.nil?, 'Expected valid Patient resource to be present' + birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) - gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) - search_params = { 'family': family_val, 'gender': gender_val } + search_params = { 'birthdate': birthdate_val, 'family': family_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @@ -218,7 +216,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Patient search by birthdate+family' do + test 'Server returns expected results from Patient search by family+gender' do metadata do id '08' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -231,9 +229,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@patient.nil?, 'Expected valid Patient resource to be present' - birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) - search_params = { 'birthdate': birthdate_val, 'family': family_val } + gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) + search_params = { 'family': family_val, 'gender': gender_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb index e067fb70b..6d6edfe10 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb @@ -68,11 +68,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb index 437a8833b..a82ad0b28 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb @@ -61,11 +61,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb index 3abf4702e..40f6674f7 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb @@ -55,11 +55,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb index 60da8ed6e..8a9f972f9 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb @@ -59,9 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '59408-5' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -139,7 +137,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Observation search by patient+category+status' do + test 'Server returns expected results from Observation search by patient+code+date' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -153,9 +151,9 @@ def validate_resource_item(resource, property, value) assert !@observation.nil?, 'Expected valid Observation resource to be present' patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -163,7 +161,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Observation search by patient+code+date' do + test 'Server returns expected results from Observation search by patient+category+status' do metadata do id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -177,9 +175,9 @@ def validate_resource_item(resource, property, value) assert !@observation.nil?, 'Expected valid Observation resource to be present' patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb index cf5235674..d0c2471e7 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb @@ -59,9 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '72166-2' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -139,7 +137,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Observation search by patient+category+status' do + test 'Server returns expected results from Observation search by patient+code+date' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -153,9 +151,9 @@ def validate_resource_item(resource, property, value) assert !@observation.nil?, 'Expected valid Observation resource to be present' patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -163,7 +161,7 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Server returns expected results from Observation search by patient+code+date' do + test 'Server returns expected results from Observation search by patient+category+status' do metadata do id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -177,9 +175,9 @@ def validate_resource_item(resource, property, value) assert !@observation.nil?, 'Expected valid Observation resource to be present' patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/resources/uscore_v3.0.1/CapabilityStatement-us-core-server.json b/resources/uscore_v3.0.1/CapabilityStatement-us-core-server.json index 57d4e99e9..296b5369e 100644 --- a/resources/uscore_v3.0.1/CapabilityStatement-us-core-server.json +++ b/resources/uscore_v3.0.1/CapabilityStatement-us-core-server.json @@ -1 +1 @@ -{"resourceType":"CapabilityStatement","id":"us-core-server","text":{"status":"generated","div":"

    US Core Server CapabilityStatement

    • FHIR Version: 4.0.0
    • Supported formats: xml, json
    • Published: 2019-09-12
    • Published by: HL7 International - US Realm Steering Committee

    This Section describes the expected capabilities of the US Core Server actor which is responsible for providing responses to the queries submitted by the US Core Requestors. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined. Systems implementing this capability statement should meet the ONC 2015 Common Clinical Data Set (CCDS) access requirement for Patient Selection 170.315(g)(7) and Application Access - Data Category Request 170.315(g)(8) and and the latest proposed ONC [U.S. Core Data for Interoperability (USCDI)]. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.

    FHIR RESTful Capabilities

    The US Core Server SHALL:

    1. Support the US Core Patient resource profile.
    2. Support at least one additional resource profile from the list of US Core Profiles.
    3. Implement the RESTful behavior according to the FHIR specification.
    4. Return the following response classes:\n
      • (Status 400): invalid parameter
      • (Status 401/4xx): unauthorized request
      • (Status 403): insufficient scope
      • (Status 404): unknown resource
      • (Status 410): deleted resource.
      \n
    5. Support json source formats for all US Core interactions.

    The US Core Server SHOULD:

    1. Support xml source formats for all US Core interactions.
    2. Identify the US Core profiles supported as part of the FHIR meta.profile attribute for each instance.
    3. Support xml resource formats for all Argonaut questionnaire interactions.

    Security:

    1. See the General Security Considerations section for requirements and recommendations.
    2. A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code.

    Summary of System Wide Interactions

  • MAY support the\ttransaction interaction.
  • MAY support the\tbatch interaction.
  • MAY support the\tsearch-system interaction.
  • MAY support the\thistory-system interaction.
  • RESTful Capabilities by Resource/Profile:

    Summary of Search Criteria

    Resource TypeSupported ProfilesSupported SearchesSupported _includesSupported _revincludesSupported Operations
    AllergyIntoleranceUS Core AllergyIntolerance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+clinical-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CarePlanUS Core CarePlan Profile\n\t\t\t\t\t\t\t, patient+category+status, patient+category+date, patient+category, patient+category+status+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CareTeamUS Core CareTeam Profile\n\t\t\t\t\t\t\t, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ConditionUS Core Condition Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+clinical-status, patient+onset-date, patient+code, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DeviceUS Core Implantable Device Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DiagnosticReportUS Core DiagnosticReport Profile for Report and Note exchange, \n\n\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+code+date, patient+code, patient+status, patient+category+date, patient+category, patient+category, patient+category+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DocumentReferenceUS Core DocumentReference Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tpatient, patient+status, patient+category+date, patient+category, patient+type+period, patient+type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$docref\n\t\t\t\t\t\t
    EncounterUS Core Encounter Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tpatient, patient+status, patient+type, class+patient, date+patient\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    GoalUS Core Goal Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+target-date, patient+lifecycle-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ImmunizationUS Core Immunization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+status, patient+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    LocationUS Core Location Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress, \n\t\t\t\t\t\t\taddress-city, \n\t\t\t\t\t\t\taddress-state, \n\t\t\t\t\t\t\taddress-postalcode\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationUS Core Medication Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationRequestUS Core MedicationRequest Profile\n\t\t\t\t\t\t\t, patient+intent, patient+intent+encounter, patient+intent+status, patient+intent+authoredon\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tMedicationRequest:medication\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ObservationUS Core Smoking Status Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\n\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\n\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\t\t\t, patient+category+status, patient+code+date, patient+code, patient+category+date, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    OrganizationUS Core Organization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PatientUS Core Patient Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tname, birthdate+name, gender+name, family+gender, birthdate+family\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerUS Core Practitioner Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerRoleUS Core PractitionerRole Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tspecialty, \n\t\t\t\t\t\t\tpractitioner\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tPractitionerRole:endpoint, PractitionerRole:practitioner\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProcedureUS Core Procedure Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+code+date, patient+status, patient+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProvenanceUS Core Provenance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ValueSet\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$expand\n\t\t\t\t\t\t

    AllergyIntolerance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core AllergyIntolerance Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a AllergyIntolerance resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/AllergyIntolerance/[id]\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?clinical-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]&clinical-status=[system]|[code]

    CarePlan

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CarePlan Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a CarePlan resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/CarePlan/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/CarePlan?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?category=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/CarePlan?date=[date]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]
    SHOULDpatient+category+status+date\n\t\t\t\t\t\treference+token+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]&date=[date]

    CareTeam

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CareTeam Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a CareTeam resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/CareTeam/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/CareTeam?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CareTeam?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]&status=[status]

    Condition

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Condition Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Condition resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Condition/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Condition?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?category=[system]|[code]
    MAYclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?clinical-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]
    MAYonset-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Condition?onset-date=[onset-date]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&clinical-status=[system]|[code]
    SHOULDpatient+onset-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&onset-date=[onset-date]
    SHOULDpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&code=[system]|[code]
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&category=[system]|[code]

    Device

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Implantable Device Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Device resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Device/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Device?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Device?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]&type=[system]|[code]

    DiagnosticReport

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Report and Note exchange, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.
    create

    This conformance expectation applies only to the US Core DiagnosticReport Profile for Report and Note exchange profile. The conformance expectation for the US Core DiagnosticReport Profile for Laboratory Results Reporting is MAY.

    \n
    search-type

    The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations.

    \n

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a DiagnosticReport resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/DiagnosticReport/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/DiagnosticReport?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?category=[system]|[code]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?code=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DiagnosticReport?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]&date=[date]
    SHALLpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&status=[status]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]&date=[date]

    DocumentReference

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DocumentReference Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The DocumentReference.type binding SHALL support at a minimum the 5 Common Clinical Notes and may extend to the full US Core DocumentReference Type Value Set

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Operation Summary:

    • SHALL support the \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$docref operation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

      A server SHALL be capable of responding to a $docref operation and capable of returning at least a reference to a generated CCD document, if available. MAY provide references to other 'on-demand' and 'stable' documents (or 'delayed/deferred assembly') that meet the query parameters as well. If a context date range is supplied the server ** SHOULD** provide references to any document that falls within the date range If no date range is supplied, then the server SHALL provide references to last or current encounter. SHOULD document what resources, if any, are returned as included resources

      GET [base]/DocumentReference/$docref?patient=[id]

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a DocumentReference resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/DocumentReference/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/DocumentReference?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?_id=[id]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?category=[system]|[code]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?type=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?date=[date]
    MAYperiod\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?period=[period]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&status=[status]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]
    SHOULDpatient+type+period\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]&period=[period]
    SHALLpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]

    Encounter

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Encounter Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Encounter resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Encounter/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Encounter?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?_id=[id]
    MAYclass\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]
    SHOULDidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?identifier=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?status=[status]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&status=[status]
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&type=[system]|[code]
    SHOULDclass+patient\n\t\t\t\t\t\ttoken+reference\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]&patient=[patient]
    SHALLdate+patient\n\t\t\t\t\t\tdate+reference\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]&patient=[patient]

    Goal

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Goal Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Goal resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Goal/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Goal?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYlifecycle-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Goal?lifecycle-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]
    MAYtarget-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Goal?target-date=[target-date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+target-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&target-date=[target-date]
    SHOULDpatient+lifecycle-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&lifecycle-status=[system]|[code]

    Immunization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Immunization Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Immunization resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Immunization/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Immunization?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Immunization?status=[status]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Immunization?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&status=[status]
    SHOULDpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&date=[date]

    Location

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Location Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Location resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Location/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Location?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?name=[name]
    SHALLaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address=[address]
    SHOULDaddress-city\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-city=[address-city]
    SHOULDaddress-state\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-state=[address-state]
    SHOULDaddress-postalcode\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-postalcode=[address-postalcode]

    Medication

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Medication Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria SHALL be supported.

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Medication resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Medication/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Medication?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t


    MedicationRequest

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core MedicationRequest Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be contained or an external resource. The server application MAY choose any one way or more than one method, but if an external reference to Medication is used, the server SHALL support the _include` parameter for searching this element. The client application must support all methods.

    For example, A server SHALL be capable of returning all medications for a patient using one of or both:

    GET /MedicationRequest?patient=[id]

    GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a MedicationRequest resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/MedicationRequest/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _includes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tMedicationRequest:medication - GET [base]/MedicationRequest?[parameter=value]&_include=MedicationRequest:medication\n\t\t\t\t\t\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/MedicationRequest?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?status=[status]
    MAYintent\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?intent=[system]|[code]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]
    MAYencounter\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?encounter=[encounter]
    MAYauthoredon\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/MedicationRequest?authoredon=[authoredon]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+intent\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]
    SHOULDpatient+intent+encounter\n\t\t\t\t\t\treference+token+reference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&encounter=[encounter]
    SHALLpatient+intent+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&status=[status]
    SHOULDpatient+intent+authoredon\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&authoredon=[authoredon]

    Observation

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Smoking Status Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.
    search-type

    The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations.

    \n

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Observation resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Observation/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Observation?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?status=[status]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?category=[system]|[code]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?code=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Observation?date=[date]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&status=[status]
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]&date=[date]
    SHALLpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]

    Organization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Organization Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Organization resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Organization/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Organization?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?name=[name]
    SHALLaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?address=[address]

    Patient

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Patient Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Patient resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Patient/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Patient?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?_id=[id]
    MAYbirthdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]
    MAYfamily\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?family=[family]
    MAYgender\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]
    MAYgiven\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?given=[given]
    SHALLidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?identifier=[system]|[code]
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?name=[name]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLbirthdate+name\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&name=[name]
    SHALLgender+name\n\t\t\t\t\t\ttoken+string\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]&name=[name]
    SHOULDfamily+gender\n\t\t\t\t\t\tstring+token\n\t\t\t\t\t\tGET [base]/Patient?family=[family]&gender=[system]|[code]
    SHOULDbirthdate+family\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&family=[family]

    Practitioner

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Practitioner Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Practitioner resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Practitioner/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Practitioner?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Practitioner?name=[name]
    SHALLidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Practitioner?identifier=[system]|[code]

    PractitionerRole

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core PractitionerRole Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a PractitionerRole resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/PractitionerRole/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _includes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tPractitionerRole:endpoint - GET [base]/PractitionerRole?[parameter=value]&_include=PractitionerRole:endpoint\n\t\t\t\t\t\n\t\t\t\t\t\tPractitionerRole:practitioner - GET [base]/PractitionerRole?[parameter=value]&_include=PractitionerRole:practitioner\n\t\t\t\t\t\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/PractitionerRole?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLspecialty\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/PractitionerRole?specialty=[system]|[code]
    SHALLpractitioner\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/PractitionerRole?practitioner=[practitioner]

    Procedure

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Procedure Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Procedure resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Procedure/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Procedure?[parameter=value]&_revinclude=Provenance:target\n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Procedure?date=[date]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&code=[system]|[code]&date=[date]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&status=[status]
    SHALLpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&date=[date]

    Provenance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Provenance Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    If a system receives a provider in Provenance.agent.who as free text they must capture who sent them the information as the organization. On request they SHALL provide this organization as the source and MAY include the free text provider.

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Provenance resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Provenance/[id]\n\t\t\t\t


    ValueSet

    Operation Summary:

    • SHOULD support the \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$expand operation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

      A client can determine the note and report types support by a server by invoking the standard FHIR Value Set Expansion ($expand) operation defined in the FHIR R4 specification. Because servers may support different read and write formats, it also is used to determine the formats (for example, text, pdf) the server supports read and write transactions.



    "},"url":"http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server","version":"3.0.1","name":"UsCoreServerCapabilityStatement","title":"US Core Server CapabilityStatement","status":"active","experimental":false,"date":"2019-09-12T00:00:00+00:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"This Section describes the expected capabilities of the US Core Server actor which is responsible for providing responses to the queries submitted by the US Core Requestors. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined. Systems implementing this capability statement should meet the ONC 2015 Common Clinical Data Set (CCDS) access requirement for Patient Selection 170.315(g)(7) and Application Access - Data Category Request 170.315(g)(8) and and the latest proposed ONC [U.S. Core Data for Interoperability (USCDI)]. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"kind":"requirements","fhirVersion":"4.0.0","format":["xml","json"],"patchFormat":["application/json-patch+json"],"implementationGuide":["http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core-3.0.1"],"rest":[{"mode":"server","documentation":"The US Core Server **SHALL**:\n\n1. Support the US Core Patient resource profile.\n1. Support at least one additional resource profile from the list of US Core Profiles.\n1. Implement the RESTful behavior according to the FHIR specification.\n1. Return the following response classes:\n - (Status 400): invalid parameter\n - (Status 401/4xx): unauthorized request\n - (Status 403): insufficient scope\n - (Status 404): unknown resource\n - (Status 410): deleted resource.\n1. Support json source formats for all US Core interactions.\n\nThe US Core Server **SHOULD**:\n\n1. Support xml source formats for all US Core interactions.\n1. Identify the US Core profiles supported as part of the FHIR `meta.profile` attribute for each instance.\n1. Support xml resource formats for all Argonaut questionnaire interactions.","security":{"description":"1. See the [General Security Considerations](security.html) section for requirements and recommendations.\n1. A server **SHALL** reject any unauthorized requests by returning an `HTTP 401` unauthorized response code."},"resource":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"AllergyIntolerance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CarePlan","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CareTeam","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"onset-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Condition","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"onset-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-onset-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Device","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DiagnosticReport","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note","http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create","documentation":"This conformance expectation applies **only** to the *US Core DiagnosticReport Profile for Report and Note exchange* profile. The conformance expectation for the *US Core DiagnosticReport Profile for Laboratory Results Reporting* is **MAY**."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type","documentation":"The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"},{"url":"required","valueString":"period"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DocumentReference","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference"],"documentation":"The DocumentReference.type binding SHALL support at a minimum the [5 Common Clinical Notes](ValueSet-us-core-clinical-note-type.html) and may extend to the full US Core DocumentReference Type Value Set","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-type","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"period","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-period","type":"date"}],"operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"docref","definition":"http://hl7.org/fhir/us/core/OperationDefinition/docref","documentation":"A server **SHALL** be capable of responding to a $docref operation and capable of returning at least a reference to a generated CCD document, if available. **MAY** provide references to other 'on-demand' and 'stable' documents (or 'delayed/deferred assembly') that meet the query parameters as well. If a context date range is supplied the server ** SHOULD** provide references to any document that falls within the date range If no date range is supplied, then the server **SHALL** provide references to last or current encounter. **SHOULD** document what resources, if any, are returned as included resources\n\n`GET [base]/DocumentReference/$docref?patient=[id]`"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"class"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"date"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Encounter","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"class","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-class","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"target-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"lifecycle-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Goal","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"lifecycle-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-lifecycle-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"target-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-target-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Immunization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Location","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-location"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-city","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-city","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-state","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-state","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-postalcode","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-postalcode","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Medication","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication"],"documentation":"The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria **SHALL** be supported.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"encounter"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"authoredon"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"MedicationRequest","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest"],"documentation":"The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be [contained](http://hl7.org/fhir/R4/references.html#contained) or an external resource. The server application **MAY** choose any one way or more than one method, but if an external reference to Medication is used, the server **SHALL** support the _include` parameter for searching this element. The client application must support all methods.\n\n For example, A server **SHALL** be capable of returning all medications for a patient using one of or both:\n\n `GET /MedicationRequest?patient=[id]`\n\n `GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication`","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchInclude":["MedicationRequest:medication"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"intent","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-intent","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"encounter","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-encounter","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"authoredon","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-authoredon","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Observation","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height","http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age","http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type","documentation":"The conformance expectations for Composite Searches differ by profile. See the Quick Start section for profile specific expectations."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Organization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"gender"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"family"},{"url":"required","valueString":"gender"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"family"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Patient","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"birthdate","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-birthdate","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"family","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-family","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"gender","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-gender","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"given","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-given","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-name","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Practitioner","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-identifier","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"PractitionerRole","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchInclude":["PractitionerRole:endpoint","PractitionerRole:practitioner"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"specialty","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"practitioner","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Procedure","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Provenance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance"],"documentation":"If a system receives a provider in `Provenance.agent.who` as free text they must capture who sent them the information as the organization. On request they **SHALL** provide this organization as the source and **MAY** include the free text provider.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"ValueSet","operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"expand","definition":"http://hl7.org/fhir/OperationDefinition/ValueSet-expand","documentation":"A client can determine the note and report types support by a server by invoking the standard FHIR Value Set Expansion ($expand) operation defined in the FHIR R4 specification. Because servers may support different read and write formats, it also is used to determine the formats (for example, text, pdf) the server supports read and write transactions."}]}],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"transaction"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"batch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"search-system"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-system"}]}]} \ No newline at end of file +{"resourceType":"CapabilityStatement","id":"us-core-server","text":{"status":"generated","div":"

    US Core Server CapabilityStatement

    • Implementation Guide Version: 3.1.0
    • FHIR Version: 4.0.0
    • Supported formats: xml, json
    • Published: 2019-10-04
    • Published by: HL7 International - US Realm Steering Committee

    This Section describes the expected capabilities of the US Core Server actor which is responsible for providing responses to the queries submitted by the US Core Requestors. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined. Systems implementing this capability statement should meet the ONC 2015 Common Clinical Data Set (CCDS) access requirement for Patient Selection 170.315(g)(7) and Application Access - Data Category Request 170.315(g)(8) and and the latest proposed ONC [U.S. Core Data for Interoperability (USCDI)]. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.

    FHIR RESTful Capabilities

    The US Core Server SHALL:

    1. Support the US Core Patient resource profile.
    2. Support at least one additional resource profile from the list of US Core Profiles.
    3. Implement the RESTful behavior according to the FHIR specification.
    4. Return the following response classes:\n
      • (Status 400): invalid parameter
      • (Status 401/4xx): unauthorized request
      • (Status 403): insufficient scope
      • (Status 404): unknown resource
      • (Status 410): deleted resource.
      \n
    5. Support json source formats for all US Core interactions.

    The US Core Server SHOULD:

    1. Support xml source formats for all US Core interactions.
    2. Identify the US Core profiles supported as part of the FHIR meta.profile attribute for each instance.
    3. Support xml resource formats for all Argonaut questionnaire interactions.

    Security:

    1. See the General Security Considerations section for requirements and recommendations.
    2. A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code.

    Summary of System Wide Interactions

  • MAY support the\ttransaction interaction.
  • MAY support the\tbatch interaction.
  • MAY support the\tsearch-system interaction.
  • MAY support the\thistory-system interaction.
  • RESTful Capabilities by Resource/Profile:

    Summary of Search Criteria

    Resource TypeSupported ProfilesSupported SearchesSupported _includesSupported _revincludesSupported Operations
    AllergyIntoleranceUS Core AllergyIntolerance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+clinical-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CarePlanUS Core CarePlan Profile\n\t\t\t\t\t\t\t, patient+category+date, patient+category+status+date, patient+category+status, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CareTeamUS Core CareTeam Profile\n\t\t\t\t\t\t\t, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ConditionUS Core Condition Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+category, patient+onset-date, patient+clinical-status, patient+code\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DeviceUS Core Implantable Device Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DiagnosticReportUS Core DiagnosticReport Profile for Report and Note exchange, \n\n\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+status, patient+code+date, patient+code, patient+category+date, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DocumentReferenceUS Core DocumentReference Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tpatient, patient+type, patient+type+period, patient+status, patient+category+date, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$docref\n\t\t\t\t\t\t
    EncounterUS Core Encounter Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tpatient, patient+status, class+patient, patient+type, date+patient\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    GoalUS Core Goal Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+target-date, patient+lifecycle-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ImmunizationUS Core Immunization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+date, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    LocationUS Core Location Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress, \n\t\t\t\t\t\t\taddress-city, \n\t\t\t\t\t\t\taddress-state, \n\t\t\t\t\t\t\taddress-postalcode\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationUS Core Medication Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationRequestUS Core MedicationRequest Profile\n\t\t\t\t\t\t\t, patient+intent+status, patient+intent+encounter, patient+intent+authoredon, patient+intent\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tMedicationRequest:medication\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ObservationUS Core Smoking Status Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\n\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\n\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\t\t\t, patient+code+date, patient+category+status, patient+code, patient+category+date, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    OrganizationUS Core Organization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PatientUS Core Patient Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tname, gender+name, birthdate+family, birthdate+name, family+gender\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerUS Core Practitioner Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerRoleUS Core PractitionerRole Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tspecialty, \n\t\t\t\t\t\t\tpractitioner\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tPractitionerRole:endpoint, PractitionerRole:practitioner\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProcedureUS Core Procedure Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+code+date, patient+status, patient+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProvenanceUS Core Provenance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ValueSet\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$expand\n\t\t\t\t\t\t

    AllergyIntolerance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core AllergyIntolerance Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a AllergyIntolerance resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/AllergyIntolerance/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/AllergyIntolerance?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?clinical-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]&clinical-status=[system]|[code]

    CarePlan

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CarePlan Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a CarePlan resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/CarePlan/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/CarePlan?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?category=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/CarePlan?date=[date]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&date=[date]
    SHOULDpatient+category+status+date\n\t\t\t\t\t\treference+token+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]&date=[date]
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]

    CareTeam

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CareTeam Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a CareTeam resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/CareTeam/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/CareTeam?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CareTeam?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]&status=[status]

    Condition

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Condition Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Condition resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Condition/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Condition?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?category=[system]|[code]
    MAYclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?clinical-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]
    MAYonset-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Condition?onset-date=[onset-date]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&category=[system]|[code]
    SHOULDpatient+onset-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&onset-date=[onset-date]
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&clinical-status=[system]|[code]
    SHOULDpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&code=[system]|[code]

    Device

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Implantable Device Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Device resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Device/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Device?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Device?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]&type=[system]|[code]

    DiagnosticReport

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Report and Note exchange, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.
    create

    This conformance expectation applies only to the US Core DiagnosticReport Profile for Report and Note exchange profile. The conformance expectation for the US Core DiagnosticReport Profile for Laboratory Results Reporting is MAY.

    \n

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a DiagnosticReport resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/DiagnosticReport/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/DiagnosticReport?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?category=[system]|[code]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?code=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DiagnosticReport?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&status=[status]
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]&date=[date]
    SHALLpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]

    DocumentReference

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DocumentReference Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The DocumentReference.type binding SHALL support at a minimum the 5 Common Clinical Notes and may extend to the full US Core DocumentReference Type Value Set

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Operation Summary:

    • SHALL support the \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$docref operation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

      A server SHALL be capable of responding to a $docref operation and capable of returning at least a reference to a generated CCD document, if available. MAY provide references to other 'on-demand' and 'stable' documents (or 'delayed/deferred assembly') that meet the query parameters as well. If a context date range is supplied the server ** SHOULD** provide references to any document that falls within the date range If no date range is supplied, then the server SHALL provide references to last or current encounter. SHOULD document what resources, if any, are returned as included resources

      GET [base]/DocumentReference/$docref?patient=[id]

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a DocumentReference resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/DocumentReference/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/DocumentReference?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?_id=[id]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?category=[system]|[code]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?type=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?date=[date]
    MAYperiod\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?period=[period]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]
    SHOULDpatient+type+period\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]&period=[period]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&status=[status]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]

    Encounter

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Encounter Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Encounter resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Encounter/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Encounter?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?_id=[id]
    MAYclass\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]
    SHOULDidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?identifier=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?status=[status]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&status=[status]
    SHOULDclass+patient\n\t\t\t\t\t\ttoken+reference\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]&patient=[patient]
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&type=[system]|[code]
    SHALLdate+patient\n\t\t\t\t\t\tdate+reference\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]&patient=[patient]

    Goal

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Goal Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Goal resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Goal/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Goal?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYlifecycle-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Goal?lifecycle-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]
    MAYtarget-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Goal?target-date=[target-date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+target-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&target-date=[target-date]
    SHOULDpatient+lifecycle-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&lifecycle-status=[system]|[code]

    Immunization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Immunization Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Immunization resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Immunization/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Immunization?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Immunization?status=[status]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Immunization?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&date=[date]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&status=[status]

    Location

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Location Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Location resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Location/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Location?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?name=[name]
    SHALLaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address=[address]
    SHOULDaddress-city\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-city=[address-city]
    SHOULDaddress-state\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-state=[address-state]
    SHOULDaddress-postalcode\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-postalcode=[address-postalcode]

    Medication

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Medication Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria SHALL be supported.

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Medication resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Medication/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Medication?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t


    MedicationRequest

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core MedicationRequest Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be contained or an external resource. The server application MAY choose any one way or more than one method, but if an external reference to Medication is used, the server SHALL support the _include` parameter for searching this element. The client application must support all methods.

    For example, A server SHALL be capable of returning all medications for a patient using one of or both:

    GET /MedicationRequest?patient=[id]

    GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a MedicationRequest resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/MedicationRequest/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _includes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tMedicationRequest:medication - GET [base]/MedicationRequest?[parameter=value]&_include=MedicationRequest:medication
      \n\t\t\t\t\t\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/MedicationRequest?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?status=[status]
    MAYintent\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?intent=[system]|[code]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]
    MAYencounter\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?encounter=[encounter]
    MAYauthoredon\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/MedicationRequest?authoredon=[authoredon]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+intent+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&status=[status]
    SHOULDpatient+intent+encounter\n\t\t\t\t\t\treference+token+reference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&encounter=[encounter]
    SHOULDpatient+intent+authoredon\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&authoredon=[authoredon]
    SHALLpatient+intent\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]

    Observation

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Smoking Status Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Observation resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Observation/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Observation?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?status=[status]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?category=[system]|[code]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?code=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Observation?date=[date]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]&date=[date]
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&status=[status]
    SHALLpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]

    Organization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Organization Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Organization resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Organization/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Organization?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?name=[name]
    SHALLaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?address=[address]

    Patient

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Patient Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Patient resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Patient/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Patient?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?_id=[id]
    MAYbirthdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]
    MAYfamily\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?family=[family]
    MAYgender\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]
    MAYgiven\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?given=[given]
    SHALLidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?identifier=[system]|[code]
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?name=[name]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLgender+name\n\t\t\t\t\t\ttoken+string\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]&name=[name]
    SHOULDbirthdate+family\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&family=[family]
    SHALLbirthdate+name\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&name=[name]
    SHOULDfamily+gender\n\t\t\t\t\t\tstring+token\n\t\t\t\t\t\tGET [base]/Patient?family=[family]&gender=[system]|[code]

    Practitioner

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Practitioner Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Practitioner resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Practitioner/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Practitioner?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Practitioner?name=[name]
    SHALLidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Practitioner?identifier=[system]|[code]

    PractitionerRole

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core PractitionerRole Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a PractitionerRole resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/PractitionerRole/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _includes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tPractitionerRole:endpoint - GET [base]/PractitionerRole?[parameter=value]&_include=PractitionerRole:endpoint
      \n\t\t\t\t\t\n\t\t\t\t\t\tPractitionerRole:practitioner - GET [base]/PractitionerRole?[parameter=value]&_include=PractitionerRole:practitioner
      \n\t\t\t\t\t\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/PractitionerRole?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLspecialty\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/PractitionerRole?specialty=[system]|[code]
    SHALLpractitioner\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/PractitionerRole?practitioner=[practitioner]

    Procedure

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Procedure Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Procedure resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Procedure/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Procedure?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Procedure?date=[date]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&code=[system]|[code]&date=[date]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&status=[status]
    SHALLpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&date=[date]

    Provenance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Provenance Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    If a system receives a provider in Provenance.agent.who as free text they must capture who sent them the information as the organization. On request they SHALL provide this organization as the source and MAY include the free text provider.

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Provenance resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Provenance/[id]\n\t\t\t\t


    ValueSet

    Operation Summary:

    • SHOULD support the \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$expand operation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

      A client can determine the note and report types support by a server by invoking the standard FHIR Value Set Expansion ($expand) operation defined in the FHIR R4 specification. Because servers may support different read and write formats, it also is used to determine the formats (for example, text, pdf) the server supports read and write transactions.



    "},"url":"http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server","version":"3.1.0","name":"UsCoreServerCapabilityStatement","title":"US Core Server CapabilityStatement","status":"active","experimental":false,"date":"2019-10-04T00:00:00+00:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"This Section describes the expected capabilities of the US Core Server actor which is responsible for providing responses to the queries submitted by the US Core Requestors. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined. Systems implementing this capability statement should meet the ONC 2015 Common Clinical Data Set (CCDS) access requirement for Patient Selection 170.315(g)(7) and Application Access - Data Category Request 170.315(g)(8) and and the latest proposed ONC [U.S. Core Data for Interoperability (USCDI)]. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"kind":"requirements","fhirVersion":"4.0.0","format":["xml","json"],"patchFormat":["application/json-patch+json"],"implementationGuide":["http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core-3.1.0"],"rest":[{"mode":"server","documentation":"The US Core Server **SHALL**:\n\n1. Support the US Core Patient resource profile.\n1. Support at least one additional resource profile from the list of US Core Profiles.\n1. Implement the RESTful behavior according to the FHIR specification.\n1. Return the following response classes:\n - (Status 400): invalid parameter\n - (Status 401/4xx): unauthorized request\n - (Status 403): insufficient scope\n - (Status 404): unknown resource\n - (Status 410): deleted resource.\n1. Support json source formats for all US Core interactions.\n\nThe US Core Server **SHOULD**:\n\n1. Support xml source formats for all US Core interactions.\n1. Identify the US Core profiles supported as part of the FHIR `meta.profile` attribute for each instance.\n1. Support xml resource formats for all Argonaut questionnaire interactions.","security":{"description":"1. See the [General Security Considerations](security.html) section for requirements and recommendations.\n1. A server **SHALL** reject any unauthorized requests by returning an `HTTP 401` unauthorized response code."},"resource":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"AllergyIntolerance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CarePlan","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CareTeam","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"onset-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Condition","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"onset-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-onset-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Device","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DiagnosticReport","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note","http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create","documentation":"This conformance expectation applies **only** to the *US Core DiagnosticReport Profile for Report and Note exchange* profile. The conformance expectation for the *US Core DiagnosticReport Profile for Laboratory Results Reporting* is **MAY**."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"},{"url":"required","valueString":"period"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DocumentReference","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference"],"documentation":"The DocumentReference.type binding SHALL support at a minimum the [5 Common Clinical Notes](ValueSet-us-core-clinical-note-type.html) and may extend to the full US Core DocumentReference Type Value Set","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-type","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"period","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-period","type":"date"}],"operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"docref","definition":"http://hl7.org/fhir/us/core/OperationDefinition/docref","documentation":"A server **SHALL** be capable of responding to a $docref operation and capable of returning at least a reference to a generated CCD document, if available. **MAY** provide references to other 'on-demand' and 'stable' documents (or 'delayed/deferred assembly') that meet the query parameters as well. If a context date range is supplied the server ** SHOULD** provide references to any document that falls within the date range If no date range is supplied, then the server **SHALL** provide references to last or current encounter. **SHOULD** document what resources, if any, are returned as included resources\n\n`GET [base]/DocumentReference/$docref?patient=[id]`"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"class"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"date"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Encounter","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"class","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-class","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"target-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"lifecycle-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Goal","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"lifecycle-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-lifecycle-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"target-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-target-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Immunization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Location","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-location"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-city","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-city","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-state","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-state","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-postalcode","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-postalcode","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Medication","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication"],"documentation":"The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria **SHALL** be supported.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"encounter"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"authoredon"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"MedicationRequest","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest"],"documentation":"The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be [contained](http://hl7.org/fhir/R4/references.html#contained) or an external resource. The server application **MAY** choose any one way or more than one method, but if an external reference to Medication is used, the server **SHALL** support the _include` parameter for searching this element. The client application must support all methods.\n\n For example, A server **SHALL** be capable of returning all medications for a patient using one of or both:\n\n `GET /MedicationRequest?patient=[id]`\n\n `GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication`","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchInclude":["MedicationRequest:medication"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"intent","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-intent","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"encounter","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-encounter","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"authoredon","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-authoredon","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Observation","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height","http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age","http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Organization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"gender"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"family"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"family"},{"url":"required","valueString":"gender"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Patient","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"birthdate","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-birthdate","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"family","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-family","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"gender","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-gender","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"given","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-given","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-name","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Practitioner","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-identifier","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"PractitionerRole","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchInclude":["PractitionerRole:endpoint","PractitionerRole:practitioner"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"specialty","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"practitioner","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Procedure","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Provenance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance"],"documentation":"If a system receives a provider in `Provenance.agent.who` as free text they must capture who sent them the information as the organization. On request they **SHALL** provide this organization as the source and **MAY** include the free text provider.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"ValueSet","operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"expand","definition":"http://hl7.org/fhir/OperationDefinition/ValueSet-expand","documentation":"A client can determine the note and report types support by a server by invoking the standard FHIR Value Set Expansion ($expand) operation defined in the FHIR R4 specification. Because servers may support different read and write formats, it also is used to determine the formats (for example, text, pdf) the server supports read and write transactions."}]}],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"transaction"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"batch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"search-system"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-system"}]}]} \ No newline at end of file From 8aa4045b271a916b8164951e569a79d4d79b55e3 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Fri, 1 Nov 2019 10:39:15 -0400 Subject: [PATCH 035/173] Fix for PR comments --- .../bulk_data/bulk_data_discovery_sequence.rb | 62 +++---------------- .../bulk_data/bulk_data_export_sequence.rb | 4 +- 2 files changed, 12 insertions(+), 54 deletions(-) diff --git a/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb b/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb index 1b27f8eaa..ff37b87ac 100644 --- a/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb +++ b/lib/app/modules/bulk_data/bulk_data_discovery_sequence.rb @@ -5,10 +5,10 @@ module Sequence class BulkDataDiscoverySequence < SequenceBase title 'Bulk Data Discovery' - test_id_prefix 'Discovery' + test_id_prefix 'BDD' requires :url - defines :oauth_authorize_endpoint, :oauth_token_endpoint, :oauth_register_endpoint + defines :oauth_token_endpoint, :oauth_register_endpoint description "Retrieve server's SMART on FHIR configuration" @@ -29,16 +29,10 @@ class BulkDataDiscoverySequence < SequenceBase SMART_OAUTH_EXTENSION_URL = 'http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris' - REQUIRED_OAUTH_ENDPOINTS = [ - { url: 'token', description: 'token' } - ].freeze - attr_accessor :well_known_configuration, :conformance def oauth2_metadata_from_conformance - options = { - token_url: nil - } + options = {} begin @conformance.rest.each do |rest| options.merge! @client.get_oauth2_metadata_from_service_definition(rest) @@ -47,8 +41,7 @@ def oauth2_metadata_from_conformance FHIR.logger.error "Failed to locate SMART-on-FHIR OAuth2 Security Extensions: #{e.message}" end - options.delete_if { |_k, v| v.nil? } - options + options.compact end test :read_well_known_endpoint do @@ -69,16 +62,9 @@ def oauth2_metadata_from_conformance assert_response_content_type(well_known_configuration_response, 'application/json') @well_known_configuration = assert_valid_json(well_known_configuration_response.body) - - @well_known_token_url = @well_known_configuration['token_endpoint'] - @well_known_register_url = @well_known_configuration['registration_endpoint'] - @well_known_token_auth_methods = @well_known_configuration['token_endpoint_auth_methods_supported'] - @well_known_token_auth_signings = @well_known_configuration['token_endpoint_auth_signing_alg_values_supported'] - @well_known_scopes = @well_known_configuration['scopes_supported'] - @instance.update( - oauth_token_endpoint: @well_known_token_url, - oauth_register_endpoint: @well_known_register_url + oauth_token_endpoint: @well_known_configuration['token_endpoint'], + oauth_register_endpoint: @well_known_configuration['registration_endpoint'] ) end @@ -117,13 +103,10 @@ def oauth2_metadata_from_conformance assert oauth_metadata.present?, 'No OAuth Metadata in Conformance/CapabiliytStatemeent resource' - REQUIRED_OAUTH_ENDPOINTS.each do |endpoint| - url = oauth_metadata[:"#{endpoint[:url]}_url"] - instance_variable_set(:"@conformance_#{endpoint[:url]}_url", url) + conformance_token_url = oauth_metadata[:token_url] - assert url.present?, "No #{endpoint[:description]} URI provided in Conformance/CapabilityStatement resource" - assert_valid_http_uri url, "Invalid #{endpoint[:description]} url: '#{url}'" - end + assert conformance_token_url.present?, 'No token URI provided in Conformance/CapabilityStatement resource' + assert_valid_http_uri conformance_token_url, "Invalid token url: '#{conformance_token_url}'" warning do services = [] @@ -140,34 +123,9 @@ def oauth2_metadata_from_conformance end @instance.update( - oauth_token_endpoint: @conformance_token_url + oauth_token_endpoint: conformance_token_url ) end - - # test 'OAuth Endpoints must be the same in the conformance statement and well known endpoint' do - # metadata do - # id '05' - # link 'http://hl7.org/fhir/smart-app-launch/conformance/index.html#using-cs' - # description %( - # If a server requires SMART on FHIR authorization for access, its - # metadata must support automated discovery of OAuth2 endpoints. - # ) - # end - - # (REQUIRED_OAUTH_ENDPOINTS + OPTIONAL_OAUTH_ENDPOINTS).each do |endpoint| - # url = endpoint[:url] - # well_known_url = instance_variable_get(:"@well_known_#{url}_url") - # conformance_url = instance_variable_get(:"@conformance_#{url}_url") - - # assert well_known_url == conformance_url, %( - # The #{endpoint[:description]} url is not consistent between the - # well-known configuration and the conformance statement: - - # Well-known #{url} url: #{well_known_url} - # Conformance #{url} url: #{conformance_url} - # ) - # end - # end end end end diff --git a/lib/app/modules/bulk_data/bulk_data_export_sequence.rb b/lib/app/modules/bulk_data/bulk_data_export_sequence.rb index e900c3124..2e9a16c87 100644 --- a/lib/app/modules/bulk_data/bulk_data_export_sequence.rb +++ b/lib/app/modules/bulk_data/bulk_data_export_sequence.rb @@ -9,9 +9,9 @@ class BulkDataExportSequence < SequenceBase description 'Verify that system level export on the Bulk Data server follow the Bulk Data Access Implementation Guide' - test_id_prefix 'BD' + test_id_prefix 'BDE' - requires :token + requires :tokens attr_accessor :run_all_kick_off_tests From 6d5036828cb7c3b8292e98e9d669b6856986e27a Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Fri, 1 Nov 2019 12:39:21 -0400 Subject: [PATCH 036/173] Fix failed unit test --- test/unit/sequence_validation_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unit/sequence_validation_test.rb b/test/unit/sequence_validation_test.rb index fd7797616..c9b8a32ba 100644 --- a/test/unit/sequence_validation_test.rb +++ b/test/unit/sequence_validation_test.rb @@ -56,6 +56,7 @@ def test_ids_sequential errors = [] Inferno::Sequence::SequenceBase.subclasses.each do |sequence| + next if sequence == SequenceBaseTest::InvalidKeySequence ids = sequence.tests.map(&:metadata_hash).reduce([]) do |out, metadata| if metadata[:test_id].nil? out From d09b0c857b9a8f6200f90bc564927b94f7ca4ed2 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Fri, 1 Nov 2019 13:23:29 -0400 Subject: [PATCH 037/173] fix rubocop --- test/unit/sequence_validation_test.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/test/unit/sequence_validation_test.rb b/test/unit/sequence_validation_test.rb index c9b8a32ba..6214b67b6 100644 --- a/test/unit/sequence_validation_test.rb +++ b/test/unit/sequence_validation_test.rb @@ -57,6 +57,7 @@ def test_ids_sequential Inferno::Sequence::SequenceBase.subclasses.each do |sequence| next if sequence == SequenceBaseTest::InvalidKeySequence + ids = sequence.tests.map(&:metadata_hash).reduce([]) do |out, metadata| if metadata[:test_id].nil? out From 0ff02cf1509feb777d0a47efaf3f051e4f0aec38 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Fri, 1 Nov 2019 16:36:29 -0400 Subject: [PATCH 038/173] change to Inferno::Sequence::InvalidKeySequence --- test/unit/sequence_validation_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/sequence_validation_test.rb b/test/unit/sequence_validation_test.rb index 6214b67b6..a14e166bd 100644 --- a/test/unit/sequence_validation_test.rb +++ b/test/unit/sequence_validation_test.rb @@ -56,7 +56,7 @@ def test_ids_sequential errors = [] Inferno::Sequence::SequenceBase.subclasses.each do |sequence| - next if sequence == SequenceBaseTest::InvalidKeySequence + next if sequence == Inferno::Sequence::InvalidKeySequence ids = sequence.tests.map(&:metadata_hash).reduce([]) do |out, metadata| if metadata[:test_id].nil? From 7b1eb4416d9fe7105d57bf4abf245665cf00438e Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Fri, 1 Nov 2019 17:02:37 -0400 Subject: [PATCH 039/173] Change to SequenceBaseTest::InvalidKeySequence --- test/unit/sequence_validation_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/sequence_validation_test.rb b/test/unit/sequence_validation_test.rb index a14e166bd..6214b67b6 100644 --- a/test/unit/sequence_validation_test.rb +++ b/test/unit/sequence_validation_test.rb @@ -56,7 +56,7 @@ def test_ids_sequential errors = [] Inferno::Sequence::SequenceBase.subclasses.each do |sequence| - next if sequence == Inferno::Sequence::InvalidKeySequence + next if sequence == SequenceBaseTest::InvalidKeySequence ids = sequence.tests.map(&:metadata_hash).reduce([]) do |out, metadata| if metadata[:test_id].nil? From 6386b08de586f5a66dafa6cafa6950dcd4652a9b Mon Sep 17 00:00:00 2001 From: Chase Zhou Date: Mon, 4 Nov 2019 00:36:55 -0500 Subject: [PATCH 040/173] more cases for valuesets and fixed codes --- generator/uscore/metadata_extractor.rb | 9 +++++++ generator/uscore/uscore_generator.rb | 3 --- .../us_core_careteam_sequence.rb | 26 +++++++++++-------- .../us_core_pulse_oximetry_sequence.rb | 26 +++++++++++-------- .../us_core_smokingstatus_sequence.rb | 26 +++++++++++-------- 5 files changed, 54 insertions(+), 36 deletions(-) diff --git a/generator/uscore/metadata_extractor.rb b/generator/uscore/metadata_extractor.rb index 9edc2d302..b7923cec3 100644 --- a/generator/uscore/metadata_extractor.rb +++ b/generator/uscore/metadata_extractor.rb @@ -207,9 +207,18 @@ def add_search_param_descriptions(profile_definition, sequence) slices.each do |slice| param_metadata[:values] << slice['patternCodeableConcept']['coding'].first['code'] if slice['patternCodeableConcept'] end + elsif param_metadata[:type] == 'CodeableConcept' + fixed_code_els = profile_definition['snapshot']['element'].select { |el| el['path'] == "#{profile_element['path']}.coding.code" && el['fixedCode'].present? } + param_metadata[:values] += fixed_code_els.map { |el| el['fixedCode'] } if fixed_code_els.any? end param_metadata[:values] << profile_element['patternCodeableConcept']['coding'].first['code'] if profile_element['patternCodeableConcept'] fhir_metadata = FHIR.const_get(sequence[:resource])::METADATA[param.to_s] + valueset_binding = profile_element['binding'] + if valueset_binding + value_set = resources_by_type['ValueSet'].find { |res| res['url'] == valueset_binding['valueSet'] } + codes = value_set['compose']['include'].reject { |code| code['concept'].nil? } if value_set.present? + param_metadata[:values] += codes.map { |code| code['concept'].first['code'] } if codes.present? + end param_metadata[:values] = fhir_metadata['valid_codes'].values.flatten unless param_metadata[:values].any? || fhir_metadata.nil? || fhir_metadata['valid_codes'].nil? else # search is a variable type eg.) Condition.onsetDateTime - element in profile def is Condition.onset[x] diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 76a3be002..115ba56c1 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -415,10 +415,7 @@ def get_comparator_searches(search_params, sequence) end def search_param_constants(search_parameters, sequence) - return "patient: @instance.patient_id, status: 'active'" if search_parameters == ['patient', 'status'] && sequence[:resource] == 'CareTeam' - return "patient: @instance.patient_id, code: '72166-2'" if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:smoking_status] return "'_id': @instance.patient_id" if search_parameters == ['_id'] && sequence[:resource] == 'Patient' - return "patient: @instance.patient_id, code: '59408-5'" if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:pulse_oximetry] end def create_search_validation(sequence) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb index faa8bd018..018355f15 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb @@ -60,19 +60,23 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, status: 'active' } - - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - + status_val = ['proposed', 'active', 'suspended', 'inactive', 'entered-in-error'] + status_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'status': val } + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found + + @careteam = reply&.resource&.entry&.first&.resource + @careteam_ary = fetch_all_bundled_resources(reply&.resource) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @careteam = reply&.resource&.entry&.first&.resource - @careteam_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) save_delayed_sequence_references(@careteam) validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb index 8a9f972f9..66e79c7aa 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb @@ -74,19 +74,23 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '59408-5' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - + code_val = ['2708-6', '59408-5'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) save_delayed_sequence_references(@observation) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb index d0c2471e7..4613b3c60 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb @@ -74,19 +74,23 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '72166-2' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - + code_val = ['72166-2'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) save_delayed_sequence_references(@observation) validate_search_reply(versioned_resource_class('Observation'), reply, search_params) From 8d169fbd8894321ee0c7a82a5cffd676f3f4415d Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Mon, 4 Nov 2019 07:38:39 -0500 Subject: [PATCH 041/173] fix unit test --- test/unit/sequence_base_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/sequence_base_test.rb b/test/unit/sequence_base_test.rb index b0879b53d..a78135889 100644 --- a/test/unit/sequence_base_test.rb +++ b/test/unit/sequence_base_test.rb @@ -118,7 +118,7 @@ class InvalidKeySequence < Inferno::Sequence::SequenceBase 2.times do |index| test :a do metadata do - id "0#{index}" + id "0#{index + 1}" name 'a' description 'a' link 'http://example.com' From 1f22b6c46a4d2bfbde24211c70efccfbe3a7c063 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 25 Oct 2019 13:43:41 -0400 Subject: [PATCH 042/173] remove unnecessary tests --- .../us_core_patient_read_only_sequence.rb | 79 ------------------- 1 file changed, 79 deletions(-) diff --git a/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb b/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb index f5bddfafc..90d4030f9 100644 --- a/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb +++ b/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb @@ -46,85 +46,6 @@ class USCoreR4PatientReadOnlySequence < SequenceBase assert !@patient.nil?, 'Expected valid Patient resource to be present' assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' end - - test 'Patient validates against Argonaut Profile' do - metadata do - id '03' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' - description %( - A server returns valid FHIR Patient resources according to the [Data Access Framework (DAF) Patient Profile](http://www.fhir.org/guides/argonaut/r2/StructureDefinition-argo-patient.html). - ) - versions :r4 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - profile = Inferno::ValidationUtil.guess_profile(@patient, @instance.fhir_version.to_sym) - errors = profile.validate_resource(@patient) - assert errors.empty?, "Patient did not validate against profile: #{errors.join(', ')}" - end - - test 'Patient has address' do - metadata do - id '04' - description %( - Additional Patient resource requirement - ) - versions :r4 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - address = @patient.try(:address).try(:first) - assert !address.nil?, 'Patient address not returned' - end - - test 'Patient has telecom' do - metadata do - id '05' - description %( - Additional Patient resource requirement - ) - versions :r4 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - telecom = @patient.try(:telecom).try(:first) - assert !telecom.nil?, 'Patient telecom not returned' - end - - # test 'Patient supports $everything operation' do - - # metadata { - # id '00' - # optional - # description %( - # Additional Patient resource requirement - # ) - # } - # test 'Patient supports $everything operation', '', 'DISCUSSION REQUIRED', :optional do - # everything_response = @client.fetch_patient_record(@instance.patient_id) - # skip_unless [200, 201].include?(everything_response.code) - # @everything = everything_response.resource - # assert !@everything.nil?, 'Expected valid Bundle resource on $everything request' - # assert @everything.is_a?(versioned_resource_class('Bundle')), 'Expected resource to be valid Bundle' - # end - - test 'All references can be resolved' do - metadata do - id '06' - link 'https://www.hl7.org/fhir/r4references.html' - description %( - All references in the Patient resource should be resolveable. - ) - versions :r4 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - validate_reference_resolutions(@patient) - end end end end From a8cafe80f866bc59df329f0e4826b5e8a6bb2fa4 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 25 Oct 2019 13:46:00 -0400 Subject: [PATCH 043/173] update argonaut link to us core --- generator/uscore/uscore_generator.rb | 2 +- .../us_core_guidance/us_core_patient_read_only_sequence.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index bf73e315c..d4059d797 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -117,7 +117,7 @@ def create_authorization_test(sequence) authorization_test = { tests_that: "Server rejects #{sequence[:resource]} search without authorization", index: sequence[:tests].length + 1, - link: 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' } first_search = find_first_search(sequence) diff --git a/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb b/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb index 90d4030f9..c30fcd3ae 100644 --- a/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb +++ b/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb @@ -15,7 +15,7 @@ class USCoreR4PatientReadOnlySequence < SequenceBase test 'Server rejects patient read without proper authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( A patient read does not work without authorization. ) @@ -33,7 +33,7 @@ class USCoreR4PatientReadOnlySequence < SequenceBase test 'Server returns expected results from Patient read resource' do metadata do id '02' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( All servers SHALL make available the read interactions for the Argonaut Profiles the server chooses to support. ) From ddebe05807d1b43eebda927dbe126cd6aea3e702 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 25 Oct 2019 13:48:27 -0400 Subject: [PATCH 044/173] regenerate us core sequences --- lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb | 2 +- .../uscore_v3.0.0/pediatric_weight_for_height_sequence.rb | 2 +- .../uscore_v3.0.0/us_core_allergyintolerance_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb | 2 +- .../uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb | 2 +- .../uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb | 2 +- .../modules/uscore_v3.0.0/us_core_documentreference_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb | 2 +- .../modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb | 2 +- .../uscore_v3.0.0/us_core_medicationstatement_sequence.rb | 2 +- .../modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb | 2 +- .../modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb | 2 +- .../uscore_v3.0.1/pediatric_weight_for_height_sequence.rb | 2 +- .../uscore_v3.0.1/us_core_allergyintolerance_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb | 2 +- .../uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb | 2 +- .../uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb | 2 +- .../modules/uscore_v3.0.1/us_core_documentreference_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb | 2 +- .../uscore_v3.0.1/us_core_implantable_device_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb | 2 +- .../modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb | 2 +- .../modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb | 2 +- .../modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb | 2 +- .../modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb | 2 +- lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb | 2 +- 46 files changed, 46 insertions(+), 46 deletions(-) diff --git a/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb index 594ecc6f3..f302e0044 100644 --- a/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Observation search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb index daf77caf6..2e3a247e8 100644 --- a/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Observation search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb index 0f386e65d..802fea0f0 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb @@ -37,7 +37,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects AllergyIntolerance search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb index 357e82f02..d326424b1 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb @@ -47,7 +47,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects CarePlan search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb index bf05d7e36..dc7d6e840 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb @@ -37,7 +37,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects CareTeam search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb index c7f6b07dd..505db2837 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Condition search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb index 1a67dcaf1..27f123c44 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb @@ -37,7 +37,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Device search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb index c1194bcb9..ed17e2733 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects DiagnosticReport search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb index 3d63f6511..5db5d57ca 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects DiagnosticReport search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb index 1c0770350..8940fc626 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb @@ -59,7 +59,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects DocumentReference search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb index f0eb41009..848a8a636 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb @@ -59,7 +59,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Encounter search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb index 1667e946f..7f3eec716 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb @@ -43,7 +43,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Goal search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb index e0bd19e43..3dad84c88 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb @@ -43,7 +43,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Immunization search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb index f64ca6946..735887720 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb @@ -72,7 +72,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Location search without authorization' do metadata do id '02' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb index e1cb81b4a..9d132d97d 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb @@ -41,7 +41,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects MedicationRequest search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb index 7f05a5d99..bf31c25f7 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb @@ -43,7 +43,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects MedicationStatement search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb index a20abc14f..70f9732db 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Observation search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb index e029cf88b..c4e234494 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb @@ -60,7 +60,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Organization search without authorization' do metadata do id '02' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb index fcccc2ac0..0588aca4b 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb @@ -66,7 +66,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Patient search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb index 95350e769..ca09ae8e9 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb @@ -61,7 +61,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Practitioner search without authorization' do metadata do id '02' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb index 0e330a23f..f8e6cf2d8 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb @@ -54,7 +54,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects PractitionerRole search without authorization' do metadata do id '02' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb index 89d882fce..c1e6c605f 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb @@ -47,7 +47,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Procedure search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb index bdb466ee0..fadec6939 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Observation search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb index 3bc949279..6ee9522dd 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Observation search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb index 5d251b05e..c982fa0b9 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Observation search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb index 541fa707d..bf0b47cdf 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb @@ -37,7 +37,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects AllergyIntolerance search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb index 8fdbbf223..81ae5eca0 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb @@ -47,7 +47,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects CarePlan search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb index 9befe0105..0788b0168 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb @@ -37,7 +37,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects CareTeam search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb index d86a0a271..f73176437 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Condition search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb index a8c36a8fa..6ec20cf7c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects DiagnosticReport search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb index a957df0a9..d2ecbf49b 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects DiagnosticReport search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb index db5994084..800374ed5 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb @@ -59,7 +59,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects DocumentReference search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb index 005305e65..fb15ff64a 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb @@ -59,7 +59,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Encounter search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb index aba92e0fe..ae5627ab8 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb @@ -43,7 +43,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Goal search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb index 4d01696c8..05e7f092c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb @@ -43,7 +43,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Immunization search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb index d16ef7c94..a5007e240 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb @@ -37,7 +37,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Device search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb index 7901850fc..8dd89980a 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb @@ -72,7 +72,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Location search without authorization' do metadata do id '02' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb index 22187308e..021d12b22 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb @@ -49,7 +49,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects MedicationRequest search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb index 02a43c433..81e69f168 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Observation search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb index ba36bea05..92fe5c67e 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb @@ -60,7 +60,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Organization search without authorization' do metadata do id '02' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb index a94cda9ac..99ea2e091 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb @@ -66,7 +66,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Patient search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb index 0958f5631..43964a374 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb @@ -61,7 +61,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Practitioner search without authorization' do metadata do id '02' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb index 7b619fbfe..a3aa35126 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb @@ -54,7 +54,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects PractitionerRole search without authorization' do metadata do id '02' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb index 5dd935845..77e8b156d 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb @@ -47,7 +47,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Procedure search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb index d23351eb5..0450daeb1 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Observation search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb index 671e0719d..68865ebec 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb @@ -51,7 +51,7 @@ def validate_resource_item(resource, property, value) test 'Server rejects Observation search without authorization' do metadata do id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) versions :r4 From 0bea7b653d7b36e9e13f3201039229b3800fca49 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 25 Oct 2019 13:54:07 -0400 Subject: [PATCH 045/173] edit wording --- .../us_core_patient_read_only_sequence.rb | 21 ++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb b/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb index c30fcd3ae..080ec5092 100644 --- a/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb +++ b/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb @@ -5,19 +5,24 @@ module Sequence class USCoreR4PatientReadOnlySequence < SequenceBase title 'Patient' - description 'Verify that Patient resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + description %( + Verify that Patient resources on the FHIR server follow the US Core + Implementation Guide + ) test_id_prefix 'ARPA' requires :token, :patient_id conformance_supports :Patient - test 'Server rejects patient read without proper authorization' do + test :unauthenticated_read do metadata do id '01' + name 'Server rejects unauthorized Patient read request' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( - A patient read does not work without authorization. + A server SHALL reject any unauthorized requests by returning an HTTP + 401 unauthorized response code. ) versions :r4 end @@ -30,12 +35,14 @@ class USCoreR4PatientReadOnlySequence < SequenceBase assert_response_unauthorized reply end - test 'Server returns expected results from Patient read resource' do + test :authenticated_read do metadata do id '02' + name 'Server returns Patient resource for an authorized read request' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( - All servers SHALL make available the read interactions for the Argonaut Profiles the server chooses to support. + The US Core Server SHALL support the US Core Patient resource + profile. ) versions :r4 end @@ -43,8 +50,8 @@ class USCoreR4PatientReadOnlySequence < SequenceBase patient_read_response = @client.read(versioned_resource_class('Patient'), @instance.patient_id) assert_response_ok patient_read_response @patient = patient_read_response.resource - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' + assert !@patient.nil?, 'Expected response to be a Patient resource' + assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected response to be a Patient resource' end end end From 3eff8d9b237a070ab790eae12a15757f8de0044b Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 25 Oct 2019 14:41:21 -0400 Subject: [PATCH 046/173] rename read only sequence file --- ..._only_sequence.rb => us_core_r4_patient_read_only_sequence.rb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lib/app/modules/us_core_guidance/{us_core_patient_read_only_sequence.rb => us_core_r4_patient_read_only_sequence.rb} (100%) diff --git a/lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb b/lib/app/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb similarity index 100% rename from lib/app/modules/us_core_guidance/us_core_patient_read_only_sequence.rb rename to lib/app/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb From 56862c25045fee832e6959298e29aa7c3fa4e8b9 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 25 Oct 2019 15:22:16 -0400 Subject: [PATCH 047/173] add tests for patient read sequence --- lib/app/utils/assertions.rb | 5 +- test/sequence/patient_read_sequence_test.rb | 4 +- ...core_r4_patient_read_only_sequence_test.rb | 91 +++++++++++++++++++ test/unit/assertions_test.rb | 10 +- 4 files changed, 99 insertions(+), 11 deletions(-) create mode 100644 test/sequence/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb diff --git a/lib/app/utils/assertions.rb b/lib/app/utils/assertions.rb index 560c134b2..704d884bd 100644 --- a/lib/app/utils/assertions.rb +++ b/lib/app/utils/assertions.rb @@ -1,6 +1,5 @@ # frozen_string_literal: true -require_relative 'assertions.rb' require 'uri' module Inferno @@ -35,8 +34,8 @@ def assert_response_accepted(response) end def assert_response_unauthorized(response) - message = "Bad response code: expected 401 or 406, but found #{response.code}" - assert [401, 406].include?(response.code), message + message = "Bad response code: expected 401, but found #{response.code}" + assert response.code == 401, message end def assert_response_bad_or_unauthorized(response) diff --git a/test/sequence/patient_read_sequence_test.rb b/test/sequence/patient_read_sequence_test.rb index 934ae5d00..cb285ed1d 100644 --- a/test/sequence/patient_read_sequence_test.rb +++ b/test/sequence/patient_read_sequence_test.rb @@ -55,13 +55,13 @@ def full_sequence_stubs uri_template = Addressable::Template.new 'http://www.example.com/Patient{?identifier,family,gender,given,birthdate}' stub_request(:get, "http://www.example.com/Patient/#{@patient_id}") .to_return( - { status: 406, body: nil, headers: @response_headers }, + { status: 401, body: nil, headers: @response_headers }, status: 200, body: patient.to_json, headers: @response_headers ) stub_request(:get, uri_template) .to_return( - { status: 406, body: nil, headers: @response_headers }, + { status: 401, body: nil, headers: @response_headers }, status: 200, body: patient.to_json, headers: @response_headers ) diff --git a/test/sequence/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb b/test/sequence/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb new file mode 100644 index 000000000..3e3fc0234 --- /dev/null +++ b/test/sequence/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +describe Inferno::Sequence::USCoreR4PatientReadOnlySequence do + before do + @base_url = 'http://www.example.com/fhir' + @token = 'ABC' + @patient_id = '123' + @sequence_class = Inferno::Sequence::USCoreR4PatientReadOnlySequence + @client = FHIR::Client.new(@base_url) + @client.set_bearer_token(@token) + @instance = Inferno::Models::TestingInstance.create + @instance.patient_id = @patient_id + end + + describe 'unauthenticated read test' do + before do + @test = @sequence_class[:unauthenticated_read] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips if no token is set' do + assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + end + + it 'fails when the server does not return a 401' do + @instance.token = 'ABC' + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Bad response code: expected 401, but found 200' + end + + it 'succeeds when the server returns a 401' do + @instance.token = @token + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .to_return(status: 401) + + @sequence.run_test(@test) + end + end + + describe 'authenticated read test' do + before do + @test = @sequence_class[:authenticated_read] + @sequence = @sequence_class.new(@instance, @client) + @instance.token = @token + end + + it 'fails when the server does not return a 200' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 202) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Bad response code: expected 200, 201, but found 202. ' + end + + it 'fails when the server does not return a FHIR resource' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Expected response to be a Patient resource' + end + + it 'fails when the server does not return a Patient Resource' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 200, body: FHIR::Condition.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Expected response to be a Patient resource' + end + + it 'succeeds when the server returns a Patient Resource' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + @sequence.run_test(@test) + end + end +end diff --git a/test/unit/assertions_test.rb b/test/unit/assertions_test.rb index 2b679b000..0b0059027 100644 --- a/test/unit/assertions_test.rb +++ b/test/unit/assertions_test.rb @@ -91,18 +91,16 @@ end describe '#assert_response_unauthorized' do - it 'raises an AssertionException for status codes other than 401 and 406' do + it 'raises an AssertionException for status codes other than 401' do bad_response = OpenStruct.new(code: 200) assert_raises(Inferno::AssertionException) do @inferno_asserter.assert_response_unauthorized(bad_response) end end - it 'does not raise an exception for status codes 401 and 406' do - [401, 406].each do |status| - response = OpenStruct.new(code: status) - @inferno_asserter.assert_response_unauthorized(response) - end + it 'does not raise an exception for status code 401' do + response = OpenStruct.new(code: 401) + @inferno_asserter.assert_response_unauthorized(response) end end From 9a17ee1af63876f8a80cbe1fbd3930b935d93a6d Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 25 Oct 2019 15:28:25 -0400 Subject: [PATCH 048/173] update test prefix --- .../us_core_guidance/us_core_r4_patient_read_only_sequence.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb b/lib/app/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb index 080ec5092..99cd7e425 100644 --- a/lib/app/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb +++ b/lib/app/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb @@ -10,7 +10,7 @@ class USCoreR4PatientReadOnlySequence < SequenceBase Implementation Guide ) - test_id_prefix 'ARPA' + test_id_prefix 'USCPAR' requires :token, :patient_id conformance_supports :Patient From 48dbde5e098f2d8197f4444f82a34e163e8aa702 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 25 Oct 2019 15:33:57 -0400 Subject: [PATCH 049/173] update argonaut patient read sequence --- .../argonaut_patient_read_only_sequence.rb | 97 +++---------------- ...ut_patient_read_only_sequence_unit_test.rb | 91 +++++++++++++++++ 2 files changed, 103 insertions(+), 85 deletions(-) create mode 100644 test/sequence/argonaut/argonaut_patient_read_only_sequence_unit_test.rb diff --git a/lib/app/modules/argonaut/argonaut_patient_read_only_sequence.rb b/lib/app/modules/argonaut/argonaut_patient_read_only_sequence.rb index c915780ed..deb7f93d7 100644 --- a/lib/app/modules/argonaut/argonaut_patient_read_only_sequence.rb +++ b/lib/app/modules/argonaut/argonaut_patient_read_only_sequence.rb @@ -5,16 +5,20 @@ module Sequence class ArgonautPatientReadOnlySequence < SequenceBase title 'Patient' - description 'Verify that Patient resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + description %( + Verify that Patient resources on the FHIR server follow the Argonaut + Data Query Implementation Guide + ) test_id_prefix 'ARPA' requires :token, :patient_id conformance_supports :Patient - test 'Server rejects patient read without proper authorization' do + test :unauthenticated_read do metadata do id '01' + name 'Server rejects unauthorized Patient read request' link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' description %( A patient read does not work without authorization. @@ -30,12 +34,14 @@ class ArgonautPatientReadOnlySequence < SequenceBase assert_response_unauthorized reply end - test 'Server returns expected results from Patient read resource' do + test :authenticated_read do metadata do id '02' + name 'Server returns Patient resource for an authorized read request' link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' description %( - All servers SHALL make available the read interactions for the Argonaut Profiles the server chooses to support. + All servers SHALL make available the read interactions for the + Argonaut Profiles the server chooses to support. ) versions :dstu2 end @@ -43,87 +49,8 @@ class ArgonautPatientReadOnlySequence < SequenceBase patient_read_response = @client.read(versioned_resource_class('Patient'), @instance.patient_id) assert_response_ok patient_read_response @patient = patient_read_response.resource - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - end - - test 'Patient validates against Argonaut Profile' do - metadata do - id '03' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' - description %( - A server returns valid FHIR Patient resources according to the [Data Access Framework (DAF) Patient Profile](http://www.fhir.org/guides/argonaut/r2/StructureDefinition-argo-patient.html). - ) - versions :dstu2 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - profile = Inferno::ValidationUtil.guess_profile(@patient, @instance.fhir_version.to_sym) - errors = profile.validate_resource(@patient) - assert errors.empty?, "Patient did not validate against profile: #{errors.join(', ')}" - end - - test 'Patient has address' do - metadata do - id '04' - description %( - Additional Patient resource requirement - ) - versions :dstu2 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - address = @patient.try(:address).try(:first) - assert !address.nil?, 'Patient address not returned' - end - - test 'Patient has telecom' do - metadata do - id '05' - description %( - Additional Patient resource requirement - ) - versions :dstu2 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - telecom = @patient.try(:telecom).try(:first) - assert !telecom.nil?, 'Patient telecom not returned' - end - - # test 'Patient supports $everything operation' do - - # metadata { - # id '00' - # optional - # description %( - # Additional Patient resource requirement - # ) - # } - # test 'Patient supports $everything operation', '', 'DISCUSSION REQUIRED', :optional do - # everything_response = @client.fetch_patient_record(@instance.patient_id) - # skip_unless [200, 201].include?(everything_response.code) - # @everything = everything_response.resource - # assert !@everything.nil?, 'Expected valid Bundle resource on $everything request' - # assert @everything.is_a?(versioned_resource_class('Bundle')), 'Expected resource to be valid Bundle' - # end - - test 'All references can be resolved' do - metadata do - id '06' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - All references in the Patient resource should be resolveable. - ) - versions :dstu2 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - validate_reference_resolutions(@patient) + assert !@patient.nil?, 'Expected response to be a Patient resource' + assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected response to be a Patient resource' end end end diff --git a/test/sequence/argonaut/argonaut_patient_read_only_sequence_unit_test.rb b/test/sequence/argonaut/argonaut_patient_read_only_sequence_unit_test.rb new file mode 100644 index 000000000..f30727918 --- /dev/null +++ b/test/sequence/argonaut/argonaut_patient_read_only_sequence_unit_test.rb @@ -0,0 +1,91 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +describe Inferno::Sequence::ArgonautPatientReadOnlySequence do + before do + @base_url = 'http://www.example.com/fhir' + @token = 'ABC' + @patient_id = '123' + @sequence_class = Inferno::Sequence::ArgonautPatientReadOnlySequence + @client = FHIR::Client.new(@base_url) + @client.set_bearer_token(@token) + @instance = Inferno::Models::TestingInstance.create + @instance.patient_id = @patient_id + end + + describe 'unauthenticated read test' do + before do + @test = @sequence_class[:unauthenticated_read] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips if no token is set' do + assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + end + + it 'fails when the server does not return a 401' do + @instance.token = 'ABC' + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Bad response code: expected 401, but found 200' + end + + it 'succeeds when the server returns a 401' do + @instance.token = @token + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .to_return(status: 401) + + @sequence.run_test(@test) + end + end + + describe 'authenticated read test' do + before do + @test = @sequence_class[:authenticated_read] + @sequence = @sequence_class.new(@instance, @client) + @instance.token = @token + end + + it 'fails when the server does not return a 200' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 202) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Bad response code: expected 200, 201, but found 202. ' + end + + it 'fails when the server does not return a FHIR resource' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Expected response to be a Patient resource' + end + + it 'fails when the server does not return a Patient Resource' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 200, body: FHIR::DSTU2::Condition.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Expected response to be a Patient resource' + end + + it 'succeeds when the server returns a Patient Resource' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 200, body: FHIR::DSTU2::Patient.new.to_json) + + @sequence.run_test(@test) + end + end +end From d7515db621ff754257b5c8f2ae25391b4d67f48a Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 4 Nov 2019 10:15:30 -0500 Subject: [PATCH 050/173] Update tests after merge --- generator/uscore/uscore_generator.rb | 4 ++-- .../modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb | 5 ++++- .../uscore_v3.0.1/pediatric_weight_for_height_sequence.rb | 5 ++++- lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb | 5 ++++- lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb | 5 ++++- .../uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb | 4 +++- .../uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb | 4 +++- .../uscore_v3.0.1/us_core_observation_lab_sequence.rb | 5 ++++- .../modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb | 5 ++++- .../modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb | 5 ++++- 10 files changed, 36 insertions(+), 11 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 5a553807b..1c58ce472 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -374,7 +374,7 @@ def get_first_search(search_parameters, sequence) @#{sequence[:resource].downcase} = reply&.resource&.entry&.first&.resource @#{sequence[:resource].downcase}_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(#{save_resource_ids_in_bundle_arguments}) - save_delayed_sequence_references(@#{sequence[:resource].downcase}) + save_delayed_sequence_references(@#{sequence[:resource].downcase}_ary) validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params) ) else @@ -400,7 +400,7 @@ def get_first_search(search_parameters, sequence) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found save_resource_ids_in_bundle(#{save_resource_ids_in_bundle_arguments}) - save_delayed_sequence_references(@#{sequence[:resource].downcase}) + save_delayed_sequence_references(@#{sequence[:resource].downcase}_ary) validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params)) end search_code diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb index 720b21361..2be03c0d1 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb @@ -243,7 +243,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '59576-9' } + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + search_params = { 'patient': patient_val, 'code': code_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb index 3a07eb4d1..becd78e73 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb @@ -243,7 +243,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '77606-2' } + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + search_params = { 'patient': patient_val, 'code': code_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb index e10f7ffbd..50ac92c0f 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb @@ -235,7 +235,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, category: 'assess-plan' } + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb index 41e02fd6e..0a90296bf 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb @@ -136,7 +136,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, status: 'active' } + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@careteam_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb index aa1105eb0..9fbad631b 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb @@ -293,7 +293,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, category: 'LAB' } + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb index 75edab991..f71e2f15c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb @@ -293,7 +293,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb index 208c3bd73..c8d9544d3 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb @@ -243,7 +243,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, category: 'laboratory' } + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb index b09b12f8d..71e229619 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb @@ -243,7 +243,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '59408-5' } + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + search_params = { 'patient': patient_val, 'code': code_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb index edce1491e..d8267c916 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb @@ -243,7 +243,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '72166-2' } + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + search_params = { 'patient': patient_val, 'code': code_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) From d13b374050474af76f6873484b050350e95bc241 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 4 Nov 2019 16:22:05 -0500 Subject: [PATCH 051/173] fix searches trying to access reply --- generator/uscore/uscore_generator.rb | 10 +++++----- .../uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb | 8 ++++---- .../pediatric_weight_for_height_sequence.rb | 8 ++++---- .../modules/uscore_v3.0.1/us_core_careplan_sequence.rb | 8 ++++---- .../modules/uscore_v3.0.1/us_core_careteam_sequence.rb | 8 ++++---- .../us_core_medicationrequest_sequence.rb | 8 ++++---- .../uscore_v3.0.1/us_core_observation_lab_sequence.rb | 8 ++++---- .../uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb | 8 ++++---- .../uscore_v3.0.1/us_core_smokingstatus_sequence.rb | 8 ++++---- 9 files changed, 37 insertions(+), 37 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 1c58ce472..1c5dc92b0 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -395,13 +395,13 @@ def get_first_search(search_parameters, sequence) @#{sequence[:resource].downcase} = reply&.resource&.entry&.first&.resource @#{sequence[:resource].downcase}_ary = fetch_all_bundled_resources(reply&.resource) + + save_resource_ids_in_bundle(#{save_resource_ids_in_bundle_arguments}) + save_delayed_sequence_references(@#{sequence[:resource].downcase}_ary) + validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params) break end - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - save_resource_ids_in_bundle(#{save_resource_ids_in_bundle_arguments}) - save_delayed_sequence_references(@#{sequence[:resource].downcase}_ary) - validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params)) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found) end search_code end diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb index 2be03c0d1..09e0cb216 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb @@ -87,13 +87,13 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) + + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) break end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb index becd78e73..4f7156d24 100644 --- a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb @@ -87,13 +87,13 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) + + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) break end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb index 50ac92c0f..3c86e2700 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb @@ -83,13 +83,13 @@ def validate_resource_item(resource, property, value) @careplan = reply&.resource&.entry&.first&.resource @careplan_ary = fetch_all_bundled_resources(reply&.resource) + + save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) + save_delayed_sequence_references(@careplan_ary) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) break end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) - save_delayed_sequence_references(@careplan_ary) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) end test 'Server returns expected results from CarePlan search by patient+category+date' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb index 0a90296bf..89d371190 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb @@ -73,13 +73,13 @@ def validate_resource_item(resource, property, value) @careteam = reply&.resource&.entry&.first&.resource @careteam_ary = fetch_all_bundled_resources(reply&.resource) + + save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) + save_delayed_sequence_references(@careteam_ary) + validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) break end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) - save_delayed_sequence_references(@careteam_ary) - validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) end test 'CareTeam read resource supported' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb index a0f43baf7..67862228c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb @@ -85,13 +85,13 @@ def validate_resource_item(resource, property, value) @medicationrequest = reply&.resource&.entry&.first&.resource @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) + + save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) + save_delayed_sequence_references(@medicationrequest_ary) + validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) break end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) - save_delayed_sequence_references(@medicationrequest_ary) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) end test 'Server returns expected results from MedicationRequest search by patient+intent+status' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb index c8d9544d3..4f32efb19 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb @@ -87,13 +87,13 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) + + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) break end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+code' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb index 71e229619..52d597783 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb @@ -87,13 +87,13 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) + + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) break end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb index d8267c916..d17f3480c 100644 --- a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb @@ -87,13 +87,13 @@ def validate_resource_item(resource, property, value) @observation = reply&.resource&.entry&.first&.resource @observation_ary = fetch_all_bundled_resources(reply&.resource) + + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) break end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do From 2684827b04e2e04cc33b40332be0cba15e4be259 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 5 Nov 2019 08:11:48 -0500 Subject: [PATCH 052/173] add created_at timestamp to ResourceReference --- lib/app/models/resource_reference.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/app/models/resource_reference.rb b/lib/app/models/resource_reference.rb index 39996dc54..ee695b36d 100644 --- a/lib/app/models/resource_reference.rb +++ b/lib/app/models/resource_reference.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'dm-timestamps' + module Inferno module Models class ResourceReference @@ -8,6 +10,7 @@ class ResourceReference property :resource_type, String property :resource_id, String property :profile, String + property :created_at, DateTime belongs_to :testing_instance end From 8ce884254737ed03c0f2ce41d0928f923a0e5b06 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 5 Nov 2019 08:37:06 -0500 Subject: [PATCH 053/173] make TestingInstance#patient_id deterministic --- lib/app/models/testing_instance.rb | 11 ++++--- .../medication_order_sequence_test.rb | 29 ++++++++++--------- test/sequence/r4_provenance_sequence_test.rb | 9 +++--- .../us_core_r4/clinicalnotes_sequence_test.rb | 9 +++--- 4 files changed, 28 insertions(+), 30 deletions(-) diff --git a/lib/app/models/testing_instance.rb b/lib/app/models/testing_instance.rb index ff2aea1b8..fea0634db 100644 --- a/lib/app/models/testing_instance.rb +++ b/lib/app/models/testing_instance.rb @@ -147,8 +147,8 @@ def module def patient_id resource_references - .select { |ref| ref.resource_type == 'Patient' } - .first&.resource_id + .first(resource_type: 'Patient', order: [:created_at.asc]) + &.resource_id end def patient_id=(patient_id) @@ -156,11 +156,10 @@ def patient_id=(patient_id) resource_references.destroy - save! - - resource_references << ResourceReference.new( + ResourceReference.create( resource_type: 'Patient', - resource_id: patient_id + resource_id: patient_id, + testing_instance: self ) save! diff --git a/test/sequence/medication_order_sequence_test.rb b/test/sequence/medication_order_sequence_test.rb index 749980440..0b0484eca 100644 --- a/test/sequence/medication_order_sequence_test.rb +++ b/test/sequence/medication_order_sequence_test.rb @@ -40,23 +40,24 @@ def setup @patient_resource = FHIR::DSTU2::Patient.new(id: @patient_id) @practitioner_resource = FHIR::DSTU2::Practitioner.new(id: 432) - @instance = Inferno::Models::TestingInstance.new(url: 'http://www.example.com', - client_name: 'Inferno', - base_url: 'http://localhost:4567', - client_endpoint_key: Inferno::SecureRandomBase62.generate(32), - client_id: SecureRandom.uuid, - selected_module: 'argonaut', - oauth_authorize_endpoint: 'http://oauth_reg.example.com/authorize', - oauth_token_endpoint: 'http://oauth_reg.example.com/token', - scopes: 'launch openid patient/*.* profile', - token: 99_897_979) - - @instance.save! # this is for convenience. we could rewrite to ensure nothing gets saved within tests. + @instance = Inferno::Models::TestingInstance.create( + url: 'http://www.example.com', + client_name: 'Inferno', + base_url: 'http://localhost:4567', + client_endpoint_key: Inferno::SecureRandomBase62.generate(32), + client_id: SecureRandom.uuid, + selected_module: 'argonaut', + oauth_authorize_endpoint: 'http://oauth_reg.example.com/authorize', + oauth_token_endpoint: 'http://oauth_reg.example.com/token', + scopes: 'launch openid patient/*.* profile', + token: 99_897_979 + ) # Assume we already have a patient - @instance.resource_references << Inferno::Models::ResourceReference.new( + Inferno::Models::ResourceReference.create( resource_type: 'Patient', - resource_id: @patient_id + resource_id: @patient_id, + testing_instance: @instance ) set_resource_support(@instance, 'MedicationOrder') diff --git a/test/sequence/r4_provenance_sequence_test.rb b/test/sequence/r4_provenance_sequence_test.rb index 5ef6c9409..fe7170fb4 100644 --- a/test/sequence/r4_provenance_sequence_test.rb +++ b/test/sequence/r4_provenance_sequence_test.rb @@ -29,7 +29,7 @@ def setup ] } - @instance = Inferno::Models::TestingInstance.new( + @instance = Inferno::Models::TestingInstance.create( url: 'http://www.example.com', client_name: 'Inferno', base_url: 'http://localhost:4567', @@ -42,11 +42,10 @@ def setup token: 99_897_979 ) - @instance.save! - - @instance.resource_references << Inferno::Models::ResourceReference.new( + Inferno::Models::ResourceReference.create( resource_type: 'Patient', - resource_id: @patient_id + resource_id: @patient_id, + testing_instance: @instance ) set_resource_support(@instance, 'Provenance') diff --git a/test/sequence/us_core_r4/clinicalnotes_sequence_test.rb b/test/sequence/us_core_r4/clinicalnotes_sequence_test.rb index 00fd999ee..583ccb9a8 100644 --- a/test/sequence/us_core_r4/clinicalnotes_sequence_test.rb +++ b/test/sequence/us_core_r4/clinicalnotes_sequence_test.rb @@ -8,7 +8,7 @@ def setup @docref_bundle = FHIR.from_contents(load_fixture(:us_core_r4_clinicalnotes_docref_bundle)) @diagrpt_bundle = FHIR.from_contents(load_fixture(:us_core_r4_clinicalnotes_diagrpt_bundle)) - @instance = Inferno::Models::TestingInstance.new( + @instance = Inferno::Models::TestingInstance.create( url: 'http://www.example.com', client_name: 'Inferno', base_url: 'http://localhost:4567', @@ -21,11 +21,10 @@ def setup token: 99_897_979 ) - @instance.save! - - @instance.resource_references << Inferno::Models::ResourceReference.new( + Inferno::Models::ResourceReference.create( resource_type: 'Patient', - resource_id: @patient_id + resource_id: @patient_id, + testing_instance: @instance ) set_resource_support(@instance, 'DocumentReference') From 85f5d693bee410a3879fa9cd977ed58af901e5f5 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 5 Nov 2019 08:45:37 -0500 Subject: [PATCH 054/173] add unit tests --- test/unit/test_instance_test.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/test/unit/test_instance_test.rb b/test/unit/test_instance_test.rb index 04a08f2f8..81543b5ef 100644 --- a/test/unit/test_instance_test.rb +++ b/test/unit/test_instance_test.rb @@ -74,4 +74,26 @@ assert !@instance.fhir_version_match?(fhir_versions) end end + + describe '#patient_id' do + it 'returns the id of the Patient reference which was created first' do + 10.times do |index| + Inferno::Models::ResourceReference.create( + resource_type: 'Patient', + resource_id: index.to_s, + testing_instance: @instance + ) + end + + assert_equal '0', @instance.patient_id + end + end + + describe '#patient_id=' do + it 'sets the patient id' do + @instance.patient_id = '123' + + assert_equal '123', @instance.patient_id + end + end end From 8dcffd1d421f8eab7836f2c05fff7a1cdb549daa Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 5 Nov 2019 12:39:40 -0500 Subject: [PATCH 055/173] update generated tests for 3.0.0 --- .../pediatric_bmi_for_age_sequence.rb | 32 ++++++------- .../pediatric_weight_for_height_sequence.rb | 32 ++++++------- .../us_core_allergyintolerance_sequence.rb | 6 +-- .../us_core_careplan_sequence.rb | 32 ++++++------- .../us_core_careteam_sequence.rb | 32 ++++++------- .../us_core_condition_sequence.rb | 6 +-- .../uscore_v3.0.0/us_core_device_sequence.rb | 6 +-- .../us_core_diagnosticreport_lab_sequence.rb | 45 ++++++++++--------- .../us_core_diagnosticreport_note_sequence.rb | 45 ++++++++++--------- .../us_core_documentreference_sequence.rb | 6 +-- .../us_core_encounter_sequence.rb | 6 +-- .../uscore_v3.0.0/us_core_goal_sequence.rb | 6 +-- .../us_core_immunization_sequence.rb | 6 +-- .../us_core_location_sequence.rb | 6 +-- .../us_core_medicationrequest_sequence.rb | 6 +-- .../us_core_medicationstatement_sequence.rb | 6 +-- .../us_core_observation_lab_sequence.rb | 32 ++++++------- .../us_core_organization_sequence.rb | 6 +-- .../uscore_v3.0.0/us_core_patient_sequence.rb | 4 +- .../us_core_practitioner_sequence.rb | 6 +-- .../us_core_practitionerrole_sequence.rb | 6 +-- .../us_core_procedure_sequence.rb | 6 +-- .../us_core_smokingstatus_sequence.rb | 32 ++++++------- 23 files changed, 167 insertions(+), 203 deletions(-) diff --git a/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb index 594ecc6f3..0bd157412 100644 --- a/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb @@ -59,9 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '59576-9' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -76,22 +74,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '59576-9' } + code_val = ['59576-9'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category' do diff --git a/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb index daf77caf6..00f008d35 100644 --- a/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb @@ -59,9 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '77606-2' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -76,22 +74,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '77606-2' } + code_val = ['77606-2'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category' do diff --git a/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb index 0f386e65d..54480633b 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb @@ -45,11 +45,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb index 357e82f02..d35112d4a 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb @@ -55,9 +55,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'assess-plan' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -72,22 +70,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, category: 'assess-plan' } + category_val = ['assess-plan'] + category_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'category': val } + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @careplan = reply&.resource&.entry&.first&.resource + @careplan_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) + save_delayed_sequence_references(@careplan_ary) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @careplan = reply&.resource&.entry&.first&.resource - @careplan_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) - save_delayed_sequence_references(@careplan_ary) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) end test 'Server returns expected results from CarePlan search by patient+category+status' do diff --git a/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb index bf05d7e36..347aa7793 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb @@ -45,9 +45,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, status: 'active' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -62,22 +60,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, status: 'active' } + status_val = ['proposed', 'active', 'suspended', 'inactive', 'entered-in-error'] + status_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'status': val } + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @careteam = reply&.resource&.entry&.first&.resource + @careteam_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) + save_delayed_sequence_references(@careteam_ary) + validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @careteam = reply&.resource&.entry&.first&.resource - @careteam_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) - save_delayed_sequence_references(@careteam_ary) - validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) end test 'CareTeam read resource supported' do diff --git a/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb index c7f6b07dd..545fab790 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb @@ -59,11 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb index 1a67dcaf1..036176842 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb @@ -45,11 +45,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Device'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb index c1194bcb9..a88de8ea2 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb @@ -59,15 +59,13 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'LAB' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply end - test 'Server returns expected results from DiagnosticReport search by patient+category' do + test 'Server returns expected results from DiagnosticReport search by patient+code' do metadata do id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -76,25 +74,29 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, category: 'LAB' } + code_val = ['1-8', '10-9', '100-8', '1000-9', '10000-8', '10001-6', '10002-4', '10003-2', '10004-0', '10005-7', '10006-5', '10007-3', '10008-1', '10009-9', '1001-7', '10010-7', '10011-5', '10012-3', '10013-1', '10014-9', '10015-6', '10016-4', '10017-2', '10018-0', '10019-8', '1002-5', '10020-6', '10021-4', '10022-2', '10023-0', '10024-8', '10025-5', '10026-3', '10027-1', '10028-9', '10029-7', '1003-3', '10030-5', '10031-3', '10032-1', '10033-9', '10034-7', '10035-4', '10036-2', '10037-0', '10038-8', '10039-6', '1004-1', '10040-4', '10041-2', '10042-0', '10043-8', '10044-6', '10045-3', '10046-1', '10047-9', '10048-7', '10049-5', '1005-8', '10050-3', '10051-1', '10052-9', '10053-7', '10054-5', '10055-2', '10056-0', '10057-8', '10058-6', '10059-4', '1006-6', '10060-2', '10061-0', '10062-8', '10063-6', '10064-4', '10065-1', '10066-9', '10067-7', '10068-5', '10069-3', '1007-4', '10070-1', '10071-9', '10072-7', '10073-5', '10074-3', '10075-0', '10076-8', '10077-6', '10078-4', '10079-2', '1008-2', '10080-0', '10081-8', '10082-6', '10083-4', '10084-2', '10085-9', '10086-7', '10087-5', '10088-3', '10089-1', '1009-0', '10090-9', '10091-7', '10092-5', '10093-3', '10094-1', '10095-8', '10096-6', '10097-4', '10098-2', '10099-0', '101-6', '1010-8', '10100-6', '10101-4', '10102-2', '10103-0', '10104-8', '10105-5', '10106-3', '10107-1', '10108-9', '10109-7', '1011-6', '10110-5', '10111-3', '10112-1', '10113-9', '10114-7', '10115-4', '10116-2', '10117-0', '10118-8', '10119-6', '1012-4', '10120-4', '10121-2', '10122-0', '10123-8', '10124-6', '10125-3', '10126-1', '10127-9', '10128-7', '10129-5', '1013-2', '10130-3', '10131-1', '10132-9', '10133-7', '10134-5', '10135-2', '10136-0', '10137-8', '10138-6', '10139-4', '1014-0', '10140-2', '10141-0', '10142-8', '10143-6', '10144-4', '10145-1', '10146-9', '10147-7', '10148-5', '10149-3', '1015-7', '10150-1', '10151-9', '10152-7', '10153-5', '10154-3', '10155-0', '10156-8', '10157-6', '10158-4', '10159-2', '1016-5', '10160-0', '10161-8', '10162-6', '10163-4', '10164-2', '10165-9', '10166-7', '10167-5', '10168-3', '10169-1', '1017-3', '10170-9', '10171-7', '10172-5', '10173-3', '10174-1', '10175-8', '10176-6', '10177-4', '10178-2', '10179-0', '1018-1', '10180-8', '10181-6', '10182-4', '10183-2', '10184-0', '10185-7', '10186-5', '10187-3', '10188-1', '10189-9', '1019-9', '10190-7', '10191-5', '10192-3', '10193-1', '10194-9', '10195-6', '10196-4', '10197-2', '10198-0', '10199-8', '102-4', '1020-7', '10200-4', '10201-2', '10202-0', '10203-8', '10204-6', '10205-3', '10206-1', '10207-9', '10208-7', '10209-5', '1021-5', '10210-3', '10211-1', '10212-9', '10213-7', '10214-5', '10215-2', '10216-0', '10217-8', '10218-6', '10219-4', '1022-3', '10220-2', '10221-0', '10222-8', '10223-6', '10224-4', '10225-1', '10226-9', '10227-7', '10228-5', '10229-3', '1023-1', '10230-1', '10231-9', '10232-7', '10233-5', '10234-3', '10235-0', '10236-8', '10237-6', '10238-4', '10239-2', '1024-9', '10240-0', '10241-8', '10242-6', '10243-4', '10244-2', '10245-9', '10246-7', '10247-5', '10248-3', '10249-1', '1025-6', '10250-9', '10251-7', '10252-5', '10253-3', '10254-1', '10255-8', '10256-6', '10257-4', '10258-2', '10259-0', '1026-4', '10260-8', '10261-6', '10262-4', '10263-2', '10264-0', '10265-7', '10266-5', '10267-3', '10268-1', '10269-9', '1027-2', '10270-7', '10271-5', '10272-3', '10273-1', '10274-9', '10275-6', '10276-4', '10277-2', '10278-0', '10279-8', '1028-0', '10280-6', '10281-4', '10282-2', '10283-0', '10284-8', '10285-5', '10286-3', '10287-1', '10288-9', '10289-7', '1029-8', '10290-5', '10291-3', '10292-1', '10293-9', '10294-7', '10295-4', '10296-2', '10297-0', '10298-8', '10299-6', '103-2', '1030-6', '10300-2', '10301-0', '10302-8', '10303-6', '10304-4', '10305-1', '10306-9', '10307-7', '10308-5', '10309-3', '1031-4', '10310-1', '10311-9', '10312-7', '10313-5', '10314-3', '10315-0', '10316-8', '10317-6', '10318-4', '10319-2', '1032-2', '10320-0', '10321-8', '10322-6', '10323-4', '10324-2', '10325-9', '10326-7', '10327-5', '10328-3', '10329-1', '1033-0', '10330-9', '10331-7', '10332-5', '10333-3', '10334-1', '10335-8', '10336-6', '10337-4', '10338-2', '10339-0', '1034-8', '10340-8', '10341-6', '10342-4', '10343-2', '10344-0', '10345-7', '10346-5', '10347-3', '10348-1', '10349-9', '1035-5', '10350-7', '10351-5', '10352-3', '10353-1', '10354-9', '10355-6', '10356-4', '10357-2', '10358-0', '10359-8', '1036-3', '10360-6', '10361-4', '10362-2', '10363-0', '10364-8', '10365-5', '10366-3', '10367-1', '10368-9', '10369-7', '1037-1', '10370-5', '10371-3', '10372-1', '10373-9', '10374-7', '10375-4', '10376-2', '10377-0', '10378-8', '10379-6', '1038-9', '10380-4', '10381-2', '10382-0', '10383-8', '10384-6', '10385-3', '10386-1', '10387-9', '10388-7', '10389-5', '1039-7', '10390-3', '10391-1', '10392-9', '10393-7', '10394-5', '10395-2', '10396-0', '10397-8', '10398-6', '10399-4', '104-0', '1040-5', '10400-0', '10401-8', '10402-6', '10403-4', '10404-2', '10405-9', '10406-7', '10407-5', '10408-3', '10409-1', '1041-3', '10410-9', '10411-7', '10412-5', '10413-3', '10414-1', '10415-8', '10416-6', '10417-4', '10418-2', '10419-0', '1042-1', '10420-8', '10421-6', '10422-4', '10423-2', '10424-0', '10425-7', '10426-5', '10427-3', '10428-1', '10429-9', '1043-9', '10430-7', '10431-5', '10432-3', '10433-1', '10434-9', '10435-6', '10436-4', '10437-2', '10438-0', '10439-8', '1044-7', '10440-6', '10441-4', '10442-2', '10443-0', '10444-8', '10445-5', '10446-3', '10447-1', '10448-9', '10449-7', '1045-4', '10450-5', '10451-3', '10452-1', '10453-9', '10454-7', '10455-4', '10456-2', '10457-0', '10458-8', '10459-6', '1046-2', '10460-4', '10461-2', '10462-0', '10463-8', '10464-6', '10465-3', '10466-1', '10467-9', '10468-7', '10469-5', '1047-0', '10470-3', '10471-1', '10472-9', '10473-7', '10474-5', '10475-2', '10476-0', '10477-8', '10478-6', '10479-4', '1048-8', '10480-2', '10481-0', '10482-8', '10483-6', '10484-4', '10485-1', '10486-9', '10487-7', '10488-5', '10489-3', '1049-6', '10490-1', '10491-9', '10492-7', '10493-5', '10494-3', '10495-0', '10496-8', '10497-6', '10498-4', '10499-2', '105-7', '1050-4', '10500-7', '10501-5', '10502-3', '10503-1', '10504-9', '10505-6', '10506-4', '10507-2', '10508-0', '10509-8', '1051-2', '10510-6', '10511-4', '10512-2', '10513-0', '10514-8', '10515-5', '10516-3', '10517-1', '10518-9', '10519-7', '1052-0', '10520-5', '10521-3', '10522-1', '10523-9', '10524-7', '10525-4', '10526-2', '10527-0', '10528-8', '10529-6', '1053-8', '10530-4', '10531-2', '10532-0', '10533-8', '10534-6', '10535-3', '10536-1', '10537-9', '10538-7', '10539-5', '1054-6', '10540-3', '10541-1', '10542-9', '10543-7', '10544-5', '10545-2', '10546-0', '10547-8', '10548-6', '10549-4', '1055-3', '10550-2', '10551-0', '10552-8', '10553-6', '10554-4', '10555-1', '10556-9', '10557-7', '10558-5', '10559-3', '1056-1', '10560-1', '10561-9', '10562-7', '10563-5', '10564-3', '10565-0', '10566-8', '10567-6', '10568-4', '10569-2', '1057-9', '10570-0', '10571-8', '10572-6', '10573-4', '10574-2', '10575-9', '10576-7', '10577-5', '10578-3', '10579-1', '1058-7', '10580-9', '10581-7', '10582-5', '10583-3', '10584-1', '10585-8', '10586-6', '10587-4', '10588-2', '10589-0', '1059-5', '10590-8', '10591-6', '10592-4', '10593-2', '10594-0', '10595-7', '10596-5', '10597-3', '10598-1', '10599-9', '106-5', '1060-3', '10600-5', '10601-3', '10602-1', '10603-9', '10604-7', '10605-4', '10606-2', '10607-0', '10608-8', '10609-6', '1061-1', '10610-4', '10611-2', '10612-0', '10613-8', '10614-6', '10615-3', '10616-1', '10617-9', '10618-7', '10619-5', '1062-9', '10620-3', '10621-1', '10622-9', '10623-7', '10624-5', '10625-2', '10626-0', '10627-8', '10628-6', '10629-4', '1063-7', '10630-2', '10631-0', '10632-8', '10633-6', '10634-4', '10635-1', '10636-9', '10637-7', '10638-5', '10639-3', '1064-5', '10640-1', '10641-9', '10642-7', '10643-5', '10644-3', '10645-0', '10646-8', '10647-6', '10648-4', '10649-2', '1065-2', '10650-0', '10651-8', '10652-6', '10653-4', '10654-2', '10655-9', '10656-7', '10657-5', '10658-3', '10659-1', '1066-0', '10660-9', '10661-7', '10662-5', '10663-3', '10664-1', '10665-8', '10666-6', '10667-4', '10668-2', '10669-0', '1067-8', '10670-8', '10671-6', '10672-4', '10673-2', '10674-0', '10675-7', '10676-5', '10677-3', '10678-1', '10679-9', '1068-6', '10680-7', '10681-5', '10682-3', '10683-1', '10684-9', '10685-6', '10686-4', '10687-2', '10688-0', '10689-8', '1069-4', '10690-6', '10691-4', '10692-2', '10693-0', '10694-8', '10695-5', '10696-3', '10697-1', '10698-9', '10699-7', '107-3', '1070-2', '10700-3', '10701-1', '10702-9', '10703-7', '10704-5', '10705-2', '10706-0', '10707-8', '10708-6', '10709-4', '1071-0', '10710-2', '10711-0', '10712-8', '10713-6', '10714-4', '10715-1', '10716-9', '10717-7', '10718-5', '10719-3', '1072-8', '10720-1', '10721-9', '10722-7', '10723-5', '10724-3', '10725-0', '10726-8', '10727-6', '10728-4', '10729-2', '1073-6', '10730-0', '10731-8', '10732-6', '10733-4', '10734-2', '10735-9', '10736-7', '10737-5', '10738-3', '10739-1', '1074-4', '10740-9', '10741-7', '10742-5', '10743-3', '10744-1', '10745-8', '10746-6', '10747-4', '10748-2', '10749-0', '1075-1', '10750-8', '10751-6', '10752-4', '10753-2', '10754-0', '10755-7', '10756-5', '10757-3', '10758-1', '10759-9', '1076-9', '10760-7', '10761-5', '10762-3', '10763-1', '10764-9', '10765-6', '10766-4', '10767-2', '10768-0', '10769-8', '1077-7', '10770-6', '10771-4', '10772-2', '10773-0', '10774-8', '10775-5', '10776-3', '10777-1', '10778-9', '10779-7', '1078-5', '10780-5', '10781-3', '10782-1', '10783-9', '10784-7', '10785-4', '10786-2', '10787-0', '10788-8', '10789-6', '1079-3', '10790-4', '10791-2', '10792-0', '10793-8', '10794-6', '10795-3', '10796-1', '10797-9', '10798-7', '10799-5', '108-1', '1080-1', '10800-1', '10801-9', '10802-7', '10803-5', '10804-3', '10805-0', '10806-8', '10807-6', '10808-4', '10809-2', '1081-9', '10810-0', '10811-8', '10812-6', '10813-4', '10814-2', '10815-9', '10816-7', '10817-5', '10818-3', '10819-1', '1082-7', '10820-9', '10821-7', '10822-5', '10823-3', '10824-1', '10825-8', '10826-6', '10827-4', '10828-2', '10829-0', '1083-5', '10830-8', '10831-6', '10832-4', '10833-2', '10834-0', '10835-7', '10836-5', '10837-3', '10838-1', '10839-9', '1084-3', '10840-7', '10841-5', '10842-3', '10843-1', '10844-9', '10845-6', '10846-4', '10847-2', '10848-0', '10849-8', '1085-0', '10850-6', '10851-4', '10852-2', '10853-0', '10854-8', '10855-5', '10856-3', '10857-1', '10858-9', '10859-7', '1086-8', '10860-5', '10861-3', '10862-1', '10863-9', '10864-7', '10865-4', '10866-2', '10867-0', '10868-8', '10869-6', '1087-6', '10870-4', '10871-2', '10872-0', '10873-8', '10874-6', '10875-3', '10876-1', '10877-9', '10878-7', '10879-5', '1088-4', '10880-3', '10881-1', '10882-9', '10883-7', '10884-5', '10885-2', '10886-0', '10887-8', '10888-6', '10889-4', '1089-2', '10890-2', '10891-0', '10892-8', '10893-6', '10894-4', '10895-1', '10896-9', '10897-7', '10898-5'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @diagnosticreport = reply&.resource&.entry&.first&.resource + @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) + save_delayed_sequence_references(@diagnosticreport_ary) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @diagnosticreport = reply&.resource&.entry&.first&.resource - @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - save_delayed_sequence_references(@diagnosticreport_ary) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end - test 'Server returns expected results from DiagnosticReport search by patient+code' do + test 'Server returns expected results from DiagnosticReport search by patient+category' do metadata do id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -107,8 +109,8 @@ def validate_resource_item(resource, property, value) assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } + category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -215,7 +217,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - search_params = { patient: @instance.patient_id, category: 'LAB' } + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) diff --git a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb index 3d63f6511..2e7afa514 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb @@ -59,15 +59,13 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply end - test 'Server returns expected results from DiagnosticReport search by patient+category' do + test 'Server returns expected results from DiagnosticReport search by patient+code' do metadata do id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -76,25 +74,29 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } + code_val = ['1-8', '10-9', '100-8', '1000-9', '10000-8', '10001-6', '10002-4', '10003-2', '10004-0', '10005-7', '10006-5', '10007-3', '10008-1', '10009-9', '1001-7', '10010-7', '10011-5', '10012-3', '10013-1', '10014-9', '10015-6', '10016-4', '10017-2', '10018-0', '10019-8', '1002-5', '10020-6', '10021-4', '10022-2', '10023-0', '10024-8', '10025-5', '10026-3', '10027-1', '10028-9', '10029-7', '1003-3', '10030-5', '10031-3', '10032-1', '10033-9', '10034-7', '10035-4', '10036-2', '10037-0', '10038-8', '10039-6', '1004-1', '10040-4', '10041-2', '10042-0', '10043-8', '10044-6', '10045-3', '10046-1', '10047-9', '10048-7', '10049-5', '1005-8', '10050-3', '10051-1', '10052-9', '10053-7', '10054-5', '10055-2', '10056-0', '10057-8', '10058-6', '10059-4', '1006-6', '10060-2', '10061-0', '10062-8', '10063-6', '10064-4', '10065-1', '10066-9', '10067-7', '10068-5', '10069-3', '1007-4', '10070-1', '10071-9', '10072-7', '10073-5', '10074-3', '10075-0', '10076-8', '10077-6', '10078-4', '10079-2', '1008-2', '10080-0', '10081-8', '10082-6', '10083-4', '10084-2', '10085-9', '10086-7', '10087-5', '10088-3', '10089-1', '1009-0', '10090-9', '10091-7', '10092-5', '10093-3', '10094-1', '10095-8', '10096-6', '10097-4', '10098-2', '10099-0', '101-6', '1010-8', '10100-6', '10101-4', '10102-2', '10103-0', '10104-8', '10105-5', '10106-3', '10107-1', '10108-9', '10109-7', '1011-6', '10110-5', '10111-3', '10112-1', '10113-9', '10114-7', '10115-4', '10116-2', '10117-0', '10118-8', '10119-6', '1012-4', '10120-4', '10121-2', '10122-0', '10123-8', '10124-6', '10125-3', '10126-1', '10127-9', '10128-7', '10129-5', '1013-2', '10130-3', '10131-1', '10132-9', '10133-7', '10134-5', '10135-2', '10136-0', '10137-8', '10138-6', '10139-4', '1014-0', '10140-2', '10141-0', '10142-8', '10143-6', '10144-4', '10145-1', '10146-9', '10147-7', '10148-5', '10149-3', '1015-7', '10150-1', '10151-9', '10152-7', '10153-5', '10154-3', '10155-0', '10156-8', '10157-6', '10158-4', '10159-2', '1016-5', '10160-0', '10161-8', '10162-6', '10163-4', '10164-2', '10165-9', '10166-7', '10167-5', '10168-3', '10169-1', '1017-3', '10170-9', '10171-7', '10172-5', '10173-3', '10174-1', '10175-8', '10176-6', '10177-4', '10178-2', '10179-0', '1018-1', '10180-8', '10181-6', '10182-4', '10183-2', '10184-0', '10185-7', '10186-5', '10187-3', '10188-1', '10189-9', '1019-9', '10190-7', '10191-5', '10192-3', '10193-1', '10194-9', '10195-6', '10196-4', '10197-2', '10198-0', '10199-8', '102-4', '1020-7', '10200-4', '10201-2', '10202-0', '10203-8', '10204-6', '10205-3', '10206-1', '10207-9', '10208-7', '10209-5', '1021-5', '10210-3', '10211-1', '10212-9', '10213-7', '10214-5', '10215-2', '10216-0', '10217-8', '10218-6', '10219-4', '1022-3', '10220-2', '10221-0', '10222-8', '10223-6', '10224-4', '10225-1', '10226-9', '10227-7', '10228-5', '10229-3', '1023-1', '10230-1', '10231-9', '10232-7', '10233-5', '10234-3', '10235-0', '10236-8', '10237-6', '10238-4', '10239-2', '1024-9', '10240-0', '10241-8', '10242-6', '10243-4', '10244-2', '10245-9', '10246-7', '10247-5', '10248-3', '10249-1', '1025-6', '10250-9', '10251-7', '10252-5', '10253-3', '10254-1', '10255-8', '10256-6', '10257-4', '10258-2', '10259-0', '1026-4', '10260-8', '10261-6', '10262-4', '10263-2', '10264-0', '10265-7', '10266-5', '10267-3', '10268-1', '10269-9', '1027-2', '10270-7', '10271-5', '10272-3', '10273-1', '10274-9', '10275-6', '10276-4', '10277-2', '10278-0', '10279-8', '1028-0', '10280-6', '10281-4', '10282-2', '10283-0', '10284-8', '10285-5', '10286-3', '10287-1', '10288-9', '10289-7', '1029-8', '10290-5', '10291-3', '10292-1', '10293-9', '10294-7', '10295-4', '10296-2', '10297-0', '10298-8', '10299-6', '103-2', '1030-6', '10300-2', '10301-0', '10302-8', '10303-6', '10304-4', '10305-1', '10306-9', '10307-7', '10308-5', '10309-3', '1031-4', '10310-1', '10311-9', '10312-7', '10313-5', '10314-3', '10315-0', '10316-8', '10317-6', '10318-4', '10319-2', '1032-2', '10320-0', '10321-8', '10322-6', '10323-4', '10324-2', '10325-9', '10326-7', '10327-5', '10328-3', '10329-1', '1033-0', '10330-9', '10331-7', '10332-5', '10333-3', '10334-1', '10335-8', '10336-6', '10337-4', '10338-2', '10339-0', '1034-8', '10340-8', '10341-6', '10342-4', '10343-2', '10344-0', '10345-7', '10346-5', '10347-3', '10348-1', '10349-9', '1035-5', '10350-7', '10351-5', '10352-3', '10353-1', '10354-9', '10355-6', '10356-4', '10357-2', '10358-0', '10359-8', '1036-3', '10360-6', '10361-4', '10362-2', '10363-0', '10364-8', '10365-5', '10366-3', '10367-1', '10368-9', '10369-7', '1037-1', '10370-5', '10371-3', '10372-1', '10373-9', '10374-7', '10375-4', '10376-2', '10377-0', '10378-8', '10379-6', '1038-9', '10380-4', '10381-2', '10382-0', '10383-8', '10384-6', '10385-3', '10386-1', '10387-9', '10388-7', '10389-5', '1039-7', '10390-3', '10391-1', '10392-9', '10393-7', '10394-5', '10395-2', '10396-0', '10397-8', '10398-6', '10399-4', '104-0', '1040-5', '10400-0', '10401-8', '10402-6', '10403-4', '10404-2', '10405-9', '10406-7', '10407-5', '10408-3', '10409-1', '1041-3', '10410-9', '10411-7', '10412-5', '10413-3', '10414-1', '10415-8', '10416-6', '10417-4', '10418-2', '10419-0', '1042-1', '10420-8', '10421-6', '10422-4', '10423-2', '10424-0', '10425-7', '10426-5', '10427-3', '10428-1', '10429-9', '1043-9', '10430-7', '10431-5', '10432-3', '10433-1', '10434-9', '10435-6', '10436-4', '10437-2', '10438-0', '10439-8', '1044-7', '10440-6', '10441-4', '10442-2', '10443-0', '10444-8', '10445-5', '10446-3', '10447-1', '10448-9', '10449-7', '1045-4', '10450-5', '10451-3', '10452-1', '10453-9', '10454-7', '10455-4', '10456-2', '10457-0', '10458-8', '10459-6', '1046-2', '10460-4', '10461-2', '10462-0', '10463-8', '10464-6', '10465-3', '10466-1', '10467-9', '10468-7', '10469-5', '1047-0', '10470-3', '10471-1', '10472-9', '10473-7', '10474-5', '10475-2', '10476-0', '10477-8', '10478-6', '10479-4', '1048-8', '10480-2', '10481-0', '10482-8', '10483-6', '10484-4', '10485-1', '10486-9', '10487-7', '10488-5', '10489-3', '1049-6', '10490-1', '10491-9', '10492-7', '10493-5', '10494-3', '10495-0', '10496-8', '10497-6', '10498-4', '10499-2', '105-7', '1050-4', '10500-7', '10501-5', '10502-3', '10503-1', '10504-9', '10505-6', '10506-4', '10507-2', '10508-0', '10509-8', '1051-2', '10510-6', '10511-4', '10512-2', '10513-0', '10514-8', '10515-5', '10516-3', '10517-1', '10518-9', '10519-7', '1052-0', '10520-5', '10521-3', '10522-1', '10523-9', '10524-7', '10525-4', '10526-2', '10527-0', '10528-8', '10529-6', '1053-8', '10530-4', '10531-2', '10532-0', '10533-8', '10534-6', '10535-3', '10536-1', '10537-9', '10538-7', '10539-5', '1054-6', '10540-3', '10541-1', '10542-9', '10543-7', '10544-5', '10545-2', '10546-0', '10547-8', '10548-6', '10549-4', '1055-3', '10550-2', '10551-0', '10552-8', '10553-6', '10554-4', '10555-1', '10556-9', '10557-7', '10558-5', '10559-3', '1056-1', '10560-1', '10561-9', '10562-7', '10563-5', '10564-3', '10565-0', '10566-8', '10567-6', '10568-4', '10569-2', '1057-9', '10570-0', '10571-8', '10572-6', '10573-4', '10574-2', '10575-9', '10576-7', '10577-5', '10578-3', '10579-1', '1058-7', '10580-9', '10581-7', '10582-5', '10583-3', '10584-1', '10585-8', '10586-6', '10587-4', '10588-2', '10589-0', '1059-5', '10590-8', '10591-6', '10592-4', '10593-2', '10594-0', '10595-7', '10596-5', '10597-3', '10598-1', '10599-9', '106-5', '1060-3', '10600-5', '10601-3', '10602-1', '10603-9', '10604-7', '10605-4', '10606-2', '10607-0', '10608-8', '10609-6', '1061-1', '10610-4', '10611-2', '10612-0', '10613-8', '10614-6', '10615-3', '10616-1', '10617-9', '10618-7', '10619-5', '1062-9', '10620-3', '10621-1', '10622-9', '10623-7', '10624-5', '10625-2', '10626-0', '10627-8', '10628-6', '10629-4', '1063-7', '10630-2', '10631-0', '10632-8', '10633-6', '10634-4', '10635-1', '10636-9', '10637-7', '10638-5', '10639-3', '1064-5', '10640-1', '10641-9', '10642-7', '10643-5', '10644-3', '10645-0', '10646-8', '10647-6', '10648-4', '10649-2', '1065-2', '10650-0', '10651-8', '10652-6', '10653-4', '10654-2', '10655-9', '10656-7', '10657-5', '10658-3', '10659-1', '1066-0', '10660-9', '10661-7', '10662-5', '10663-3', '10664-1', '10665-8', '10666-6', '10667-4', '10668-2', '10669-0', '1067-8', '10670-8', '10671-6', '10672-4', '10673-2', '10674-0', '10675-7', '10676-5', '10677-3', '10678-1', '10679-9', '1068-6', '10680-7', '10681-5', '10682-3', '10683-1', '10684-9', '10685-6', '10686-4', '10687-2', '10688-0', '10689-8', '1069-4', '10690-6', '10691-4', '10692-2', '10693-0', '10694-8', '10695-5', '10696-3', '10697-1', '10698-9', '10699-7', '107-3', '1070-2', '10700-3', '10701-1', '10702-9', '10703-7', '10704-5', '10705-2', '10706-0', '10707-8', '10708-6', '10709-4', '1071-0', '10710-2', '10711-0', '10712-8', '10713-6', '10714-4', '10715-1', '10716-9', '10717-7', '10718-5', '10719-3', '1072-8', '10720-1', '10721-9', '10722-7', '10723-5', '10724-3', '10725-0', '10726-8', '10727-6', '10728-4', '10729-2', '1073-6', '10730-0', '10731-8', '10732-6', '10733-4', '10734-2', '10735-9', '10736-7', '10737-5', '10738-3', '10739-1', '1074-4', '10740-9', '10741-7', '10742-5', '10743-3', '10744-1', '10745-8', '10746-6', '10747-4', '10748-2', '10749-0', '1075-1', '10750-8', '10751-6', '10752-4', '10753-2', '10754-0', '10755-7', '10756-5', '10757-3', '10758-1', '10759-9', '1076-9', '10760-7', '10761-5', '10762-3', '10763-1', '10764-9', '10765-6', '10766-4', '10767-2', '10768-0', '10769-8', '1077-7', '10770-6', '10771-4', '10772-2', '10773-0', '10774-8', '10775-5', '10776-3', '10777-1', '10778-9', '10779-7', '1078-5', '10780-5', '10781-3', '10782-1', '10783-9', '10784-7', '10785-4', '10786-2', '10787-0', '10788-8', '10789-6', '1079-3', '10790-4', '10791-2', '10792-0', '10793-8', '10794-6', '10795-3', '10796-1', '10797-9', '10798-7', '10799-5', '108-1', '1080-1', '10800-1', '10801-9', '10802-7', '10803-5', '10804-3', '10805-0', '10806-8', '10807-6', '10808-4', '10809-2', '1081-9', '10810-0', '10811-8', '10812-6', '10813-4', '10814-2', '10815-9', '10816-7', '10817-5', '10818-3', '10819-1', '1082-7', '10820-9', '10821-7', '10822-5', '10823-3', '10824-1', '10825-8', '10826-6', '10827-4', '10828-2', '10829-0', '1083-5', '10830-8', '10831-6', '10832-4', '10833-2', '10834-0', '10835-7', '10836-5', '10837-3', '10838-1', '10839-9', '1084-3', '10840-7', '10841-5', '10842-3', '10843-1', '10844-9', '10845-6', '10846-4', '10847-2', '10848-0', '10849-8', '1085-0', '10850-6', '10851-4', '10852-2', '10853-0', '10854-8', '10855-5', '10856-3', '10857-1', '10858-9', '10859-7', '1086-8', '10860-5', '10861-3', '10862-1', '10863-9', '10864-7', '10865-4', '10866-2', '10867-0', '10868-8', '10869-6', '1087-6', '10870-4', '10871-2', '10872-0', '10873-8', '10874-6', '10875-3', '10876-1', '10877-9', '10878-7', '10879-5', '1088-4', '10880-3', '10881-1', '10882-9', '10883-7', '10884-5', '10885-2', '10886-0', '10887-8', '10888-6', '10889-4', '1089-2', '10890-2', '10891-0', '10892-8', '10893-6', '10894-4', '10895-1', '10896-9', '10897-7', '10898-5'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @diagnosticreport = reply&.resource&.entry&.first&.resource + @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) + save_delayed_sequence_references(@diagnosticreport_ary) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @diagnosticreport = reply&.resource&.entry&.first&.resource - @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - save_delayed_sequence_references(@diagnosticreport_ary) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end - test 'Server returns expected results from DiagnosticReport search by patient+code' do + test 'Server returns expected results from DiagnosticReport search by patient+category' do metadata do id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -107,8 +109,8 @@ def validate_resource_item(resource, property, value) assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } + category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -215,7 +217,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) diff --git a/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb index 1c0770350..c9a0c32a5 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb @@ -67,11 +67,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb index f0eb41009..453adf64b 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb @@ -67,11 +67,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb index 1667e946f..de74ccd43 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb @@ -51,11 +51,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb index e0bd19e43..86a2f528e 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb @@ -51,11 +51,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb index f64ca6946..27f937ffe 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb @@ -80,11 +80,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Location'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb index e1cb81b4a..4430bad48 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb @@ -49,11 +49,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb index 7f05a5d99..9e94225c6 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb @@ -51,11 +51,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb index a20abc14f..a85711aff 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb @@ -59,9 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'laboratory' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -76,22 +74,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, category: 'laboratory' } + category_val = ['social-history', 'vital-signs', 'imaging', 'laboratory', 'procedure', 'survey', 'exam', 'therapy', 'activity'] + category_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'category': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+code' do diff --git a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb index e029cf88b..4be375b1f 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb @@ -68,11 +68,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb index fcccc2ac0..eba84c2a7 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb @@ -74,9 +74,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { '_id': @instance.patient_id } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb index 95350e769..3ecdcf801 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb @@ -69,11 +69,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb index 0e330a23f..bd73d53cb 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb @@ -62,11 +62,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb index 89d882fce..f218b48b5 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb @@ -55,11 +55,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb index bdb466ee0..ed5150c7a 100644 --- a/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb +++ b/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb @@ -59,9 +59,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '72166-2' } - + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply @@ -76,22 +74,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { patient: @instance.patient_id, code: '72166-2' } + code_val = ['1-8', '10-9', '100-8', '1000-9', '10000-8', '10001-6', '10002-4', '10003-2', '10004-0', '10005-7', '10006-5', '10007-3', '10008-1', '10009-9', '1001-7', '10010-7', '10011-5', '10012-3', '10013-1', '10014-9', '10015-6', '10016-4', '10017-2', '10018-0', '10019-8', '1002-5', '10020-6', '10021-4', '10022-2', '10023-0', '10024-8', '10025-5', '10026-3', '10027-1', '10028-9', '10029-7', '1003-3', '10030-5', '10031-3', '10032-1', '10033-9', '10034-7', '10035-4', '10036-2', '10037-0', '10038-8', '10039-6', '1004-1', '10040-4', '10041-2', '10042-0', '10043-8', '10044-6', '10045-3', '10046-1', '10047-9', '10048-7', '10049-5', '1005-8', '10050-3', '10051-1', '10052-9', '10053-7', '10054-5', '10055-2', '10056-0', '10057-8', '10058-6', '10059-4', '1006-6', '10060-2', '10061-0', '10062-8', '10063-6', '10064-4', '10065-1', '10066-9', '10067-7', '10068-5', '10069-3', '1007-4', '10070-1', '10071-9', '10072-7', '10073-5', '10074-3', '10075-0', '10076-8', '10077-6', '10078-4', '10079-2', '1008-2', '10080-0', '10081-8', '10082-6', '10083-4', '10084-2', '10085-9', '10086-7', '10087-5', '10088-3', '10089-1', '1009-0', '10090-9', '10091-7', '10092-5', '10093-3', '10094-1', '10095-8', '10096-6', '10097-4', '10098-2', '10099-0', '101-6', '1010-8', '10100-6', '10101-4', '10102-2', '10103-0', '10104-8', '10105-5', '10106-3', '10107-1', '10108-9', '10109-7', '1011-6', '10110-5', '10111-3', '10112-1', '10113-9', '10114-7', '10115-4', '10116-2', '10117-0', '10118-8', '10119-6', '1012-4', '10120-4', '10121-2', '10122-0', '10123-8', '10124-6', '10125-3', '10126-1', '10127-9', '10128-7', '10129-5', '1013-2', '10130-3', '10131-1', '10132-9', '10133-7', '10134-5', '10135-2', '10136-0', '10137-8', '10138-6', '10139-4', '1014-0', '10140-2', '10141-0', '10142-8', '10143-6', '10144-4', '10145-1', '10146-9', '10147-7', '10148-5', '10149-3', '1015-7', '10150-1', '10151-9', '10152-7', '10153-5', '10154-3', '10155-0', '10156-8', '10157-6', '10158-4', '10159-2', '1016-5', '10160-0', '10161-8', '10162-6', '10163-4', '10164-2', '10165-9', '10166-7', '10167-5', '10168-3', '10169-1', '1017-3', '10170-9', '10171-7', '10172-5', '10173-3', '10174-1', '10175-8', '10176-6', '10177-4', '10178-2', '10179-0', '1018-1', '10180-8', '10181-6', '10182-4', '10183-2', '10184-0', '10185-7', '10186-5', '10187-3', '10188-1', '10189-9', '1019-9', '10190-7', '10191-5', '10192-3', '10193-1', '10194-9', '10195-6', '10196-4', '10197-2', '10198-0', '10199-8', '102-4', '1020-7', '10200-4', '10201-2', '10202-0', '10203-8', '10204-6', '10205-3', '10206-1', '10207-9', '10208-7', '10209-5', '1021-5', '10210-3', '10211-1', '10212-9', '10213-7', '10214-5', '10215-2', '10216-0', '10217-8', '10218-6', '10219-4', '1022-3', '10220-2', '10221-0', '10222-8', '10223-6', '10224-4', '10225-1', '10226-9', '10227-7', '10228-5', '10229-3', '1023-1', '10230-1', '10231-9', '10232-7', '10233-5', '10234-3', '10235-0', '10236-8', '10237-6', '10238-4', '10239-2', '1024-9', '10240-0', '10241-8', '10242-6', '10243-4', '10244-2', '10245-9', '10246-7', '10247-5', '10248-3', '10249-1', '1025-6', '10250-9', '10251-7', '10252-5', '10253-3', '10254-1', '10255-8', '10256-6', '10257-4', '10258-2', '10259-0', '1026-4', '10260-8', '10261-6', '10262-4', '10263-2', '10264-0', '10265-7', '10266-5', '10267-3', '10268-1', '10269-9', '1027-2', '10270-7', '10271-5', '10272-3', '10273-1', '10274-9', '10275-6', '10276-4', '10277-2', '10278-0', '10279-8', '1028-0', '10280-6', '10281-4', '10282-2', '10283-0', '10284-8', '10285-5', '10286-3', '10287-1', '10288-9', '10289-7', '1029-8', '10290-5', '10291-3', '10292-1', '10293-9', '10294-7', '10295-4', '10296-2', '10297-0', '10298-8', '10299-6', '103-2', '1030-6', '10300-2', '10301-0', '10302-8', '10303-6', '10304-4', '10305-1', '10306-9', '10307-7', '10308-5', '10309-3', '1031-4', '10310-1', '10311-9', '10312-7', '10313-5', '10314-3', '10315-0', '10316-8', '10317-6', '10318-4', '10319-2', '1032-2', '10320-0', '10321-8', '10322-6', '10323-4', '10324-2', '10325-9', '10326-7', '10327-5', '10328-3', '10329-1', '1033-0', '10330-9', '10331-7', '10332-5', '10333-3', '10334-1', '10335-8', '10336-6', '10337-4', '10338-2', '10339-0', '1034-8', '10340-8', '10341-6', '10342-4', '10343-2', '10344-0', '10345-7', '10346-5', '10347-3', '10348-1', '10349-9', '1035-5', '10350-7', '10351-5', '10352-3', '10353-1', '10354-9', '10355-6', '10356-4', '10357-2', '10358-0', '10359-8', '1036-3', '10360-6', '10361-4', '10362-2', '10363-0', '10364-8', '10365-5', '10366-3', '10367-1', '10368-9', '10369-7', '1037-1', '10370-5', '10371-3', '10372-1', '10373-9', '10374-7', '10375-4', '10376-2', '10377-0', '10378-8', '10379-6', '1038-9', '10380-4', '10381-2', '10382-0', '10383-8', '10384-6', '10385-3', '10386-1', '10387-9', '10388-7', '10389-5', '1039-7', '10390-3', '10391-1', '10392-9', '10393-7', '10394-5', '10395-2', '10396-0', '10397-8', '10398-6', '10399-4', '104-0', '1040-5', '10400-0', '10401-8', '10402-6', '10403-4', '10404-2', '10405-9', '10406-7', '10407-5', '10408-3', '10409-1', '1041-3', '10410-9', '10411-7', '10412-5', '10413-3', '10414-1', '10415-8', '10416-6', '10417-4', '10418-2', '10419-0', '1042-1', '10420-8', '10421-6', '10422-4', '10423-2', '10424-0', '10425-7', '10426-5', '10427-3', '10428-1', '10429-9', '1043-9', '10430-7', '10431-5', '10432-3', '10433-1', '10434-9', '10435-6', '10436-4', '10437-2', '10438-0', '10439-8', '1044-7', '10440-6', '10441-4', '10442-2', '10443-0', '10444-8', '10445-5', '10446-3', '10447-1', '10448-9', '10449-7', '1045-4', '10450-5', '10451-3', '10452-1', '10453-9', '10454-7', '10455-4', '10456-2', '10457-0', '10458-8', '10459-6', '1046-2', '10460-4', '10461-2', '10462-0', '10463-8', '10464-6', '10465-3', '10466-1', '10467-9', '10468-7', '10469-5', '1047-0', '10470-3', '10471-1', '10472-9', '10473-7', '10474-5', '10475-2', '10476-0', '10477-8', '10478-6', '10479-4', '1048-8', '10480-2', '10481-0', '10482-8', '10483-6', '10484-4', '10485-1', '10486-9', '10487-7', '10488-5', '10489-3', '1049-6', '10490-1', '10491-9', '10492-7', '10493-5', '10494-3', '10495-0', '10496-8', '10497-6', '10498-4', '10499-2', '105-7', '1050-4', '10500-7', '10501-5', '10502-3', '10503-1', '10504-9', '10505-6', '10506-4', '10507-2', '10508-0', '10509-8', '1051-2', '10510-6', '10511-4', '10512-2', '10513-0', '10514-8', '10515-5', '10516-3', '10517-1', '10518-9', '10519-7', '1052-0', '10520-5', '10521-3', '10522-1', '10523-9', '10524-7', '10525-4', '10526-2', '10527-0', '10528-8', '10529-6', '1053-8', '10530-4', '10531-2', '10532-0', '10533-8', '10534-6', '10535-3', '10536-1', '10537-9', '10538-7', '10539-5', '1054-6', '10540-3', '10541-1', '10542-9', '10543-7', '10544-5', '10545-2', '10546-0', '10547-8', '10548-6', '10549-4', '1055-3', '10550-2', '10551-0', '10552-8', '10553-6', '10554-4', '10555-1', '10556-9', '10557-7', '10558-5', '10559-3', '1056-1', '10560-1', '10561-9', '10562-7', '10563-5', '10564-3', '10565-0', '10566-8', '10567-6', '10568-4', '10569-2', '1057-9', '10570-0', '10571-8', '10572-6', '10573-4', '10574-2', '10575-9', '10576-7', '10577-5', '10578-3', '10579-1', '1058-7', '10580-9', '10581-7', '10582-5', '10583-3', '10584-1', '10585-8', '10586-6', '10587-4', '10588-2', '10589-0', '1059-5', '10590-8', '10591-6', '10592-4', '10593-2', '10594-0', '10595-7', '10596-5', '10597-3', '10598-1', '10599-9', '106-5', '1060-3', '10600-5', '10601-3', '10602-1', '10603-9', '10604-7', '10605-4', '10606-2', '10607-0', '10608-8', '10609-6', '1061-1', '10610-4', '10611-2', '10612-0', '10613-8', '10614-6', '10615-3', '10616-1', '10617-9', '10618-7', '10619-5', '1062-9', '10620-3', '10621-1', '10622-9', '10623-7', '10624-5', '10625-2', '10626-0', '10627-8', '10628-6', '10629-4', '1063-7', '10630-2', '10631-0', '10632-8', '10633-6', '10634-4', '10635-1', '10636-9', '10637-7', '10638-5', '10639-3', '1064-5', '10640-1', '10641-9', '10642-7', '10643-5', '10644-3', '10645-0', '10646-8', '10647-6', '10648-4', '10649-2', '1065-2', '10650-0', '10651-8', '10652-6', '10653-4', '10654-2', '10655-9', '10656-7', '10657-5', '10658-3', '10659-1', '1066-0', '10660-9', '10661-7', '10662-5', '10663-3', '10664-1', '10665-8', '10666-6', '10667-4', '10668-2', '10669-0', '1067-8', '10670-8', '10671-6', '10672-4', '10673-2', '10674-0', '10675-7', '10676-5', '10677-3', '10678-1', '10679-9', '1068-6', '10680-7', '10681-5', '10682-3', '10683-1', '10684-9', '10685-6', '10686-4', '10687-2', '10688-0', '10689-8', '1069-4', '10690-6', '10691-4', '10692-2', '10693-0', '10694-8', '10695-5', '10696-3', '10697-1', '10698-9', '10699-7', '107-3', '1070-2', '10700-3', '10701-1', '10702-9', '10703-7', '10704-5', '10705-2', '10706-0', '10707-8', '10708-6', '10709-4', '1071-0', '10710-2', '10711-0', '10712-8', '10713-6', '10714-4', '10715-1', '10716-9', '10717-7', '10718-5', '10719-3', '1072-8', '10720-1', '10721-9', '10722-7', '10723-5', '10724-3', '10725-0', '10726-8', '10727-6', '10728-4', '10729-2', '1073-6', '10730-0', '10731-8', '10732-6', '10733-4', '10734-2', '10735-9', '10736-7', '10737-5', '10738-3', '10739-1', '1074-4', '10740-9', '10741-7', '10742-5', '10743-3', '10744-1', '10745-8', '10746-6', '10747-4', '10748-2', '10749-0', '1075-1', '10750-8', '10751-6', '10752-4', '10753-2', '10754-0', '10755-7', '10756-5', '10757-3', '10758-1', '10759-9', '1076-9', '10760-7', '10761-5', '10762-3', '10763-1', '10764-9', '10765-6', '10766-4', '10767-2', '10768-0', '10769-8', '1077-7', '10770-6', '10771-4', '10772-2', '10773-0', '10774-8', '10775-5', '10776-3', '10777-1', '10778-9', '10779-7', '1078-5', '10780-5', '10781-3', '10782-1', '10783-9', '10784-7', '10785-4', '10786-2', '10787-0', '10788-8', '10789-6', '1079-3', '10790-4', '10791-2', '10792-0', '10793-8', '10794-6', '10795-3', '10796-1', '10797-9', '10798-7', '10799-5', '108-1', '1080-1', '10800-1', '10801-9', '10802-7', '10803-5', '10804-3', '10805-0', '10806-8', '10807-6', '10808-4', '10809-2', '1081-9', '10810-0', '10811-8', '10812-6', '10813-4', '10814-2', '10815-9', '10816-7', '10817-5', '10818-3', '10819-1', '1082-7', '10820-9', '10821-7', '10822-5', '10823-3', '10824-1', '10825-8', '10826-6', '10827-4', '10828-2', '10829-0', '1083-5', '10830-8', '10831-6', '10832-4', '10833-2', '10834-0', '10835-7', '10836-5', '10837-3', '10838-1', '10839-9', '1084-3', '10840-7', '10841-5', '10842-3', '10843-1', '10844-9', '10845-6', '10846-4', '10847-2', '10848-0', '10849-8', '1085-0', '10850-6', '10851-4', '10852-2', '10853-0', '10854-8', '10855-5', '10856-3', '10857-1', '10858-9', '10859-7', '1086-8', '10860-5', '10861-3', '10862-1', '10863-9', '10864-7', '10865-4', '10866-2', '10867-0', '10868-8', '10869-6', '1087-6', '10870-4', '10871-2', '10872-0', '10873-8', '10874-6', '10875-3', '10876-1', '10877-9', '10878-7', '10879-5', '1088-4', '10880-3', '10881-1', '10882-9', '10883-7', '10884-5', '10885-2', '10886-0', '10887-8', '10888-6', '10889-4', '1089-2', '10890-2', '10891-0', '10892-8', '10893-6', '10894-4', '10895-1', '10896-9', '10897-7', '10898-5'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category' do From 202463a17b66eb1f6acbd1c5dde7197ccb23dda6 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 5 Nov 2019 14:05:21 -0500 Subject: [PATCH 056/173] improve TestingInstance#patient_id= test --- test/unit/test_instance_test.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/unit/test_instance_test.rb b/test/unit/test_instance_test.rb index 81543b5ef..e2a0edc6f 100644 --- a/test/unit/test_instance_test.rb +++ b/test/unit/test_instance_test.rb @@ -94,6 +94,10 @@ @instance.patient_id = '123' assert_equal '123', @instance.patient_id + + @instance.patient_id = '456' + + assert_equal '456', @instance.patient_id end end end From 35c5f745937a4576cef4ccb0c86bf9b28bee9578 Mon Sep 17 00:00:00 2001 From: Chase Date: Wed, 6 Nov 2019 16:44:17 -0500 Subject: [PATCH 057/173] address github issues --- generator/uscore/metadata_extractor.rb | 69 ++++++++++++++------------ generator/uscore/uscore_generator.rb | 1 + 2 files changed, 37 insertions(+), 33 deletions(-) diff --git a/generator/uscore/metadata_extractor.rb b/generator/uscore/metadata_extractor.rb index 1fe248c30..7162fe63f 100644 --- a/generator/uscore/metadata_extractor.rb +++ b/generator/uscore/metadata_extractor.rb @@ -212,24 +212,7 @@ def add_search_param_descriptions(profile_definition, sequence) if !profile_element.nil? param_metadata[:type] = profile_element['type'].first['code'] param_metadata[:contains_multiple] = (profile_element['max'] == '*') - if param_metadata[:contains_multiple] - slices = profile_definition['snapshot']['element'].select { |el| el['path'] == path && el['sliceName'] } - slices.each do |slice| - param_metadata[:values] << slice['patternCodeableConcept']['coding'].first['code'] if slice['patternCodeableConcept'] - end - elsif param_metadata[:type] == 'CodeableConcept' - fixed_code_els = profile_definition['snapshot']['element'].select { |el| el['path'] == "#{profile_element['path']}.coding.code" && el['fixedCode'].present? } - param_metadata[:values] += fixed_code_els.map { |el| el['fixedCode'] } if fixed_code_els.any? - end - param_metadata[:values] << profile_element['patternCodeableConcept']['coding'].first['code'] if profile_element['patternCodeableConcept'] - fhir_metadata = FHIR.const_get(sequence[:resource])::METADATA[param.to_s] - valueset_binding = profile_element['binding'] - if valueset_binding - value_set = resources_by_type['ValueSet'].find { |res| res['url'] == valueset_binding['valueSet'] } - codes = value_set['compose']['include'].reject { |code| code['concept'].nil? } if value_set.present? - param_metadata[:values] += codes.map { |code| code['concept'].first['code'] } if codes.present? - end - param_metadata[:values] = fhir_metadata['valid_codes'].values.flatten unless param_metadata[:values].any? || fhir_metadata.nil? || fhir_metadata['valid_codes'].nil? + add_valid_codes(profile_definition, profile_element, FHIR.const_get(sequence[:resource])::METADATA[param.to_s], param_metadata, path) else # search is a variable type eg.) Condition.onsetDateTime - element in profile def is Condition.onset[x] param_metadata[:type] = search_param_definition['type'] @@ -245,6 +228,30 @@ def add_search_param_descriptions(profile_definition, sequence) end end + def add_valid_codes(profile_definition, profile_element, fhir_metadata, param_metadata, path) + if param_metadata[:contains_multiple] + # look for values in slices if param is an array + slices = profile_definition['snapshot']['element'].select { |el| el['path'] == path && el['sliceName'] } + slices.each do |slice| + param_metadata[:values] << slice['patternCodeableConcept']['coding'].first['code'] if slice['patternCodeableConcept'] + end + elsif param_metadata[:type] == 'CodeableConcept' + # look for fixed codes if codeable concept + fixed_code_els = profile_definition['snapshot']['element'].select { |el| el['path'] == "#{profile_element['path']}.coding.code" && el['fixedCode'].present? } + param_metadata[:values] += fixed_code_els.map { |el| el['fixedCode'] } + end + param_metadata[:values] << profile_element['patternCodeableConcept']['coding'].first['code'] if profile_element['patternCodeableConcept'] + # look for values in the valueset the element is bound to + valueset_binding = profile_element['binding'] + if valueset_binding + value_set = resources_by_type['ValueSet'].find { |res| res['url'] == valueset_binding['valueSet'] } + codes = value_set['compose']['include'].reject { |code| code['concept'].nil? } if value_set.present? + param_metadata[:values] += codes.map { |code| code['concept'].first['code'] } if codes.present? + end + # if none found so far, add all the valid codes from metadata (less strict) + param_metadata[:values] = fhir_metadata['valid_codes'].values.flatten unless param_metadata[:values].any? || fhir_metadata.nil? || fhir_metadata['valid_codes'].nil? + end + def add_element_definitions(profile_definition, sequence) profile_definition['snapshot']['element'].each do |element| next if element['type'].nil? # base profile @@ -267,32 +274,28 @@ def add_special_cases(metadata) # search by patient first metadata[:sequences].each do |sequence| - patient_search = sequence[:searches].select { |param| param[:names] == ['patient'] } &.first - unless patient_search.nil? - sequence[:searches].delete(patient_search) - sequence[:searches].unshift(patient_search) - end + set_first_search(sequence, ['patient']) end # search by patient + category first for these specific profiles metadata[:sequences].select { |sequence| category_first_profiles.include?(sequence[:profile]) }.each do |sequence| - category_search = sequence[:searches].select { |param| param[:names] == ['patient', 'category'] } &.first - unless category_search.nil? - sequence[:searches].delete(category_search) - sequence[:searches].unshift(category_search) - end + set_first_search(sequence, ['patient', 'category']) end # search by patient + intent first for medication request sequence medication_request_sequence = metadata[:sequences].find { |sequence| sequence[:resource] == 'MedicationRequest' } - intent_search = medication_request_sequence[:searches].find { |param| param[:names] == ['patient', 'intent'] } - unless intent_search.nil? - medication_request_sequence[:searches].delete(intent_search) - medication_request_sequence[:searches].unshift(intent_search) - end + set_first_search(medication_request_sequence, ['patient', 'intent']) metadata end + + def set_first_search(sequence, params) + search = sequence[:searches].find { |param| param[:names] == params } + return if search.nil? + + sequence[:searches].delete(search) + sequence[:searches].unshift(search) + end end end end diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 1c5dc92b0..c1552ec13 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -378,6 +378,7 @@ def get_first_search(search_parameters, sequence) validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params) ) else + # assume only patient + one other parameter non_patient_search_param = search_parameters.find { |param| param != 'patient' } non_patient_values = sequence[:search_param_descriptions][non_patient_search_param.to_sym][:values] values_variable_name = param_value_name(non_patient_search_param) From 7f82ada8294acc570cf67bc29173f158e64892f6 Mon Sep 17 00:00:00 2001 From: Chase Date: Fri, 8 Nov 2019 09:16:55 -0500 Subject: [PATCH 058/173] add 3.1.0 tests --- .../pediatric_bmi_for_age_sequence.rb | 354 +++++ .../pediatric_weight_for_height_sequence.rb | 354 +++++ .../us_core_allergyintolerance_sequence.rb | 235 ++++ .../us_core_careplan_sequence.rb | 308 +++++ .../us_core_careteam_sequence.rb | 207 +++ .../us_core_condition_sequence.rb | 327 +++++ .../us_core_diagnosticreport_lab_sequence.rb | 370 ++++++ .../us_core_diagnosticreport_note_sequence.rb | 370 ++++++ .../us_core_documentreference_sequence.rb | 405 ++++++ .../us_core_encounter_sequence.rb | 389 ++++++ .../uscore_v3.1.0/us_core_goal_sequence.rb | 273 ++++ .../us_core_immunization_sequence.rb | 275 ++++ .../us_core_implantable_device_sequence.rb | 242 ++++ .../us_core_location_sequence.rb | 324 +++++ .../us_core_medication_sequence.rb | 144 ++ .../us_core_medicationrequest_sequence.rb | 331 +++++ .../us_core_observation_lab_sequence.rb | 344 +++++ .../us_core_organization_sequence.rb | 251 ++++ .../uscore_v3.1.0/us_core_patient_sequence.rb | 397 ++++++ .../us_core_practitioner_sequence.rb | 244 ++++ .../us_core_practitionerrole_sequence.rb | 268 ++++ .../us_core_procedure_sequence.rb | 308 +++++ .../us_core_provenance_sequence.rb | 135 ++ .../us_core_pulse_oximetry_sequence.rb | 476 +++++++ .../us_core_smokingstatus_sequence.rb | 330 +++++ lib/app/modules/uscore_v3.1.0_module.yml | 50 + lib/app/utils/validation.rb | 2 +- resources/uscore_v3.1.0/.index.json | 1156 +++++++++++++++++ .../CapabilityStatement-us-core-client.json | 1 + .../CapabilityStatement-us-core-server.json | 1 + .../CodeSystem-careplan-category.json | 1 + .../uscore_v3.1.0/CodeSystem-cdcrec.json | 1 + .../CodeSystem-condition-category.json | 1 + ...em-us-core-documentreference-category.json | 1 + ...m-us-core-provenance-participant-type.json | 1 + .../uscore_v3.1.0/ConceptMap-ndc-cvx.json | 1 + .../ImplementationGuide-hl7.fhir.us.core.json | 1 + .../OperationDefinition-docref.json | 1 + ...re-allergyintolerance-clinical-status.json | 1 + ...er-us-core-allergyintolerance-patient.json | 1 + ...chParameter-us-core-careplan-category.json | 1 + ...SearchParameter-us-core-careplan-date.json | 1 + ...rchParameter-us-core-careplan-patient.json | 1 + ...archParameter-us-core-careplan-status.json | 1 + ...rchParameter-us-core-careteam-patient.json | 1 + ...archParameter-us-core-careteam-status.json | 1 + ...hParameter-us-core-condition-category.json | 1 + ...ter-us-core-condition-clinical-status.json | 1 + ...earchParameter-us-core-condition-code.json | 1 + ...arameter-us-core-condition-onset-date.json | 1 + ...chParameter-us-core-condition-patient.json | 1 + ...earchParameter-us-core-device-patient.json | 1 + .../SearchParameter-us-core-device-type.json | 1 + ...ter-us-core-diagnosticreport-category.json | 1 + ...rameter-us-core-diagnosticreport-code.json | 1 + ...rameter-us-core-diagnosticreport-date.json | 1 + ...eter-us-core-diagnosticreport-patient.json | 1 + ...meter-us-core-diagnosticreport-status.json | 1 + ...er-us-core-documentreference-category.json | 1 + ...ameter-us-core-documentreference-date.json | 1 + ...arameter-us-core-documentreference-id.json | 1 + ...ter-us-core-documentreference-patient.json | 1 + ...eter-us-core-documentreference-period.json | 1 + ...eter-us-core-documentreference-status.json | 1 + ...ameter-us-core-documentreference-type.json | 1 + ...archParameter-us-core-encounter-class.json | 1 + ...earchParameter-us-core-encounter-date.json | 1 + .../SearchParameter-us-core-encounter-id.json | 1 + ...arameter-us-core-encounter-identifier.json | 1 + ...chParameter-us-core-encounter-patient.json | 1 + ...rchParameter-us-core-encounter-status.json | 1 + ...earchParameter-us-core-encounter-type.json | 1 + .../SearchParameter-us-core-ethnicity.json | 1 + ...rameter-us-core-goal-lifecycle-status.json | 1 + .../SearchParameter-us-core-goal-patient.json | 1 + ...rchParameter-us-core-goal-target-date.json | 1 + ...chParameter-us-core-immunization-date.json | 1 + ...arameter-us-core-immunization-patient.json | 1 + ...Parameter-us-core-immunization-status.json | 1 + ...rameter-us-core-location-address-city.json | 1 + ...r-us-core-location-address-postalcode.json | 1 + ...ameter-us-core-location-address-state.json | 1 + ...rchParameter-us-core-location-address.json | 1 + ...SearchParameter-us-core-location-name.json | 1 + ...-us-core-medicationrequest-authoredon.json | 1 + ...r-us-core-medicationrequest-encounter.json | 1 + ...eter-us-core-medicationrequest-intent.json | 1 + ...ter-us-core-medicationrequest-patient.json | 1 + ...eter-us-core-medicationrequest-status.json | 1 + ...arameter-us-core-observation-category.json | 1 + ...rchParameter-us-core-observation-code.json | 1 + ...rchParameter-us-core-observation-date.json | 1 + ...Parameter-us-core-observation-patient.json | 1 + ...hParameter-us-core-observation-status.json | 1 + ...arameter-us-core-organization-address.json | 1 + ...chParameter-us-core-organization-name.json | 1 + ...chParameter-us-core-patient-birthdate.json | 1 + ...earchParameter-us-core-patient-family.json | 1 + ...earchParameter-us-core-patient-gender.json | 1 + ...SearchParameter-us-core-patient-given.json | 1 + .../SearchParameter-us-core-patient-id.json | 1 + ...hParameter-us-core-patient-identifier.json | 1 + .../SearchParameter-us-core-patient-name.json | 1 + ...meter-us-core-practitioner-identifier.json | 1 + ...chParameter-us-core-practitioner-name.json | 1 + ...us-core-practitionerrole-practitioner.json | 1 + ...er-us-core-practitionerrole-specialty.json | 1 + ...earchParameter-us-core-procedure-code.json | 1 + ...earchParameter-us-core-procedure-date.json | 1 + ...chParameter-us-core-procedure-patient.json | 1 + ...rchParameter-us-core-procedure-status.json | 1 + .../SearchParameter-us-core-race.json | 1 + ...ctureDefinition-pediatric-bmi-for-age.json | 1 + ...efinition-pediatric-weight-for-height.json | 1 + ...Definition-us-core-allergyintolerance.json | 1 + .../StructureDefinition-us-core-birthsex.json | 1 + .../StructureDefinition-us-core-careplan.json | 1 + .../StructureDefinition-us-core-careteam.json | 1 + ...StructureDefinition-us-core-condition.json | 1 + ...finition-us-core-diagnosticreport-lab.json | 1 + ...inition-us-core-diagnosticreport-note.json | 1 + .../StructureDefinition-us-core-direct.json | 1 + ...eDefinition-us-core-documentreference.json | 1 + ...StructureDefinition-us-core-encounter.json | 1 + ...StructureDefinition-us-core-ethnicity.json | 1 + .../StructureDefinition-us-core-goal.json | 1 + ...uctureDefinition-us-core-immunization.json | 1 + ...Definition-us-core-implantable-device.json | 1 + .../StructureDefinition-us-core-location.json | 1 + ...tructureDefinition-us-core-medication.json | 1 + ...eDefinition-us-core-medicationrequest.json | 1 + ...ureDefinition-us-core-observation-lab.json | 1 + ...uctureDefinition-us-core-organization.json | 1 + .../StructureDefinition-us-core-patient.json | 1 + ...uctureDefinition-us-core-practitioner.json | 1 + ...reDefinition-us-core-practitionerrole.json | 1 + ...StructureDefinition-us-core-procedure.json | 1 + ...tructureDefinition-us-core-provenance.json | 1 + ...tureDefinition-us-core-pulse-oximetry.json | 1 + .../StructureDefinition-us-core-race.json | 1 + ...ctureDefinition-us-core-smokingstatus.json | 1 + .../uscore_v3.1.0/ValueSet-birthsex.json | 1 + .../ValueSet-detailed-ethnicity.json | 1 + .../uscore_v3.1.0/ValueSet-detailed-race.json | 1 + .../ValueSet-omb-ethnicity-category.json | 1 + .../ValueSet-omb-race-category.json | 1 + .../ValueSet-simple-language.json | 1 + .../ValueSet-us-core-allergy-substance.json | 1 + ...ueSet-us-core-careteam-provider-roles.json | 1 + .../ValueSet-us-core-clinical-note-type.json | 1 + .../ValueSet-us-core-condition-category.json | 1 + .../ValueSet-us-core-condition-code.json | 1 + ...Set-us-core-diagnosticreport-category.json | 1 + ...et-us-core-diagnosticreport-lab-codes.json | 1 + ...iagnosticreport-report-and-note-codes.json | 1 + ...et-us-core-documentreference-category.json | 1 + ...lueSet-us-core-documentreference-type.json | 1 + .../ValueSet-us-core-encounter-type.json | 1 + .../ValueSet-us-core-medication-codes.json | 1 + .../ValueSet-us-core-narrative-status.json | 1 + .../ValueSet-us-core-ndc-vaccine-codes.json | 1 + ...ore-observation-smoking-status-status.json | 1 + ...Set-us-core-observation-smokingstatus.json | 1 + ...ueSet-us-core-observation-value-codes.json | 1 + .../ValueSet-us-core-procedure-code.json | 1 + .../ValueSet-us-core-procedure-icd10pcs.json | 1 + ...t-us-core-provenance-participant-type.json | 1 + .../ValueSet-us-core-provider-role.json | 1 + .../ValueSet-us-core-provider-specialty.json | 1 + ...core-smoking-status-observation-codes.json | 1 + .../ValueSet-us-core-usps-state.json | 1 + .../ValueSet-us-core-vaccines-cvx.json | 1 + resources/uscore_v3.1.0/ig-r4.json | 1 + 173 files changed, 9013 insertions(+), 1 deletion(-) create mode 100644 lib/app/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_careplan_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_careteam_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_condition_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_encounter_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_goal_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_immunization_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_location_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_medication_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_organization_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_patient_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_procedure_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_provenance_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb create mode 100644 lib/app/modules/uscore_v3.1.0_module.yml create mode 100755 resources/uscore_v3.1.0/.index.json create mode 100755 resources/uscore_v3.1.0/CapabilityStatement-us-core-client.json create mode 100755 resources/uscore_v3.1.0/CapabilityStatement-us-core-server.json create mode 100755 resources/uscore_v3.1.0/CodeSystem-careplan-category.json create mode 100755 resources/uscore_v3.1.0/CodeSystem-cdcrec.json create mode 100755 resources/uscore_v3.1.0/CodeSystem-condition-category.json create mode 100755 resources/uscore_v3.1.0/CodeSystem-us-core-documentreference-category.json create mode 100755 resources/uscore_v3.1.0/CodeSystem-us-core-provenance-participant-type.json create mode 100755 resources/uscore_v3.1.0/ConceptMap-ndc-cvx.json create mode 100755 resources/uscore_v3.1.0/ImplementationGuide-hl7.fhir.us.core.json create mode 100755 resources/uscore_v3.1.0/OperationDefinition-docref.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-allergyintolerance-clinical-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-allergyintolerance-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-careplan-category.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-careplan-date.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-careplan-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-careplan-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-careteam-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-careteam-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-condition-category.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-condition-clinical-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-condition-code.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-condition-onset-date.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-condition-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-device-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-device-type.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-category.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-code.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-date.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-category.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-date.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-id.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-period.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-type.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-encounter-class.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-encounter-date.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-encounter-id.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-encounter-identifier.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-encounter-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-encounter-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-encounter-type.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-ethnicity.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-goal-lifecycle-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-goal-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-goal-target-date.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-immunization-date.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-immunization-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-immunization-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-location-address-city.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-location-address-postalcode.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-location-address-state.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-location-address.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-location-name.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-authoredon.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-encounter.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-intent.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-observation-category.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-observation-code.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-observation-date.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-observation-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-observation-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-organization-address.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-organization-name.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-patient-birthdate.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-patient-family.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-patient-gender.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-patient-given.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-patient-id.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-patient-identifier.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-patient-name.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-practitioner-identifier.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-practitioner-name.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-practitionerrole-practitioner.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-practitionerrole-specialty.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-procedure-code.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-procedure-date.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-procedure-patient.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-procedure-status.json create mode 100755 resources/uscore_v3.1.0/SearchParameter-us-core-race.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-pediatric-bmi-for-age.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-pediatric-weight-for-height.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-allergyintolerance.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-birthsex.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-careplan.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-careteam.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-condition.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-diagnosticreport-lab.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-diagnosticreport-note.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-direct.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-documentreference.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-encounter.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-ethnicity.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-goal.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-immunization.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-implantable-device.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-location.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-medication.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-medicationrequest.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-observation-lab.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-organization.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-patient.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-practitioner.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-practitionerrole.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-procedure.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-provenance.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-pulse-oximetry.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-race.json create mode 100755 resources/uscore_v3.1.0/StructureDefinition-us-core-smokingstatus.json create mode 100755 resources/uscore_v3.1.0/ValueSet-birthsex.json create mode 100755 resources/uscore_v3.1.0/ValueSet-detailed-ethnicity.json create mode 100755 resources/uscore_v3.1.0/ValueSet-detailed-race.json create mode 100755 resources/uscore_v3.1.0/ValueSet-omb-ethnicity-category.json create mode 100755 resources/uscore_v3.1.0/ValueSet-omb-race-category.json create mode 100755 resources/uscore_v3.1.0/ValueSet-simple-language.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-allergy-substance.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-careteam-provider-roles.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-clinical-note-type.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-condition-category.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-condition-code.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-category.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-lab-codes.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-report-and-note-codes.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-documentreference-category.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-documentreference-type.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-encounter-type.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-medication-codes.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-narrative-status.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-ndc-vaccine-codes.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-observation-smoking-status-status.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-observation-smokingstatus.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-observation-value-codes.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-procedure-code.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-procedure-icd10pcs.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-provenance-participant-type.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-provider-role.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-provider-specialty.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-smoking-status-observation-codes.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-usps-state.json create mode 100755 resources/uscore_v3.1.0/ValueSet-us-core-vaccines-cvx.json create mode 100755 resources/uscore_v3.1.0/ig-r4.json diff --git a/lib/app/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb new file mode 100644 index 000000000..a8cdff75f --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb @@ -0,0 +1,354 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310PediatricBmiForAgeSequence < SequenceBase + title 'Pediatric BMI for Age Observation Tests' + + description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPBMIAO' + + requires :token, :patient_id + conformance_supports :Observation + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Observation search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, code: '59576-9' } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Observation search by patient+code' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '59576-9' } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + end + + test 'Server returns expected results from Observation search by patient+category+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Observation search by patient+category' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+code+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Observation search by patient+category+status' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Observation read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '59576-9' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) + end + + test 'At least one of every must support element is provided in any Observation for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Observation.status', + 'Observation.category', + 'Observation.category', + 'Observation.category.coding', + 'Observation.category.coding.system', + 'Observation.category.coding.code', + 'Observation.subject', + 'Observation.effectiveDateTime', + 'Observation.effectivePeriod', + 'Observation.valueQuantity', + 'Observation.valueQuantity.value', + 'Observation.valueQuantity.unit', + 'Observation.valueQuantity.system', + 'Observation.valueQuantity.code', + 'Observation.dataAbsentReason', + 'Observation.component', + 'Observation.component.code', + 'Observation.component.valueQuantity', + 'Observation.component.valueCodeableConcept', + 'Observation.component.valueString', + 'Observation.component.valueBoolean', + 'Observation.component.valueInteger', + 'Observation.component.valueRange', + 'Observation.component.valueRatio', + 'Observation.component.valueSampledData', + 'Observation.component.valueTime', + 'Observation.component.valueDateTime', + 'Observation.component.valuePeriod', + 'Observation.component.dataAbsentReason' + ] + must_support_elements.each do |path| + @observation_ary&.each do |resource| + truncated_path = path.gsub('Observation.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @observation_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@observation) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb new file mode 100644 index 000000000..7d5197e84 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb @@ -0,0 +1,354 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310PediatricWeightForHeightSequence < SequenceBase + title 'Pediatric Weight for Height Observation Tests' + + description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPWHO' + + requires :token, :patient_id + conformance_supports :Observation + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Observation search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, code: '77606-2' } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Observation search by patient+code' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '77606-2' } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + end + + test 'Server returns expected results from Observation search by patient+category+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Observation search by patient+category' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+code+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Observation search by patient+category+status' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Observation read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '77606-2' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) + end + + test 'At least one of every must support element is provided in any Observation for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Observation.status', + 'Observation.category', + 'Observation.category', + 'Observation.category.coding', + 'Observation.category.coding.system', + 'Observation.category.coding.code', + 'Observation.subject', + 'Observation.effectiveDateTime', + 'Observation.effectivePeriod', + 'Observation.valueQuantity', + 'Observation.valueQuantity.value', + 'Observation.valueQuantity.unit', + 'Observation.valueQuantity.system', + 'Observation.valueQuantity.code', + 'Observation.dataAbsentReason', + 'Observation.component', + 'Observation.component.code', + 'Observation.component.valueQuantity', + 'Observation.component.valueCodeableConcept', + 'Observation.component.valueString', + 'Observation.component.valueBoolean', + 'Observation.component.valueInteger', + 'Observation.component.valueRange', + 'Observation.component.valueRatio', + 'Observation.component.valueSampledData', + 'Observation.component.valueTime', + 'Observation.component.valueDateTime', + 'Observation.component.valuePeriod', + 'Observation.component.dataAbsentReason' + ] + must_support_elements.each do |path| + @observation_ary&.each do |resource| + truncated_path = path.gsub('Observation.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @observation_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@observation) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb new file mode 100644 index 000000000..3f42ca35e --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb @@ -0,0 +1,235 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310AllergyintoleranceSequence < SequenceBase + title 'AllergyIntolerance Tests' + + description 'Verify that AllergyIntolerance resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCAI' + + requires :token, :patient_id + conformance_supports :AllergyIntolerance + + def validate_resource_item(resource, property, value) + case property + + when 'clinical-status' + value_found = can_resolve_path(resource, 'clinicalStatus.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'clinical-status on resource does not match clinical-status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects AllergyIntolerance search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from AllergyIntolerance search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @allergyintolerance = reply&.resource&.entry&.first&.resource + @allergyintolerance_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('AllergyIntolerance'), reply) + save_delayed_sequence_references(@allergyintolerance_ary) + validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) + end + + test 'Server returns expected results from AllergyIntolerance search by patient+clinical-status' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@allergyintolerance.nil?, 'Expected valid AllergyIntolerance resource to be present' + + patient_val = @instance.patient_id + clinical_status_val = get_value_for_search_param(resolve_element_from_path(@allergyintolerance_ary, 'clinicalStatus')) + search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) + validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) + assert_response_ok(reply) + end + + test 'AllergyIntolerance read resource supported' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:AllergyIntolerance, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) + end + + test 'AllergyIntolerance vread resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:AllergyIntolerance, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) + end + + test 'AllergyIntolerance history resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:AllergyIntolerance, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '07' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'AllergyIntolerance resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('AllergyIntolerance') + end + + test 'At least one of every must support element is provided in any AllergyIntolerance for this patient.' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @allergyintolerance_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'AllergyIntolerance.clinicalStatus', + 'AllergyIntolerance.verificationStatus', + 'AllergyIntolerance.code', + 'AllergyIntolerance.patient' + ] + must_support_elements.each do |path| + @allergyintolerance_ary&.each do |resource| + truncated_path = path.gsub('AllergyIntolerance.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @allergyintolerance_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided AllergyIntolerance resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:AllergyIntolerance, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@allergyintolerance) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_careplan_sequence.rb new file mode 100644 index 000000000..887f9f2be --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -0,0 +1,308 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310CareplanSequence < SequenceBase + title 'CarePlan Tests' + + description 'Verify that CarePlan resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCCP' + + requires :token, :patient_id + conformance_supports :CarePlan + + def validate_resource_item(resource, property, value) + case property + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'date' + value_found = can_resolve_path(resource, 'period') do |period| + validate_period_search(value, period) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects CarePlan search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, category: 'assess-plan' } + + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from CarePlan search by patient+category' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, category: 'assess-plan' } + + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @careplan = reply&.resource&.entry&.first&.resource + @careplan_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) + save_delayed_sequence_references(@careplan_ary) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) + end + + test 'Server returns expected results from CarePlan search by patient+category+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from CarePlan search by patient+category+status+date' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) + date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from CarePlan search by patient+category+status' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) + assert_response_ok(reply) + end + + test 'CarePlan read resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CarePlan, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@careplan, versioned_resource_class('CarePlan')) + end + + test 'CarePlan vread resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CarePlan, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@careplan, versioned_resource_class('CarePlan')) + end + + test 'CarePlan history resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CarePlan, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@careplan, versioned_resource_class('CarePlan')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '09' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, category: 'assess-plan' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'CarePlan resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '10' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('CarePlan') + end + + test 'At least one of every must support element is provided in any CarePlan for this patient.' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careplan_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'CarePlan.text', + 'CarePlan.text.status', + 'CarePlan.status', + 'CarePlan.intent', + 'CarePlan.category', + 'CarePlan.category', + 'CarePlan.subject' + ] + must_support_elements.each do |path| + @careplan_ary&.each do |resource| + truncated_path = path.gsub('CarePlan.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @careplan_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided CarePlan resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '12' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CarePlan, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@careplan) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_careteam_sequence.rb new file mode 100644 index 000000000..a899d51b5 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_careteam_sequence.rb @@ -0,0 +1,207 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310CareteamSequence < SequenceBase + title 'CareTeam Tests' + + description 'Verify that CareTeam resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCCT' + + requires :token, :patient_id + conformance_supports :CareTeam + + def validate_resource_item(resource, property, value) + case property + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects CareTeam search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, status: 'active' } + + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from CareTeam search by patient+status' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, status: 'active' } + + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @careteam = reply&.resource&.entry&.first&.resource + @careteam_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) + save_delayed_sequence_references(@careteam_ary) + validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) + end + + test 'CareTeam read resource supported' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CareTeam, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@careteam, versioned_resource_class('CareTeam')) + end + + test 'CareTeam vread resource supported' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CareTeam, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@careteam, versioned_resource_class('CareTeam')) + end + + test 'CareTeam history resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CareTeam, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@careteam, versioned_resource_class('CareTeam')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '06' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, status: 'active' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'CareTeam resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '07' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('CareTeam') + end + + test 'At least one of every must support element is provided in any CareTeam for this patient.' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careteam_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'CareTeam.status', + 'CareTeam.subject', + 'CareTeam.participant', + 'CareTeam.participant.role', + 'CareTeam.participant.member' + ] + must_support_elements.each do |path| + @careteam_ary&.each do |resource| + truncated_path = path.gsub('CareTeam.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @careteam_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided CareTeam resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '09' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CareTeam, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@careteam) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_condition_sequence.rb new file mode 100644 index 000000000..e6b988f3c --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_condition_sequence.rb @@ -0,0 +1,327 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310ConditionSequence < SequenceBase + title 'Condition Tests' + + description 'Verify that Condition resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCC' + + requires :token, :patient_id + conformance_supports :Condition + + def validate_resource_item(resource, property, value) + case property + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'clinical-status' + value_found = can_resolve_path(resource, 'clinicalStatus.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'clinical-status on resource does not match clinical-status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'onset-date' + value_found = can_resolve_path(resource, 'onsetDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'onset-date on resource does not match onset-date requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Condition search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Condition search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @condition = reply&.resource&.entry&.first&.resource + @condition_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Condition'), reply) + save_delayed_sequence_references(@condition_ary) + validate_search_reply(versioned_resource_class('Condition'), reply, search_params) + end + + test 'Server returns expected results from Condition search by patient+category' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@condition.nil?, 'Expected valid Condition resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + validate_search_reply(versioned_resource_class('Condition'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Condition search by patient+onset-date' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@condition.nil?, 'Expected valid Condition resource to be present' + + patient_val = @instance.patient_id + onset_date_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'onsetDateTime')) + search_params = { 'patient': patient_val, 'onset-date': onset_date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + validate_search_reply(versioned_resource_class('Condition'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, onset_date_val) + comparator_search_params = { 'patient': patient_val, 'onset-date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Condition'), comparator_search_params) + validate_search_reply(versioned_resource_class('Condition'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Condition search by patient+clinical-status' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@condition.nil?, 'Expected valid Condition resource to be present' + + patient_val = @instance.patient_id + clinical_status_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'clinicalStatus')) + search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + validate_search_reply(versioned_resource_class('Condition'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Condition search by patient+code' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@condition.nil?, 'Expected valid Condition resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'code')) + search_params = { 'patient': patient_val, 'code': code_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + validate_search_reply(versioned_resource_class('Condition'), reply, search_params) + assert_response_ok(reply) + end + + test 'Condition read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Condition, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@condition, versioned_resource_class('Condition')) + end + + test 'Condition vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Condition, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@condition, versioned_resource_class('Condition')) + end + + test 'Condition history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Condition, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@condition, versioned_resource_class('Condition')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Condition resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Condition') + end + + test 'At least one of every must support element is provided in any Condition for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @condition_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Condition.clinicalStatus', + 'Condition.verificationStatus', + 'Condition.category', + 'Condition.code', + 'Condition.subject' + ] + must_support_elements.each do |path| + @condition_ary&.each do |resource| + truncated_path = path.gsub('Condition.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @condition_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Condition resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Condition, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@condition) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb new file mode 100644 index 000000000..139a0957e --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -0,0 +1,370 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310DiagnosticreportLabSequence < SequenceBase + title 'DiagnosticReport for Laboratory Results Reporting Tests' + + description 'Verify that DiagnosticReport resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCDRLRR' + + requires :token, :patient_id + conformance_supports :DiagnosticReport + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects DiagnosticReport search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, category: 'LAB' } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from DiagnosticReport search by patient+category' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, category: 'LAB' } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @diagnosticreport = reply&.resource&.entry&.first&.resource + @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) + save_delayed_sequence_references(@diagnosticreport_ary) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + end + + test 'Server returns expected results from DiagnosticReport search by patient' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+code' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) + search_params = { 'patient': patient_val, 'code': code_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+category+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from DiagnosticReport search by patient+status' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+code+date' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'DiagnosticReport create resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:create]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport read resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport vread resource supported' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport history resource supported' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '12' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, category: 'LAB' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '13' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('DiagnosticReport', Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) + end + + test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do + metadata do + id '14' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'DiagnosticReport.status', + 'DiagnosticReport.category', + 'DiagnosticReport.category', + 'DiagnosticReport.code', + 'DiagnosticReport.subject', + 'DiagnosticReport.effectiveDateTime', + 'DiagnosticReport.effectivePeriod', + 'DiagnosticReport.issued', + 'DiagnosticReport.performer', + 'DiagnosticReport.result' + ] + must_support_elements.each do |path| + @diagnosticreport_ary&.each do |resource| + truncated_path = path.gsub('DiagnosticReport.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @diagnosticreport_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '15' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@diagnosticreport) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb new file mode 100644 index 000000000..110b983c4 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -0,0 +1,370 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310DiagnosticreportNoteSequence < SequenceBase + title 'DiagnosticReport for Report and Note exchange Tests' + + description 'Verify that DiagnosticReport resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCDRRN' + + requires :token, :patient_id + conformance_supports :DiagnosticReport + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects DiagnosticReport search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, code: 'LP29684-5' } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from DiagnosticReport search by patient+category' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: 'LP29684-5' } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @diagnosticreport = reply&.resource&.entry&.first&.resource + @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) + save_delayed_sequence_references(@diagnosticreport_ary) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + end + + test 'Server returns expected results from DiagnosticReport search by patient' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+code' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) + search_params = { 'patient': patient_val, 'code': code_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+category+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from DiagnosticReport search by patient+status' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+code+date' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'DiagnosticReport create resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:create]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport read resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport vread resource supported' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport history resource supported' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '12' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: 'LP29684-5' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '13' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('DiagnosticReport', Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) + end + + test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do + metadata do + id '14' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'DiagnosticReport.status', + 'DiagnosticReport.category', + 'DiagnosticReport.code', + 'DiagnosticReport.subject', + 'DiagnosticReport.encounter', + 'DiagnosticReport.effectiveDateTime', + 'DiagnosticReport.effectivePeriod', + 'DiagnosticReport.issued', + 'DiagnosticReport.performer', + 'DiagnosticReport.presentedForm' + ] + must_support_elements.each do |path| + @diagnosticreport_ary&.each do |resource| + truncated_path = path.gsub('DiagnosticReport.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @diagnosticreport_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '15' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@diagnosticreport) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb new file mode 100644 index 000000000..87fe74253 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb @@ -0,0 +1,405 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310DocumentreferenceSequence < SequenceBase + title 'DocumentReference Tests' + + description 'Verify that DocumentReference resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCDR' + + requires :token, :patient_id + conformance_supports :DocumentReference + + def validate_resource_item(resource, property, value) + case property + + when '_id' + value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } + assert value_found, '_id on resource does not match _id requested' + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'type' + value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'type on resource does not match type requested' + + when 'date' + value_found = can_resolve_path(resource, 'date') { |value_in_resource| value_in_resource == value } + assert value_found, 'date on resource does not match date requested' + + when 'period' + value_found = can_resolve_path(resource, 'context.period') do |period| + validate_period_search(value, period) + end + assert value_found, 'period on resource does not match period requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects DocumentReference search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from DocumentReference search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @documentreference = reply&.resource&.entry&.first&.resource + @documentreference_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('DocumentReference'), reply) + save_delayed_sequence_references(@documentreference_ary) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + end + + test 'Server returns expected results from DocumentReference search by _id' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + id_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'id')) + search_params = { '_id': id_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DocumentReference search by patient+type' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + patient_val = @instance.patient_id + type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) + search_params = { 'patient': patient_val, 'type': type_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DocumentReference search by patient+category+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'date')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DocumentReference search by patient+category' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DocumentReference search by patient+type+period' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + patient_val = @instance.patient_id + type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) + period_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'context.period')) + search_params = { 'patient': patient_val, 'type': type_val, 'period': period_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, period_val) + comparator_search_params = { 'patient': patient_val, 'type': type_val, 'period': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), comparator_search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from DocumentReference search by patient+status' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + end + + test 'DocumentReference create resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DocumentReference, [:create]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_create_reply(@documentreference, versioned_resource_class('DocumentReference')) + end + + test 'DocumentReference read resource supported' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DocumentReference, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@documentreference, versioned_resource_class('DocumentReference')) + end + + test 'DocumentReference vread resource supported' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DocumentReference, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@documentreference, versioned_resource_class('DocumentReference')) + end + + test 'DocumentReference history resource supported' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DocumentReference, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@documentreference, versioned_resource_class('DocumentReference')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'DocumentReference resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '14' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('DocumentReference') + end + + test 'At least one of every must support element is provided in any DocumentReference for this patient.' do + metadata do + id '15' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @documentreference_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'DocumentReference.identifier', + 'DocumentReference.status', + 'DocumentReference.type', + 'DocumentReference.category', + 'DocumentReference.subject', + 'DocumentReference.date', + 'DocumentReference.author', + 'DocumentReference.custodian', + 'DocumentReference.content', + 'DocumentReference.content.attachment', + 'DocumentReference.content.attachment.contentType', + 'DocumentReference.content.attachment.data', + 'DocumentReference.content.attachment.url', + 'DocumentReference.content.format', + 'DocumentReference.context', + 'DocumentReference.context.encounter', + 'DocumentReference.context.period' + ] + must_support_elements.each do |path| + @documentreference_ary&.each do |resource| + truncated_path = path.gsub('DocumentReference.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @documentreference_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided DocumentReference resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '16' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DocumentReference, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@documentreference) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_encounter_sequence.rb new file mode 100644 index 000000000..0739c61c2 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_encounter_sequence.rb @@ -0,0 +1,389 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310EncounterSequence < SequenceBase + title 'Encounter Tests' + + description 'Verify that Encounter resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCE' + + requires :token, :patient_id + conformance_supports :Encounter + + def validate_resource_item(resource, property, value) + case property + + when '_id' + value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } + assert value_found, '_id on resource does not match _id requested' + + when 'class' + value_found = can_resolve_path(resource, 'local_class.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'class on resource does not match class requested' + + when 'date' + value_found = can_resolve_path(resource, 'period') do |period| + validate_period_search(value, period) + end + assert value_found, 'date on resource does not match date requested' + + when 'identifier' + value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } + assert value_found, 'identifier on resource does not match identifier requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'type' + value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'type on resource does not match type requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Encounter search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Encounter search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @encounter = reply&.resource&.entry&.first&.resource + @encounter_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Encounter'), reply) + save_delayed_sequence_references(@encounter_ary) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + end + + test 'Server returns expected results from Encounter search by _id' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + id_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'id')) + search_params = { '_id': id_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Encounter search by date+patient' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + date_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'period')) + patient_val = @instance.patient_id + search_params = { 'date': date_val, 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'date': comparator_val, 'patient': patient_val } + reply = get_resource_by_params(versioned_resource_class('Encounter'), comparator_search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Encounter search by identifier' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + identifier_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'identifier')) + search_params = { 'identifier': identifier_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Encounter search by patient+status' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Encounter search by class+patient' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + class_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'local_class')) + patient_val = @instance.patient_id + search_params = { 'class': class_val, 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Encounter search by patient+type' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + patient_val = @instance.patient_id + type_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'type')) + search_params = { 'patient': patient_val, 'type': type_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + end + + test 'Encounter read resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Encounter, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@encounter, versioned_resource_class('Encounter')) + end + + test 'Encounter vread resource supported' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Encounter, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@encounter, versioned_resource_class('Encounter')) + end + + test 'Encounter history resource supported' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Encounter, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@encounter, versioned_resource_class('Encounter')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '12' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Encounter resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '13' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Encounter') + end + + test 'At least one of every must support element is provided in any Encounter for this patient.' do + metadata do + id '14' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @encounter_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Encounter.identifier', + 'Encounter.identifier.system', + 'Encounter.identifier.value', + 'Encounter.status', + 'Encounter.local_class', + 'Encounter.type', + 'Encounter.subject', + 'Encounter.participant', + 'Encounter.participant.type', + 'Encounter.participant.period', + 'Encounter.participant.individual', + 'Encounter.period', + 'Encounter.reasonCode', + 'Encounter.hospitalization', + 'Encounter.hospitalization.dischargeDisposition', + 'Encounter.location', + 'Encounter.location.location' + ] + must_support_elements.each do |path| + @encounter_ary&.each do |resource| + truncated_path = path.gsub('Encounter.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @encounter_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Encounter resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '15' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Encounter, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@encounter) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_goal_sequence.rb new file mode 100644 index 000000000..9dfb6aed3 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_goal_sequence.rb @@ -0,0 +1,273 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310GoalSequence < SequenceBase + title 'Goal Tests' + + description 'Verify that Goal resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCG' + + requires :token, :patient_id + conformance_supports :Goal + + def validate_resource_item(resource, property, value) + case property + + when 'lifecycle-status' + value_found = can_resolve_path(resource, 'lifecycleStatus') { |value_in_resource| value_in_resource == value } + assert value_found, 'lifecycle-status on resource does not match lifecycle-status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'target-date' + value_found = can_resolve_path(resource, 'target.dueDate') do |date| + validate_date_search(value, date) + end + assert value_found, 'target-date on resource does not match target-date requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Goal search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Goal search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @goal = reply&.resource&.entry&.first&.resource + @goal_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Goal'), reply) + save_delayed_sequence_references(@goal_ary) + validate_search_reply(versioned_resource_class('Goal'), reply, search_params) + end + + test 'Server returns expected results from Goal search by patient+target-date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@goal.nil?, 'Expected valid Goal resource to be present' + + patient_val = @instance.patient_id + target_date_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'target.dueDate')) + search_params = { 'patient': patient_val, 'target-date': target_date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) + validate_search_reply(versioned_resource_class('Goal'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, target_date_val) + comparator_search_params = { 'patient': patient_val, 'target-date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Goal'), comparator_search_params) + validate_search_reply(versioned_resource_class('Goal'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Goal search by patient+lifecycle-status' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@goal.nil?, 'Expected valid Goal resource to be present' + + patient_val = @instance.patient_id + lifecycle_status_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'lifecycleStatus')) + search_params = { 'patient': patient_val, 'lifecycle-status': lifecycle_status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) + validate_search_reply(versioned_resource_class('Goal'), reply, search_params) + assert_response_ok(reply) + end + + test 'Goal read resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Goal, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@goal, versioned_resource_class('Goal')) + end + + test 'Goal vread resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Goal, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@goal, versioned_resource_class('Goal')) + end + + test 'Goal history resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Goal, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@goal, versioned_resource_class('Goal')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '08' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Goal resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '09' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Goal') + end + + test 'At least one of every must support element is provided in any Goal for this patient.' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @goal_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Goal.lifecycleStatus', + 'Goal.description', + 'Goal.subject', + 'Goal.target', + 'Goal.target.dueDate' + ] + must_support_elements.each do |path| + @goal_ary&.each do |resource| + truncated_path = path.gsub('Goal.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @goal_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Goal resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '11' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Goal, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@goal) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_immunization_sequence.rb new file mode 100644 index 000000000..747ee8baa --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_immunization_sequence.rb @@ -0,0 +1,275 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310ImmunizationSequence < SequenceBase + title 'Immunization Tests' + + description 'Verify that Immunization resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCI' + + requires :token, :patient_id + conformance_supports :Immunization + + def validate_resource_item(resource, property, value) + case property + + when 'patient' + value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'date' + value_found = can_resolve_path(resource, 'occurrenceDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Immunization search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Immunization search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @immunization = reply&.resource&.entry&.first&.resource + @immunization_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Immunization'), reply) + save_delayed_sequence_references(@immunization_ary) + validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) + end + + test 'Server returns expected results from Immunization search by patient+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@immunization.nil?, 'Expected valid Immunization resource to be present' + + patient_val = @instance.patient_id + date_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'occurrenceDateTime')) + search_params = { 'patient': patient_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) + validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Immunization'), comparator_search_params) + validate_search_reply(versioned_resource_class('Immunization'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Immunization search by patient+status' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@immunization.nil?, 'Expected valid Immunization resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) + validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) + assert_response_ok(reply) + end + + test 'Immunization read resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Immunization, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@immunization, versioned_resource_class('Immunization')) + end + + test 'Immunization vread resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Immunization, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@immunization, versioned_resource_class('Immunization')) + end + + test 'Immunization history resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Immunization, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@immunization, versioned_resource_class('Immunization')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '08' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Immunization resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '09' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Immunization') + end + + test 'At least one of every must support element is provided in any Immunization for this patient.' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @immunization_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Immunization.status', + 'Immunization.statusReason', + 'Immunization.vaccineCode', + 'Immunization.patient', + 'Immunization.occurrenceDateTime', + 'Immunization.occurrenceString', + 'Immunization.primarySource' + ] + must_support_elements.each do |path| + @immunization_ary&.each do |resource| + truncated_path = path.gsub('Immunization.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @immunization_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Immunization resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '11' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Immunization, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@immunization) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb new file mode 100644 index 000000000..596de3b6d --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb @@ -0,0 +1,242 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310ImplantableDeviceSequence < SequenceBase + title 'Implantable Device Tests' + + description 'Verify that Device resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCID' + + requires :token, :patient_id + conformance_supports :Device + + def validate_resource_item(resource, property, value) + case property + + when 'patient' + value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'type' + value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'type on resource does not match type requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Device search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Device'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Device search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Device'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @device = reply&.resource&.entry&.first&.resource + @device_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Device'), reply) + save_delayed_sequence_references(@device_ary) + validate_search_reply(versioned_resource_class('Device'), reply, search_params) + end + + test 'Server returns expected results from Device search by patient+type' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@device.nil?, 'Expected valid Device resource to be present' + + patient_val = @instance.patient_id + type_val = get_value_for_search_param(resolve_element_from_path(@device_ary, 'type')) + search_params = { 'patient': patient_val, 'type': type_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Device'), search_params) + validate_search_reply(versioned_resource_class('Device'), reply, search_params) + assert_response_ok(reply) + end + + test 'Device read resource supported' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Device, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@device, versioned_resource_class('Device')) + end + + test 'Device vread resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Device, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@device, versioned_resource_class('Device')) + end + + test 'Device history resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Device, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@device, versioned_resource_class('Device')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '07' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Device'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Device resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Device') + end + + test 'At least one of every must support element is provided in any Device for this patient.' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @device_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Device.udiCarrier', + 'Device.udiCarrier.deviceIdentifier', + 'Device.udiCarrier.carrierAIDC', + 'Device.udiCarrier.carrierHRF', + 'Device.distinctIdentifier', + 'Device.manufactureDate', + 'Device.expirationDate', + 'Device.lotNumber', + 'Device.serialNumber', + 'Device.type', + 'Device.patient' + ] + must_support_elements.each do |path| + @device_ary&.each do |resource| + truncated_path = path.gsub('Device.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @device_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Device resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Device, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@device) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_location_sequence.rb new file mode 100644 index 000000000..abbf0113c --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_location_sequence.rb @@ -0,0 +1,324 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310LocationSequence < SequenceBase + title 'Location Tests' + + description 'Verify that Location resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCL' + + requires :token + conformance_supports :Location + delayed_sequence + + def validate_resource_item(resource, property, value) + case property + + when 'name' + value_found = can_resolve_path(resource, 'name') { |value_in_resource| value_in_resource == value } + assert value_found, 'name on resource does not match name requested' + + when 'address' + value_found = can_resolve_path(resource, 'address') do |address| + address&.text&.start_with?(value) || + address&.city&.start_with?(value) || + address&.state&.start_with?(value) || + address&.postalCode&.start_with?(value) || + address&.country&.start_with?(value) + end + assert value_found, 'address on resource does not match address requested' + + when 'address-city' + value_found = can_resolve_path(resource, 'address.city') { |value_in_resource| value_in_resource == value } + assert value_found, 'address-city on resource does not match address-city requested' + + when 'address-state' + value_found = can_resolve_path(resource, 'address.state') { |value_in_resource| value_in_resource == value } + assert value_found, 'address-state on resource does not match address-state requested' + + when 'address-postalcode' + value_found = can_resolve_path(resource, 'address.postalCode') { |value_in_resource| value_in_resource == value } + assert value_found, 'address-postalcode on resource does not match address-postalcode requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Can read Location from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + location_id = @instance.resource_references.find { |reference| reference.resource_type == 'Location' }&.resource_id + skip 'No Location references found from the prior searches' if location_id.nil? + @location = fetch_resource('Location', location_id) + @location_ary = Array.wrap(@location) + @resources_found = !@location.nil? + end + + test 'Server rejects Location search without authorization' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Location search by name' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @location = reply&.resource&.entry&.first&.resource + @location_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Location'), reply) + save_delayed_sequence_references(@location_ary) + validate_search_reply(versioned_resource_class('Location'), reply, search_params) + end + + test 'Server returns expected results from Location search by address' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@location.nil?, 'Expected valid Location resource to be present' + + address_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address')) + search_params = { 'address': address_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + validate_search_reply(versioned_resource_class('Location'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Location search by address-city' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@location.nil?, 'Expected valid Location resource to be present' + + address_city_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.city')) + search_params = { 'address-city': address_city_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + validate_search_reply(versioned_resource_class('Location'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Location search by address-state' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@location.nil?, 'Expected valid Location resource to be present' + + address_state_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.state')) + search_params = { 'address-state': address_state_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + validate_search_reply(versioned_resource_class('Location'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Location search by address-postalcode' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@location.nil?, 'Expected valid Location resource to be present' + + address_postalcode_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.postalCode')) + search_params = { 'address-postalcode': address_postalcode_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + validate_search_reply(versioned_resource_class('Location'), reply, search_params) + assert_response_ok(reply) + end + + test 'Location vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Location, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@location, versioned_resource_class('Location')) + end + + test 'Location history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Location, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@location, versioned_resource_class('Location')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Location resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-location' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Location') + end + + test 'At least one of every must support element is provided in any Location for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @location_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Location.status', + 'Location.name', + 'Location.telecom', + 'Location.address', + 'Location.address.line', + 'Location.address.city', + 'Location.address.state', + 'Location.address.postalCode', + 'Location.managingOrganization' + ] + must_support_elements.each do |path| + @location_ary&.each do |resource| + truncated_path = path.gsub('Location.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @location_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Location resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Location, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@location) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_medication_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_medication_sequence.rb new file mode 100644 index 000000000..2e640581e --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_medication_sequence.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310MedicationSequence < SequenceBase + title 'Medication Tests' + + description 'Verify that Medication resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCM' + + requires :token + conformance_supports :Medication + delayed_sequence + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Can read Medication from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + medication_id = @instance.resource_references.find { |reference| reference.resource_type == 'Medication' }&.resource_id + skip 'No Medication references found from the prior searches' if medication_id.nil? + @medication = fetch_resource('Medication', medication_id) + @medication_ary = Array.wrap(@medication) + @resources_found = !@medication.nil? + end + + test 'Medication vread resource supported' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Medication, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@medication, versioned_resource_class('Medication')) + end + + test 'Medication history resource supported' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Medication, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@medication, versioned_resource_class('Medication')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '04' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = {} + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Medication'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Medication resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '05' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Medication') + end + + test 'At least one of every must support element is provided in any Medication for this patient.' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medication_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Medication.code' + ] + must_support_elements.each do |path| + @medication_ary&.each do |resource| + truncated_path = path.gsub('Medication.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @medication_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Medication resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '07' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Medication, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@medication) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb new file mode 100644 index 000000000..0a4962c8d --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb @@ -0,0 +1,331 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310MedicationrequestSequence < SequenceBase + title 'MedicationRequest Tests' + + description 'Verify that MedicationRequest resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCMR' + + requires :token, :patient_id + conformance_supports :MedicationRequest + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'intent' + value_found = can_resolve_path(resource, 'intent') { |value_in_resource| value_in_resource == value } + assert value_found, 'intent on resource does not match intent requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'encounter' + value_found = can_resolve_path(resource, 'encounter.reference') { |value_in_resource| value_in_resource == value } + assert value_found, 'encounter on resource does not match encounter requested' + + when 'authoredon' + value_found = can_resolve_path(resource, 'authoredOn') { |value_in_resource| value_in_resource == value } + assert value_found, 'authoredon on resource does not match authoredon requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects MedicationRequest search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + status_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) + search_params = { 'patient': patient_val, 'intent': intent_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from MedicationRequest search by patient+intent+status' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + status_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) + search_params = { 'patient': patient_val, 'intent': intent_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @medicationrequest = reply&.resource&.entry&.first&.resource + @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) + save_delayed_sequence_references(@medicationrequest_ary) + validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) + end + + test 'Server returns expected results from MedicationRequest search by patient+intent' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' + + patient_val = @instance.patient_id + intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + search_params = { 'patient': patient_val, 'intent': intent_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from MedicationRequest search by patient+intent+encounter' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' + + patient_val = @instance.patient_id + intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + encounter_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'encounter')) + search_params = { 'patient': patient_val, 'intent': intent_val, 'encounter': encounter_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from MedicationRequest search by patient+intent+authoredon' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' + + patient_val = @instance.patient_id + intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + authoredon_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'authoredOn')) + search_params = { 'patient': patient_val, 'intent': intent_val, 'authoredon': authoredon_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) + assert_response_ok(reply) + end + + test 'MedicationRequest read resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationRequest, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) + end + + test 'MedicationRequest vread resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationRequest, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) + end + + test 'MedicationRequest history resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationRequest, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) + end + + test 'Server returns the appropriate resource from the following _includes: MedicationRequest:medication' do + metadata do + id '09' + link 'https://www.hl7.org/fhir/search.html#include' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + status_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) + search_params = { 'patient': patient_val, 'intent': intent_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_include'] = 'MedicationRequest:medication' + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } + assert medication_results, 'No Medication resources were returned from this search' + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + status_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) + search_params = { 'patient': patient_val, 'intent': intent_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('MedicationRequest') + end + + test 'At least one of every must support element is provided in any MedicationRequest for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medicationrequest_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'MedicationRequest.status', + 'MedicationRequest.intent', + 'MedicationRequest.reportedBoolean', + 'MedicationRequest.reportedReference', + 'MedicationRequest.medicationCodeableConcept', + 'MedicationRequest.medicationReference', + 'MedicationRequest.subject', + 'MedicationRequest.encounter', + 'MedicationRequest.authoredOn', + 'MedicationRequest.requester', + 'MedicationRequest.dosageInstruction', + 'MedicationRequest.dosageInstruction.text' + ] + must_support_elements.each do |path| + @medicationrequest_ary&.each do |resource| + truncated_path = path.gsub('MedicationRequest.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @medicationrequest_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided MedicationRequest resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationRequest, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@medicationrequest) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb new file mode 100644 index 000000000..6b91e2832 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb @@ -0,0 +1,344 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310ObservationLabSequence < SequenceBase + title 'Laboratory Result Observation Tests' + + description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCLRO' + + requires :token, :patient_id + conformance_supports :Observation + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Observation search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, category: 'laboratory' } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Observation search by patient+category' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, category: 'laboratory' } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + end + + test 'Server returns expected results from Observation search by patient+code' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + search_params = { 'patient': patient_val, 'code': code_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+category+date' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Observation search by patient+code+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Observation search by patient+category+status' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Observation read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, category: 'laboratory' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) + end + + test 'At least one of every must support element is provided in any Observation for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Observation.status', + 'Observation.category', + 'Observation.category', + 'Observation.code', + 'Observation.subject', + 'Observation.effectiveDateTime', + 'Observation.effectivePeriod', + 'Observation.valueQuantity', + 'Observation.valueCodeableConcept', + 'Observation.valueString', + 'Observation.valueBoolean', + 'Observation.valueInteger', + 'Observation.valueRange', + 'Observation.valueRatio', + 'Observation.valueSampledData', + 'Observation.valueTime', + 'Observation.valueDateTime', + 'Observation.valuePeriod', + 'Observation.dataAbsentReason' + ] + must_support_elements.each do |path| + @observation_ary&.each do |resource| + truncated_path = path.gsub('Observation.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @observation_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@observation) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_organization_sequence.rb new file mode 100644 index 000000000..390c306dc --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_organization_sequence.rb @@ -0,0 +1,251 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310OrganizationSequence < SequenceBase + title 'Organization Tests' + + description 'Verify that Organization resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCO' + + requires :token + conformance_supports :Organization + delayed_sequence + + def validate_resource_item(resource, property, value) + case property + + when 'name' + value_found = can_resolve_path(resource, 'name') { |value_in_resource| value_in_resource == value } + assert value_found, 'name on resource does not match name requested' + + when 'address' + value_found = can_resolve_path(resource, 'address') do |address| + address&.text&.start_with?(value) || + address&.city&.start_with?(value) || + address&.state&.start_with?(value) || + address&.postalCode&.start_with?(value) || + address&.country&.start_with?(value) + end + assert value_found, 'address on resource does not match address requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Can read Organization from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + organization_id = @instance.resource_references.find { |reference| reference.resource_type == 'Organization' }&.resource_id + skip 'No Organization references found from the prior searches' if organization_id.nil? + @organization = fetch_resource('Organization', organization_id) + @organization_ary = Array.wrap(@organization) + @resources_found = !@organization.nil? + end + + test 'Server rejects Organization search without authorization' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Organization search by name' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @organization = reply&.resource&.entry&.first&.resource + @organization_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Organization'), reply) + save_delayed_sequence_references(@organization_ary) + validate_search_reply(versioned_resource_class('Organization'), reply, search_params) + end + + test 'Server returns expected results from Organization search by address' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@organization.nil?, 'Expected valid Organization resource to be present' + + address_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'address')) + search_params = { 'address': address_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) + validate_search_reply(versioned_resource_class('Organization'), reply, search_params) + assert_response_ok(reply) + end + + test 'Organization vread resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Organization, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@organization, versioned_resource_class('Organization')) + end + + test 'Organization history resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Organization, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@organization, versioned_resource_class('Organization')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '07' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Organization resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Organization') + end + + test 'At least one of every must support element is provided in any Organization for this patient.' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @organization_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Organization.identifier', + 'Organization.identifier.system', + 'Organization.identifier.value', + 'Organization.identifier', + 'Organization.identifier', + 'Organization.active', + 'Organization.name', + 'Organization.telecom', + 'Organization.address', + 'Organization.address.line', + 'Organization.address.city', + 'Organization.address.state', + 'Organization.address.postalCode', + 'Organization.address.country' + ] + must_support_elements.each do |path| + @organization_ary&.each do |resource| + truncated_path = path.gsub('Organization.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @organization_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Organization resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Organization, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@organization) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_patient_sequence.rb new file mode 100644 index 000000000..7bd667d90 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_patient_sequence.rb @@ -0,0 +1,397 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310PatientSequence < SequenceBase + title 'Patient Tests' + + description 'Verify that Patient resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCP' + + requires :token, :patient_id + conformance_supports :Patient + + def validate_resource_item(resource, property, value) + case property + + when '_id' + value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } + assert value_found, '_id on resource does not match _id requested' + + when 'birthdate' + value_found = can_resolve_path(resource, 'birthDate') do |date| + validate_date_search(value, date) + end + assert value_found, 'birthdate on resource does not match birthdate requested' + + when 'family' + value_found = can_resolve_path(resource, 'name.family') { |value_in_resource| value_in_resource == value } + assert value_found, 'family on resource does not match family requested' + + when 'gender' + value_found = can_resolve_path(resource, 'gender') { |value_in_resource| value_in_resource == value } + assert value_found, 'gender on resource does not match gender requested' + + when 'given' + value_found = can_resolve_path(resource, 'name.given') { |value_in_resource| value_in_resource == value } + assert value_found, 'given on resource does not match given requested' + + when 'identifier' + value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } + assert value_found, 'identifier on resource does not match identifier requested' + + when 'name' + value = value.downcase + value_found = can_resolve_path(resource, 'name') do |name| + name&.text&.start_with?(value) || + name&.family&.downcase&.include?(value) || + name&.given&.any? { |given| given.downcase.start_with?(value) } || + name&.prefix&.any? { |prefix| prefix.downcase.start_with?(value) } || + name&.suffix&.any? { |suffix| suffix.downcase.start_with?(value) } + end + assert value_found, 'name on resource does not match name requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Patient search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { '_id': @instance.patient_id } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Patient search by _id' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { '_id': @instance.patient_id } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @patient = reply&.resource&.entry&.first&.resource + @patient_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Patient'), reply) + save_delayed_sequence_references(@patient_ary) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + end + + test 'Server returns expected results from Patient search by identifier' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + identifier_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'identifier')) + search_params = { 'identifier': identifier_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Patient search by name' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Patient search by gender+name' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) + name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) + search_params = { 'gender': gender_val, 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Patient search by birthdate+name' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) + name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) + search_params = { 'birthdate': birthdate_val, 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Patient search by birthdate+family' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) + family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) + search_params = { 'birthdate': birthdate_val, 'family': family_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Patient search by family+gender' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) + gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) + search_params = { 'family': family_val, 'gender': gender_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Patient read resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Patient, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@patient, versioned_resource_class('Patient')) + end + + test 'Patient vread resource supported' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Patient, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@patient, versioned_resource_class('Patient')) + end + + test 'Patient history resource supported' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Patient, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@patient, versioned_resource_class('Patient')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '12' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { '_id': @instance.patient_id } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Patient resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '13' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Patient') + end + + test 'At least one of every must support element is provided in any Patient for this patient.' do + metadata do + id '14' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @patient_ary&.any? + must_support_confirmed = {} + extensions_list = { + 'Patient.extension:race': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race', + 'Patient.extension:ethnicity': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity', + 'Patient.extension:birthsex': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex' + } + extensions_list.each do |id, url| + @patient_ary&.each do |resource| + must_support_confirmed[id] = true if resource.extension.any? { |extension| extension.url == url } + break if must_support_confirmed[id] + end + skip_notification = "Could not find #{id} in any of the #{@patient_ary.length} provided Patient resource(s)" + skip skip_notification unless must_support_confirmed[id] + end + + must_support_elements = [ + 'Patient.identifier', + 'Patient.identifier.system', + 'Patient.identifier.value', + 'Patient.name', + 'Patient.name.family', + 'Patient.name.given', + 'Patient.telecom', + 'Patient.telecom.system', + 'Patient.telecom.value', + 'Patient.telecom.use', + 'Patient.gender', + 'Patient.birthDate', + 'Patient.address', + 'Patient.address.line', + 'Patient.address.city', + 'Patient.address.state', + 'Patient.address.postalCode', + 'Patient.address.period', + 'Patient.communication', + 'Patient.communication.language' + ] + must_support_elements.each do |path| + @patient_ary&.each do |resource| + truncated_path = path.gsub('Patient.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @patient_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Patient resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '15' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Patient, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@patient) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb new file mode 100644 index 000000000..bd05b1159 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb @@ -0,0 +1,244 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310PractitionerSequence < SequenceBase + title 'Practitioner Tests' + + description 'Verify that Practitioner resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPR' + + requires :token + conformance_supports :Practitioner + delayed_sequence + + def validate_resource_item(resource, property, value) + case property + + when 'name' + value = value.downcase + value_found = can_resolve_path(resource, 'name') do |name| + name&.text&.start_with?(value) || + name&.family&.downcase&.include?(value) || + name&.given&.any? { |given| given.downcase.start_with?(value) } || + name&.prefix&.any? { |prefix| prefix.downcase.start_with?(value) } || + name&.suffix&.any? { |suffix| suffix.downcase.start_with?(value) } + end + assert value_found, 'name on resource does not match name requested' + + when 'identifier' + value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } + assert value_found, 'identifier on resource does not match identifier requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Can read Practitioner from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + practitioner_id = @instance.resource_references.find { |reference| reference.resource_type == 'Practitioner' }&.resource_id + skip 'No Practitioner references found from the prior searches' if practitioner_id.nil? + @practitioner = fetch_resource('Practitioner', practitioner_id) + @practitioner_ary = Array.wrap(@practitioner) + @resources_found = !@practitioner.nil? + end + + test 'Server rejects Practitioner search without authorization' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Practitioner search by name' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @practitioner = reply&.resource&.entry&.first&.resource + @practitioner_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Practitioner'), reply) + save_delayed_sequence_references(@practitioner_ary) + validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) + end + + test 'Server returns expected results from Practitioner search by identifier' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@practitioner.nil?, 'Expected valid Practitioner resource to be present' + + identifier_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'identifier')) + search_params = { 'identifier': identifier_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) + validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) + assert_response_ok(reply) + end + + test 'Practitioner vread resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Practitioner, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@practitioner, versioned_resource_class('Practitioner')) + end + + test 'Practitioner history resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Practitioner, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@practitioner, versioned_resource_class('Practitioner')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '07' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Practitioner resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Practitioner') + end + + test 'At least one of every must support element is provided in any Practitioner for this patient.' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitioner_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Practitioner.identifier', + 'Practitioner.identifier.system', + 'Practitioner.identifier.value', + 'Practitioner.identifier', + 'Practitioner.name', + 'Practitioner.name.family' + ] + must_support_elements.each do |path| + @practitioner_ary&.each do |resource| + truncated_path = path.gsub('Practitioner.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @practitioner_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Practitioner resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Practitioner, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@practitioner) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb new file mode 100644 index 000000000..90ca053a7 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb @@ -0,0 +1,268 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310PractitionerroleSequence < SequenceBase + title 'PractitionerRole Tests' + + description 'Verify that PractitionerRole resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPRO' + + requires :token + conformance_supports :PractitionerRole + delayed_sequence + + def validate_resource_item(resource, property, value) + case property + + when 'specialty' + value_found = can_resolve_path(resource, 'specialty.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'specialty on resource does not match specialty requested' + + when 'practitioner' + value_found = can_resolve_path(resource, 'practitioner.reference') { |value_in_resource| value_in_resource == value } + assert value_found, 'practitioner on resource does not match practitioner requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Can read PractitionerRole from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + practitionerrole_id = @instance.resource_references.find { |reference| reference.resource_type == 'PractitionerRole' }&.resource_id + skip 'No PractitionerRole references found from the prior searches' if practitionerrole_id.nil? + @practitionerrole = fetch_resource('PractitionerRole', practitionerrole_id) + @practitionerrole_ary = Array.wrap(@practitionerrole) + @resources_found = !@practitionerrole.nil? + end + + test 'Server rejects PractitionerRole search without authorization' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + search_params = { 'specialty': specialty_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from PractitionerRole search by specialty' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + search_params = { 'specialty': specialty_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @practitionerrole = reply&.resource&.entry&.first&.resource + @practitionerrole_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('PractitionerRole'), reply) + save_delayed_sequence_references(@practitionerrole_ary) + validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) + end + + test 'Server returns expected results from PractitionerRole search by practitioner' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@practitionerrole.nil?, 'Expected valid PractitionerRole resource to be present' + + practitioner_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'practitioner')) + search_params = { 'practitioner': practitioner_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) + assert_response_ok(reply) + end + + test 'PractitionerRole vread resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:PractitionerRole, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) + end + + test 'PractitionerRole history resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:PractitionerRole, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) + end + + test 'Server returns the appropriate resource from the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do + metadata do + id '07' + link 'https://www.hl7.org/fhir/search.html#include' + description %( + ) + versions :r4 + end + + specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + search_params = { 'specialty': specialty_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_include'] = 'PractitionerRole:endpoint' + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + endpoint_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Endpoint' } + assert endpoint_results, 'No Endpoint resources were returned from this search' + + search_params['_include'] = 'PractitionerRole:practitioner' + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + practitioner_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Practitioner' } + assert practitioner_results, 'No Practitioner resources were returned from this search' + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '08' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + search_params = { 'specialty': specialty_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '09' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('PractitionerRole') + end + + test 'At least one of every must support element is provided in any PractitionerRole for this patient.' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitionerrole_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'PractitionerRole.practitioner', + 'PractitionerRole.organization', + 'PractitionerRole.code', + 'PractitionerRole.specialty', + 'PractitionerRole.location', + 'PractitionerRole.telecom', + 'PractitionerRole.telecom.system', + 'PractitionerRole.telecom.value', + 'PractitionerRole.endpoint' + ] + must_support_elements.each do |path| + @practitionerrole_ary&.each do |resource| + truncated_path = path.gsub('PractitionerRole.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @practitionerrole_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided PractitionerRole resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '11' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:PractitionerRole, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@practitionerrole) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_procedure_sequence.rb new file mode 100644 index 000000000..b1a2d7c65 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_procedure_sequence.rb @@ -0,0 +1,308 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310ProcedureSequence < SequenceBase + title 'Procedure Tests' + + description 'Verify that Procedure resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPROC' + + requires :token, :patient_id + conformance_supports :Procedure + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'date' + value_found = can_resolve_path(resource, 'occurrenceDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Procedure search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Procedure search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @procedure = reply&.resource&.entry&.first&.resource + @procedure_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Procedure'), reply) + save_delayed_sequence_references(@procedure_ary) + validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) + end + + test 'Server returns expected results from Procedure search by patient+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@procedure.nil?, 'Expected valid Procedure resource to be present' + + patient_val = @instance.patient_id + date_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) + search_params = { 'patient': patient_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Procedure'), comparator_search_params) + validate_search_reply(versioned_resource_class('Procedure'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Procedure search by patient+code+date' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@procedure.nil?, 'Expected valid Procedure resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Procedure'), comparator_search_params) + validate_search_reply(versioned_resource_class('Procedure'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Procedure search by patient+status' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@procedure.nil?, 'Expected valid Procedure resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) + assert_response_ok(reply) + end + + test 'Procedure read resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Procedure, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@procedure, versioned_resource_class('Procedure')) + end + + test 'Procedure vread resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Procedure, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@procedure, versioned_resource_class('Procedure')) + end + + test 'Procedure history resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Procedure, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@procedure, versioned_resource_class('Procedure')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '09' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Procedure resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '10' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Procedure') + end + + test 'At least one of every must support element is provided in any Procedure for this patient.' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @procedure_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Procedure.status', + 'Procedure.code', + 'Procedure.subject', + 'Procedure.performedDateTime', + 'Procedure.performedPeriod' + ] + must_support_elements.each do |path| + @procedure_ary&.each do |resource| + truncated_path = path.gsub('Procedure.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @procedure_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Procedure resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '12' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Procedure, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@procedure) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_provenance_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_provenance_sequence.rb new file mode 100644 index 000000000..eaed5aa37 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_provenance_sequence.rb @@ -0,0 +1,135 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310ProvenanceSequence < SequenceBase + title 'Provenance Tests' + + description 'Verify that Provenance resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPROV' + + requires :token + conformance_supports :Provenance + delayed_sequence + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Can read Provenance from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + provenance_id = @instance.resource_references.find { |reference| reference.resource_type == 'Provenance' }&.resource_id + skip 'No Provenance references found from the prior searches' if provenance_id.nil? + @provenance = fetch_resource('Provenance', provenance_id) + @provenance_ary = Array.wrap(@provenance) + @resources_found = !@provenance.nil? + end + + test 'Provenance vread resource supported' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Provenance, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@provenance, versioned_resource_class('Provenance')) + end + + test 'Provenance history resource supported' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Provenance, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@provenance, versioned_resource_class('Provenance')) + end + + test 'Provenance resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '04' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Provenance') + end + + test 'At least one of every must support element is provided in any Provenance for this patient.' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @provenance_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Provenance.target', + 'Provenance.recorded', + 'Provenance.agent', + 'Provenance.agent.type', + 'Provenance.agent.who', + 'Provenance.agent.onBehalfOf', + 'Provenance.agent', + 'Provenance.agent.type', + 'Provenance.agent', + 'Provenance.agent.type' + ] + must_support_elements.each do |path| + @provenance_ary&.each do |resource| + truncated_path = path.gsub('Provenance.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @provenance_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Provenance resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '06' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Provenance, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@provenance) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb new file mode 100644 index 000000000..432a02a27 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb @@ -0,0 +1,476 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310PulseOximetrySequence < SequenceBase + title 'Pulse Oximetry Tests' + + description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPO' + + requires :token, :patient_id + conformance_supports :Observation + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Observation search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, code: '59408-5' } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Observation search by patient+code' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '59408-5' } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + end + + test 'Server returns expected results from Observation search by patient+category+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Observation search by patient+category' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+code+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Observation search by patient+category+status' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Observation read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '59408-5' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) + end + + test 'At least one of every must support element is provided in any Observation for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Observation.status', + 'Observation.category', + 'Observation.category', + 'Observation.category.coding', + 'Observation.category.coding.system', + 'Observation.category.coding.code', + 'Observation.code', + 'Observation.code.coding', + 'Observation.code.coding', + 'Observation.code.coding.system', + 'Observation.code.coding.code', + 'Observation.subject', + 'Observation.effectiveDateTime', + 'Observation.effectivePeriod', + 'Observation.valueQuantity', + 'Observation.valueQuantity', + 'Observation.valueQuantity.value', + 'Observation.valueQuantity.unit', + 'Observation.valueQuantity.system', + 'Observation.valueQuantity.code', + 'Observation.dataAbsentReason', + 'Observation.component', + 'Observation.component.code', + 'Observation.component.valueQuantity', + 'Observation.component.valueCodeableConcept', + 'Observation.component.valueString', + 'Observation.component.valueBoolean', + 'Observation.component.valueInteger', + 'Observation.component.valueRange', + 'Observation.component.valueRatio', + 'Observation.component.valueSampledData', + 'Observation.component.valueTime', + 'Observation.component.valueDateTime', + 'Observation.component.valuePeriod', + 'Observation.component.dataAbsentReason', + 'Observation.component', + 'Observation.component.code', + 'Observation.component.valueQuantity', + 'Observation.component.valueCodeableConcept', + 'Observation.component.valueString', + 'Observation.component.valueBoolean', + 'Observation.component.valueInteger', + 'Observation.component.valueRange', + 'Observation.component.valueRatio', + 'Observation.component.valueSampledData', + 'Observation.component.valueTime', + 'Observation.component.valueDateTime', + 'Observation.component.valuePeriod', + 'Observation.component.valueQuantity.value', + 'Observation.component.valueCodeableConcept.value', + 'Observation.component.valueString.value', + 'Observation.component.valueBoolean.value', + 'Observation.component.valueInteger.value', + 'Observation.component.valueRange.value', + 'Observation.component.valueRatio.value', + 'Observation.component.valueSampledData.value', + 'Observation.component.valueTime.value', + 'Observation.component.valueDateTime.value', + 'Observation.component.valuePeriod.value', + 'Observation.component.valueQuantity.unit', + 'Observation.component.valueCodeableConcept.unit', + 'Observation.component.valueString.unit', + 'Observation.component.valueBoolean.unit', + 'Observation.component.valueInteger.unit', + 'Observation.component.valueRange.unit', + 'Observation.component.valueRatio.unit', + 'Observation.component.valueSampledData.unit', + 'Observation.component.valueTime.unit', + 'Observation.component.valueDateTime.unit', + 'Observation.component.valuePeriod.unit', + 'Observation.component.valueQuantity.system', + 'Observation.component.valueCodeableConcept.system', + 'Observation.component.valueString.system', + 'Observation.component.valueBoolean.system', + 'Observation.component.valueInteger.system', + 'Observation.component.valueRange.system', + 'Observation.component.valueRatio.system', + 'Observation.component.valueSampledData.system', + 'Observation.component.valueTime.system', + 'Observation.component.valueDateTime.system', + 'Observation.component.valuePeriod.system', + 'Observation.component.valueQuantity.code', + 'Observation.component.valueCodeableConcept.code', + 'Observation.component.valueString.code', + 'Observation.component.valueBoolean.code', + 'Observation.component.valueInteger.code', + 'Observation.component.valueRange.code', + 'Observation.component.valueRatio.code', + 'Observation.component.valueSampledData.code', + 'Observation.component.valueTime.code', + 'Observation.component.valueDateTime.code', + 'Observation.component.valuePeriod.code', + 'Observation.component.dataAbsentReason', + 'Observation.component', + 'Observation.component.code', + 'Observation.component.valueQuantity', + 'Observation.component.valueCodeableConcept', + 'Observation.component.valueString', + 'Observation.component.valueBoolean', + 'Observation.component.valueInteger', + 'Observation.component.valueRange', + 'Observation.component.valueRatio', + 'Observation.component.valueSampledData', + 'Observation.component.valueTime', + 'Observation.component.valueDateTime', + 'Observation.component.valuePeriod', + 'Observation.component.valueQuantity.value', + 'Observation.component.valueCodeableConcept.value', + 'Observation.component.valueString.value', + 'Observation.component.valueBoolean.value', + 'Observation.component.valueInteger.value', + 'Observation.component.valueRange.value', + 'Observation.component.valueRatio.value', + 'Observation.component.valueSampledData.value', + 'Observation.component.valueTime.value', + 'Observation.component.valueDateTime.value', + 'Observation.component.valuePeriod.value', + 'Observation.component.valueQuantity.unit', + 'Observation.component.valueCodeableConcept.unit', + 'Observation.component.valueString.unit', + 'Observation.component.valueBoolean.unit', + 'Observation.component.valueInteger.unit', + 'Observation.component.valueRange.unit', + 'Observation.component.valueRatio.unit', + 'Observation.component.valueSampledData.unit', + 'Observation.component.valueTime.unit', + 'Observation.component.valueDateTime.unit', + 'Observation.component.valuePeriod.unit', + 'Observation.component.valueQuantity.system', + 'Observation.component.valueCodeableConcept.system', + 'Observation.component.valueString.system', + 'Observation.component.valueBoolean.system', + 'Observation.component.valueInteger.system', + 'Observation.component.valueRange.system', + 'Observation.component.valueRatio.system', + 'Observation.component.valueSampledData.system', + 'Observation.component.valueTime.system', + 'Observation.component.valueDateTime.system', + 'Observation.component.valuePeriod.system', + 'Observation.component.valueQuantity.code', + 'Observation.component.valueCodeableConcept.code', + 'Observation.component.valueString.code', + 'Observation.component.valueBoolean.code', + 'Observation.component.valueInteger.code', + 'Observation.component.valueRange.code', + 'Observation.component.valueRatio.code', + 'Observation.component.valueSampledData.code', + 'Observation.component.valueTime.code', + 'Observation.component.valueDateTime.code', + 'Observation.component.valuePeriod.code', + 'Observation.component.dataAbsentReason' + ] + must_support_elements.each do |path| + @observation_ary&.each do |resource| + truncated_path = path.gsub('Observation.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @observation_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@observation) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb new file mode 100644 index 000000000..b4d3c1b99 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb @@ -0,0 +1,330 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore310SmokingstatusSequence < SequenceBase + title 'Smoking Status Observation Tests' + + description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCSSO' + + requires :token, :patient_id + conformance_supports :Observation + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + + ) + + @resources_found = false + + test 'Server rejects Observation search without authorization' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, code: '72166-2' } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Observation search by patient+code' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '72166-2' } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + end + + test 'Server returns expected results from Observation search by patient+category+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Observation search by patient+category' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+code+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Observation search by patient+category+status' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Observation read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, code: '72166-2' } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) + end + + test 'At least one of every must support element is provided in any Observation for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Observation.status', + 'Observation.code', + 'Observation.subject', + 'Observation.issued', + 'Observation.valueCodeableConcept' + ] + must_support_elements.each do |path| + @observation_ary&.each do |resource| + truncated_path = path.gsub('Observation.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @observation_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@observation) + end + end + end +end diff --git a/lib/app/modules/uscore_v3.1.0_module.yml b/lib/app/modules/uscore_v3.1.0_module.yml new file mode 100644 index 000000000..25b2031e9 --- /dev/null +++ b/lib/app/modules/uscore_v3.1.0_module.yml @@ -0,0 +1,50 @@ +name: uscore_v3.1.0 +title: US Core v3.1.0 +description : US Core v3.1.0 +fhir_version: r4 +default_test_set: ad_hoc_testing +test_sets: + ad_hoc_testing: + view: default + tests: + - name: Discovery + sequences: + - UsCoreR4CapabilityStatementSequence + - SMARTDiscoverySequence + run_all: true + - name: Authorization and Authentication + sequences: + - DynamicRegistrationSequence + - ManualRegistrationSequence + - StandaloneLaunchSequence + - EHRLaunchSequence + - name: US Core R4 Patient Based Profiles + run_all: true + sequences: + - USCore310AllergyintoleranceSequence + - USCore310CareplanSequence + - USCore310CareteamSequence + - USCore310ConditionSequence + - USCore310ImplantableDeviceSequence + - USCore310DiagnosticreportNoteSequence + - USCore310DiagnosticreportLabSequence + - USCore310DocumentreferenceSequence + - USCore310EncounterSequence + - USCore310GoalSequence + - USCore310ImmunizationSequence + - USCore310MedicationrequestSequence + - USCore310SmokingstatusSequence + - USCore310PediatricWeightForHeightSequence + - USCore310ObservationLabSequence + - USCore310PediatricBmiForAgeSequence + - USCore310PulseOximetrySequence + - USCore310PatientSequence + - USCore310ProcedureSequence + - R4ProvenanceSequence + - USCoreR4ClinicalNotesSequence + - USCore310LocationSequence + - USCore310MedicationSequence + - USCore310OrganizationSequence + - USCore310PractitionerSequence + - USCore310PractitionerroleSequence + - USCore310ProvenanceSequence diff --git a/lib/app/utils/validation.rb b/lib/app/utils/validation.rb index a1a1053f9..3a1af99ec 100644 --- a/lib/app/utils/validation.rb +++ b/lib/app/utils/validation.rb @@ -19,7 +19,7 @@ def self.get_resource(json, version) RESOURCES = { dstu2: {}, stu3: {}, r4: {} } VALUESETS = {} - VERSION_MAP = { '1.0.2' => :dstu2, '3.0.1' => :stu3, '4.0.0' => :r4 }.freeze + VERSION_MAP = { '1.0.2' => :dstu2, '3.0.1' => :stu3, '4.0.0' => :r4, '4.0.1' => :r4 }.freeze Dir.glob(validation_packs).each do |definition| json = File.read(definition) diff --git a/resources/uscore_v3.1.0/.index.json b/resources/uscore_v3.1.0/.index.json new file mode 100755 index 000000000..8f5780b92 --- /dev/null +++ b/resources/uscore_v3.1.0/.index.json @@ -0,0 +1,1156 @@ +{ + "index-version": 1, + "files": [ + { + "filename": "StructureDefinition-us-core-ethnicity.json", + "resourceType": "StructureDefinition", + "id": "us-core-ethnicity", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity", + "version": "3.1.0", + "kind": "complex-type", + "type": "Extension" + }, + { + "filename": "SearchParameter-us-core-encounter-date.json", + "resourceType": "SearchParameter", + "id": "us-core-encounter-date", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-date", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "SearchParameter-us-core-patient-identifier.json", + "resourceType": "SearchParameter", + "id": "us-core-patient-identifier", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-identifier", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "CodeSystem-condition-category.json", + "resourceType": "CodeSystem", + "id": "condition-category", + "url": "http://hl7.org/fhir/us/core/CodeSystem/condition-category", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-diagnosticreport-status.json", + "resourceType": "SearchParameter", + "id": "us-core-diagnosticreport-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-pediatric-weight-for-height.json", + "resourceType": "StructureDefinition", + "id": "pediatric-weight-for-height", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height", + "version": "3.1.0", + "kind": "resource", + "type": "Observation" + }, + { + "filename": "SearchParameter-us-core-careteam-status.json", + "resourceType": "SearchParameter", + "id": "us-core-careteam-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-encounter-class.json", + "resourceType": "SearchParameter", + "id": "us-core-encounter-class", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-class", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-us-core-practitionerrole.json", + "resourceType": "StructureDefinition", + "id": "us-core-practitionerrole", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole", + "version": "3.1.0", + "kind": "resource", + "type": "PractitionerRole" + }, + { + "filename": "SearchParameter-us-core-careplan-status.json", + "resourceType": "SearchParameter", + "id": "us-core-careplan-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "ValueSet-us-core-documentreference-type.json", + "resourceType": "ValueSet", + "id": "us-core-documentreference-type", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-type", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-condition-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-condition-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "SearchParameter-us-core-encounter-id.json", + "resourceType": "SearchParameter", + "id": "us-core-encounter-id", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-id", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "ValueSet-us-core-condition-code.json", + "resourceType": "ValueSet", + "id": "us-core-condition-code", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-condition-code", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-device-type.json", + "resourceType": "SearchParameter", + "id": "us-core-device-type", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-device-type", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "ig-r4.json", + "resourceType": "ImplementationGuide", + "id": "hl7.fhir.us.core", + "url": "http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core", + "version": "3.1.0" + }, + { + "filename": "ValueSet-us-core-observation-smokingstatus.json", + "resourceType": "ValueSet", + "id": "us-core-observation-smokingstatus", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-observation-smokingstatus", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-encounter-status.json", + "resourceType": "SearchParameter", + "id": "us-core-encounter-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "CodeSystem-us-core-provenance-participant-type.json", + "resourceType": "CodeSystem", + "id": "us-core-provenance-participant-type", + "url": "http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type", + "version": "3.1.0" + }, + { + "filename": "ValueSet-us-core-careteam-provider-roles.json", + "resourceType": "ValueSet", + "id": "us-core-careteam-provider-roles", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-careteam-provider-roles", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-medicationrequest-authoredon.json", + "resourceType": "SearchParameter", + "id": "us-core-medicationrequest-authoredon", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-authoredon", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "StructureDefinition-us-core-diagnosticreport-lab.json", + "resourceType": "StructureDefinition", + "id": "us-core-diagnosticreport-lab", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab", + "version": "3.1.0", + "kind": "resource", + "type": "DiagnosticReport" + }, + { + "filename": "SearchParameter-us-core-careplan-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-careplan-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "StructureDefinition-us-core-allergyintolerance.json", + "resourceType": "StructureDefinition", + "id": "us-core-allergyintolerance", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance", + "version": "3.1.0", + "kind": "resource", + "type": "AllergyIntolerance" + }, + { + "filename": "SearchParameter-us-core-practitionerrole-practitioner.json", + "resourceType": "SearchParameter", + "id": "us-core-practitionerrole-practitioner", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "SearchParameter-us-core-procedure-status.json", + "resourceType": "SearchParameter", + "id": "us-core-procedure-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-documentreference-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-documentreference-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "ValueSet-us-core-provider-role.json", + "resourceType": "ValueSet", + "id": "us-core-provider-role", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-provider-role", + "version": "3.1.0" + }, + { + "filename": "ValueSet-us-core-observation-value-codes.json", + "resourceType": "ValueSet", + "id": "us-core-observation-value-codes", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-observation-value-codes", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-encounter-type.json", + "resourceType": "SearchParameter", + "id": "us-core-encounter-type", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-type", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-organization-address.json", + "resourceType": "SearchParameter", + "id": "us-core-organization-address", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "ValueSet-us-core-documentreference-category.json", + "resourceType": "ValueSet", + "id": "us-core-documentreference-category", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-category", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-patient-birthdate.json", + "resourceType": "SearchParameter", + "id": "us-core-patient-birthdate", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-birthdate", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "StructureDefinition-us-core-race.json", + "resourceType": "StructureDefinition", + "id": "us-core-race", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race", + "version": "3.1.0", + "kind": "complex-type", + "type": "Extension" + }, + { + "filename": "ValueSet-birthsex.json", + "resourceType": "ValueSet", + "id": "birthsex", + "url": "http://hl7.org/fhir/us/core/ValueSet/birthsex", + "version": "3.1.0" + }, + { + "filename": "StructureDefinition-us-core-provenance.json", + "resourceType": "StructureDefinition", + "id": "us-core-provenance", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance", + "version": "3.1.0", + "kind": "resource", + "type": "Provenance" + }, + { + "filename": "SearchParameter-us-core-location-name.json", + "resourceType": "SearchParameter", + "id": "us-core-location-name", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-location-name", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "ValueSet-us-core-narrative-status.json", + "resourceType": "ValueSet", + "id": "us-core-narrative-status", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-narrative-status", + "version": "3.1.0" + }, + { + "filename": "StructureDefinition-us-core-careplan.json", + "resourceType": "StructureDefinition", + "id": "us-core-careplan", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan", + "version": "3.1.0", + "kind": "resource", + "type": "CarePlan" + }, + { + "filename": "SearchParameter-us-core-documentreference-date.json", + "resourceType": "SearchParameter", + "id": "us-core-documentreference-date", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-date", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "SearchParameter-us-core-patient-gender.json", + "resourceType": "SearchParameter", + "id": "us-core-patient-gender", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-gender", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-immunization-date.json", + "resourceType": "SearchParameter", + "id": "us-core-immunization-date", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-date", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "SearchParameter-us-core-diagnosticreport-date.json", + "resourceType": "SearchParameter", + "id": "us-core-diagnosticreport-date", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-date", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "CapabilityStatement-us-core-client.json", + "resourceType": "CapabilityStatement", + "id": "us-core-client", + "url": "http://hl7.org/fhir/us/core/CapabilityStatement/us-core-client", + "version": "3.1.0", + "kind": "requirements" + }, + { + "filename": "SearchParameter-us-core-immunization-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-immunization-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "ValueSet-omb-ethnicity-category.json", + "resourceType": "ValueSet", + "id": "omb-ethnicity-category", + "url": "http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-diagnosticreport-category.json", + "resourceType": "SearchParameter", + "id": "us-core-diagnosticreport-category", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-category", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-us-core-birthsex.json", + "resourceType": "StructureDefinition", + "id": "us-core-birthsex", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", + "version": "3.1.0", + "kind": "complex-type", + "type": "Extension" + }, + { + "filename": "SearchParameter-us-core-encounter-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-encounter-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "SearchParameter-us-core-documentreference-type.json", + "resourceType": "SearchParameter", + "id": "us-core-documentreference-type", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-type", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-race.json", + "resourceType": "SearchParameter", + "id": "us-core-race", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-race", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-us-core-implantable-device.json", + "resourceType": "StructureDefinition", + "id": "us-core-implantable-device", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device", + "version": "3.1.0", + "kind": "resource", + "type": "Device" + }, + { + "filename": "SearchParameter-us-core-location-address-city.json", + "resourceType": "SearchParameter", + "id": "us-core-location-address-city", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-city", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "SearchParameter-us-core-medicationrequest-status.json", + "resourceType": "SearchParameter", + "id": "us-core-medicationrequest-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-us-core-practitioner.json", + "resourceType": "StructureDefinition", + "id": "us-core-practitioner", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner", + "version": "3.1.0", + "kind": "resource", + "type": "Practitioner" + }, + { + "filename": "ImplementationGuide-hl7.fhir.us.core.json", + "resourceType": "ImplementationGuide", + "id": "hl7.fhir.us.core", + "url": "http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-immunization-status.json", + "resourceType": "SearchParameter", + "id": "us-core-immunization-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-us-core-pulse-oximetry.json", + "resourceType": "StructureDefinition", + "id": "us-core-pulse-oximetry", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry", + "version": "3.1.0", + "kind": "resource", + "type": "Observation" + }, + { + "filename": "SearchParameter-us-core-documentreference-category.json", + "resourceType": "SearchParameter", + "id": "us-core-documentreference-category", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-category", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "ValueSet-simple-language.json", + "resourceType": "ValueSet", + "id": "simple-language", + "url": "http://hl7.org/fhir/us/core/ValueSet/simple-language", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-procedure-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-procedure-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "StructureDefinition-us-core-medicationrequest.json", + "resourceType": "StructureDefinition", + "id": "us-core-medicationrequest", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest", + "version": "3.1.0", + "kind": "resource", + "type": "MedicationRequest" + }, + { + "filename": "SearchParameter-us-core-allergyintolerance-clinical-status.json", + "resourceType": "SearchParameter", + "id": "us-core-allergyintolerance-clinical-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-clinical-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-diagnosticreport-code.json", + "resourceType": "SearchParameter", + "id": "us-core-diagnosticreport-code", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-code", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-goal-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-goal-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "CodeSystem-us-core-documentreference-category.json", + "resourceType": "CodeSystem", + "id": "us-core-documentreference-category", + "url": "http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-practitioner-identifier.json", + "resourceType": "SearchParameter", + "id": "us-core-practitioner-identifier", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-identifier", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-pediatric-bmi-for-age.json", + "resourceType": "StructureDefinition", + "id": "pediatric-bmi-for-age", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age", + "version": "3.1.0", + "kind": "resource", + "type": "Observation" + }, + { + "filename": "ValueSet-us-core-condition-category.json", + "resourceType": "ValueSet", + "id": "us-core-condition-category", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-condition-category", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-observation-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-observation-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "SearchParameter-us-core-encounter-identifier.json", + "resourceType": "SearchParameter", + "id": "us-core-encounter-identifier", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-identifier", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-patient-id.json", + "resourceType": "SearchParameter", + "id": "us-core-patient-id", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-id", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-ethnicity.json", + "resourceType": "SearchParameter", + "id": "us-core-ethnicity", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-ethnicity", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-patient-name.json", + "resourceType": "SearchParameter", + "id": "us-core-patient-name", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-name", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "SearchParameter-us-core-medicationrequest-encounter.json", + "resourceType": "SearchParameter", + "id": "us-core-medicationrequest-encounter", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-encounter", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "ValueSet-us-core-encounter-type.json", + "resourceType": "ValueSet", + "id": "us-core-encounter-type", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-encounter-type", + "version": "3.1.0" + }, + { + "filename": "ValueSet-detailed-ethnicity.json", + "resourceType": "ValueSet", + "id": "detailed-ethnicity", + "url": "http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-patient-given.json", + "resourceType": "SearchParameter", + "id": "us-core-patient-given", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-given", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "StructureDefinition-us-core-organization.json", + "resourceType": "StructureDefinition", + "id": "us-core-organization", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization", + "version": "3.1.0", + "kind": "resource", + "type": "Organization" + }, + { + "filename": "ValueSet-us-core-medication-codes.json", + "resourceType": "ValueSet", + "id": "us-core-medication-codes", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-medication-codes", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-documentreference-id.json", + "resourceType": "SearchParameter", + "id": "us-core-documentreference-id", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-id", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-location-address-postalcode.json", + "resourceType": "SearchParameter", + "id": "us-core-location-address-postalcode", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-postalcode", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "StructureDefinition-us-core-careteam.json", + "resourceType": "StructureDefinition", + "id": "us-core-careteam", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam", + "version": "3.1.0", + "kind": "resource", + "type": "CareTeam" + }, + { + "filename": "ValueSet-detailed-race.json", + "resourceType": "ValueSet", + "id": "detailed-race", + "url": "http://hl7.org/fhir/us/core/ValueSet/detailed-race", + "version": "3.1.0" + }, + { + "filename": "ValueSet-us-core-observation-smoking-status-status.json", + "resourceType": "ValueSet", + "id": "us-core-observation-smoking-status-status", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-observation-smoking-status-status", + "version": "3.1.0" + }, + { + "filename": "ValueSet-us-core-smoking-status-observation-codes.json", + "resourceType": "ValueSet", + "id": "us-core-smoking-status-observation-codes", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-smoking-status-observation-codes", + "version": "3.1.0" + }, + { + "filename": "ValueSet-us-core-provider-specialty.json", + "resourceType": "ValueSet", + "id": "us-core-provider-specialty", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-provider-specialty", + "version": "3.1.0" + }, + { + "filename": "StructureDefinition-us-core-encounter.json", + "resourceType": "StructureDefinition", + "id": "us-core-encounter", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter", + "version": "3.1.0", + "kind": "resource", + "type": "Encounter" + }, + { + "filename": "SearchParameter-us-core-observation-code.json", + "resourceType": "SearchParameter", + "id": "us-core-observation-code", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-code", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "ValueSet-us-core-diagnosticreport-category.json", + "resourceType": "ValueSet", + "id": "us-core-diagnosticreport-category", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-category", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-careteam-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-careteam-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "SearchParameter-us-core-procedure-code.json", + "resourceType": "SearchParameter", + "id": "us-core-procedure-code", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-code", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-goal-target-date.json", + "resourceType": "SearchParameter", + "id": "us-core-goal-target-date", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-target-date", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "SearchParameter-us-core-condition-category.json", + "resourceType": "SearchParameter", + "id": "us-core-condition-category", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-category", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-us-core-direct.json", + "resourceType": "StructureDefinition", + "id": "us-core-direct", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-direct", + "version": "3.1.0", + "kind": "complex-type", + "type": "Extension" + }, + { + "filename": "StructureDefinition-us-core-observation-lab.json", + "resourceType": "StructureDefinition", + "id": "us-core-observation-lab", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab", + "version": "3.1.0", + "kind": "resource", + "type": "Observation" + }, + { + "filename": "SearchParameter-us-core-procedure-date.json", + "resourceType": "SearchParameter", + "id": "us-core-procedure-date", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-date", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "ValueSet-us-core-vaccines-cvx.json", + "resourceType": "ValueSet", + "id": "us-core-vaccines-cvx", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-vaccines-cvx", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-location-address-state.json", + "resourceType": "SearchParameter", + "id": "us-core-location-address-state", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-state", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "CodeSystem-careplan-category.json", + "resourceType": "CodeSystem", + "id": "careplan-category", + "url": "http://hl7.org/fhir/us/core/CodeSystem/careplan-category", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-practitionerrole-specialty.json", + "resourceType": "SearchParameter", + "id": "us-core-practitionerrole-specialty", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-us-core-goal.json", + "resourceType": "StructureDefinition", + "id": "us-core-goal", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal", + "version": "3.1.0", + "kind": "resource", + "type": "Goal" + }, + { + "filename": "SearchParameter-us-core-goal-lifecycle-status.json", + "resourceType": "SearchParameter", + "id": "us-core-goal-lifecycle-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-lifecycle-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-us-core-immunization.json", + "resourceType": "StructureDefinition", + "id": "us-core-immunization", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization", + "version": "3.1.0", + "kind": "resource", + "type": "Immunization" + }, + { + "filename": "ValueSet-us-core-ndc-vaccine-codes.json", + "resourceType": "ValueSet", + "id": "us-core-ndc-vaccine-codes", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-ndc-vaccine-codes", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-allergyintolerance-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-allergyintolerance-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "ValueSet-us-core-clinical-note-type.json", + "resourceType": "ValueSet", + "id": "us-core-clinical-note-type", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-clinical-note-type", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-condition-code.json", + "resourceType": "SearchParameter", + "id": "us-core-condition-code", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-code", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "SearchParameter-us-core-documentreference-period.json", + "resourceType": "SearchParameter", + "id": "us-core-documentreference-period", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-period", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "ConceptMap-ndc-cvx.json", + "resourceType": "ConceptMap", + "id": "ndc-cvx", + "url": "http://hl7.org/fhir/us/core/ConceptMap/ndc-cvx", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-careplan-category.json", + "resourceType": "SearchParameter", + "id": "us-core-careplan-category", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-category", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "ValueSet-us-core-procedure-code.json", + "resourceType": "ValueSet", + "id": "us-core-procedure-code", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-procedure-code", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-device-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-device-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-device-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "SearchParameter-us-core-diagnosticreport-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-diagnosticreport-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "SearchParameter-us-core-practitioner-name.json", + "resourceType": "SearchParameter", + "id": "us-core-practitioner-name", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-name", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "StructureDefinition-us-core-patient.json", + "resourceType": "StructureDefinition", + "id": "us-core-patient", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient", + "version": "3.1.0", + "kind": "resource", + "type": "Patient" + }, + { + "filename": "SearchParameter-us-core-medicationrequest-patient.json", + "resourceType": "SearchParameter", + "id": "us-core-medicationrequest-patient", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-patient", + "version": "3.1.0", + "type": "reference" + }, + { + "filename": "SearchParameter-us-core-location-address.json", + "resourceType": "SearchParameter", + "id": "us-core-location-address", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "SearchParameter-us-core-patient-family.json", + "resourceType": "SearchParameter", + "id": "us-core-patient-family", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-family", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "SearchParameter-us-core-careplan-date.json", + "resourceType": "SearchParameter", + "id": "us-core-careplan-date", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-date", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "StructureDefinition-us-core-condition.json", + "resourceType": "StructureDefinition", + "id": "us-core-condition", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition", + "version": "3.1.0", + "kind": "resource", + "type": "Condition" + }, + { + "filename": "SearchParameter-us-core-observation-date.json", + "resourceType": "SearchParameter", + "id": "us-core-observation-date", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-date", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "StructureDefinition-us-core-smokingstatus.json", + "resourceType": "StructureDefinition", + "id": "us-core-smokingstatus", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus", + "version": "3.1.0", + "kind": "resource", + "type": "Observation" + }, + { + "filename": "SearchParameter-us-core-condition-onset-date.json", + "resourceType": "SearchParameter", + "id": "us-core-condition-onset-date", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-onset-date", + "version": "3.1.0", + "type": "date" + }, + { + "filename": "OperationDefinition-docref.json", + "resourceType": "OperationDefinition", + "id": "docref", + "url": "http://hl7.org/fhir/us/core/OperationDefinition/docref", + "version": "3.1.0", + "kind": "operation", + "type": "true" + }, + { + "filename": "StructureDefinition-us-core-medication.json", + "resourceType": "StructureDefinition", + "id": "us-core-medication", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication", + "version": "3.1.0", + "kind": "resource", + "type": "Medication" + }, + { + "filename": "ValueSet-omb-race-category.json", + "resourceType": "ValueSet", + "id": "omb-race-category", + "url": "http://hl7.org/fhir/us/core/ValueSet/omb-race-category", + "version": "3.1.0" + }, + { + "filename": "StructureDefinition-us-core-location.json", + "resourceType": "StructureDefinition", + "id": "us-core-location", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-location", + "version": "3.1.0", + "kind": "resource", + "type": "Location" + }, + { + "filename": "ValueSet-us-core-allergy-substance.json", + "resourceType": "ValueSet", + "id": "us-core-allergy-substance", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-allergy-substance", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-organization-name.json", + "resourceType": "SearchParameter", + "id": "us-core-organization-name", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name", + "version": "3.1.0", + "type": "string" + }, + { + "filename": "ValueSet-us-core-diagnosticreport-report-and-note-codes.json", + "resourceType": "ValueSet", + "id": "us-core-diagnosticreport-report-and-note-codes", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-report-and-note-codes", + "version": "3.1.0" + }, + { + "filename": "StructureDefinition-us-core-documentreference.json", + "resourceType": "StructureDefinition", + "id": "us-core-documentreference", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference", + "version": "3.1.0", + "kind": "resource", + "type": "DocumentReference" + }, + { + "filename": "ValueSet-us-core-provenance-participant-type.json", + "resourceType": "ValueSet", + "id": "us-core-provenance-participant-type", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-provenance-participant-type", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-condition-clinical-status.json", + "resourceType": "SearchParameter", + "id": "us-core-condition-clinical-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-clinical-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "CodeSystem-cdcrec.json", + "resourceType": "CodeSystem", + "id": "cdcrec", + "url": "urn:oid:2.16.840.1.113883.6.238", + "version": "3.1.0" + }, + { + "filename": "StructureDefinition-us-core-diagnosticreport-note.json", + "resourceType": "StructureDefinition", + "id": "us-core-diagnosticreport-note", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note", + "version": "3.1.0", + "kind": "resource", + "type": "DiagnosticReport" + }, + { + "filename": "SearchParameter-us-core-documentreference-status.json", + "resourceType": "SearchParameter", + "id": "us-core-documentreference-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "StructureDefinition-us-core-procedure.json", + "resourceType": "StructureDefinition", + "id": "us-core-procedure", + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure", + "version": "3.1.0", + "kind": "resource", + "type": "Procedure" + }, + { + "filename": "ValueSet-us-core-procedure-icd10pcs.json", + "resourceType": "ValueSet", + "id": "us-core-procedure-icd10pcs", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-procedure-icd10pcs", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-medicationrequest-intent.json", + "resourceType": "SearchParameter", + "id": "us-core-medicationrequest-intent", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-intent", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "ValueSet-us-core-diagnosticreport-lab-codes.json", + "resourceType": "ValueSet", + "id": "us-core-diagnosticreport-lab-codes", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-lab-codes", + "version": "3.1.0" + }, + { + "filename": "ValueSet-us-core-usps-state.json", + "resourceType": "ValueSet", + "id": "us-core-usps-state", + "url": "http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state", + "version": "3.1.0" + }, + { + "filename": "SearchParameter-us-core-observation-status.json", + "resourceType": "SearchParameter", + "id": "us-core-observation-status", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-status", + "version": "3.1.0", + "type": "token" + }, + { + "filename": "CapabilityStatement-us-core-server.json", + "resourceType": "CapabilityStatement", + "id": "us-core-server", + "url": "http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server", + "version": "3.1.0", + "kind": "requirements" + }, + { + "filename": "SearchParameter-us-core-observation-category.json", + "resourceType": "SearchParameter", + "id": "us-core-observation-category", + "url": "http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-category", + "version": "3.1.0", + "type": "token" + } + ] +} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/CapabilityStatement-us-core-client.json b/resources/uscore_v3.1.0/CapabilityStatement-us-core-client.json new file mode 100755 index 000000000..146c044c2 --- /dev/null +++ b/resources/uscore_v3.1.0/CapabilityStatement-us-core-client.json @@ -0,0 +1 @@ +{"resourceType":"CapabilityStatement","id":"us-core-client","text":{"status":"generated","div":"

    US Core Client CapabilityStatement

    • Implementation Guide Version: 3.1.0
    • FHIR Version: 4.0.1
    • Supported formats: xml, json
    • Published: 2019-10-04
    • Published by: HL7 International - US Realm Steering Committee

    ​The Section describes the expected capabilities of the US Core Client which is responsible for creating and initiating the queries for information about an individual patient. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined in the Conformance Requirements for Server. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.

    FHIR RESTful Capabilities

    The US Core Client SHALL:

    1. Support fetching and querying of one or more US Core profile(s), using the supported RESTful interactions and search parameters declared in the US Core Server CapabilityStatement.

    Security:

    1. See the [General Security Considerations] section for requirements and recommendations.

    Summary of System Wide Interactions

  • MAY support the\ttransaction interaction.
  • MAY support the\tbatch interaction.
  • MAY support the\tsearch-system interaction.
  • MAY support the\thistory-system interaction.
  • RESTful Capabilities by Resource/Profile:

    Summary of Search Criteria

    Resource TypeSupported ProfilesSupported SearchesSupported _includesSupported _revincludesSupported Operations
    AllergyIntoleranceUS Core AllergyIntolerance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tclinical-status, \n\t\t\t\t\t\t\tpatient, patient+clinical-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CarePlanUS Core CarePlan Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcategory, \n\t\t\t\t\t\t\tdate, \n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\tstatus, patient+category+date, patient+category, patient+category+status, patient+category+status+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CareTeamUS Core CareTeam Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\tstatus, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ConditionUS Core Condition Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcategory, \n\t\t\t\t\t\t\tclinical-status, \n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\tonset-date, \n\t\t\t\t\t\t\tcode, patient+category, patient+onset-date, patient+clinical-status, patient+code\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DeviceUS Core Implantable Device Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\ttype, patient+type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DiagnosticReportUS Core DiagnosticReport Profile for Report and Note exchange, \n\n\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tstatus, \n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\tcategory, \n\t\t\t\t\t\t\tcode, \n\t\t\t\t\t\t\tdate, patient+category+date, patient+category, patient+status, patient+code, patient+code+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DocumentReferenceUS Core DocumentReference Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tstatus, \n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\tcategory, \n\t\t\t\t\t\t\ttype, \n\t\t\t\t\t\t\tdate, \n\t\t\t\t\t\t\tperiod, patient+category+date, patient+category, patient+type+period, patient+status, patient+type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$docref\n\t\t\t\t\t\t
    EncounterUS Core Encounter Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tclass, \n\t\t\t\t\t\t\tdate, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\tstatus, \n\t\t\t\t\t\t\ttype, date+patient, class+patient, patient+type, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    GoalUS Core Goal Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tlifecycle-status, \n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\ttarget-date, patient+target-date, patient+lifecycle-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ImmunizationUS Core Immunization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\tstatus, \n\t\t\t\t\t\t\tdate, patient+date, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    LocationUS Core Location Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress, \n\t\t\t\t\t\t\taddress-city, \n\t\t\t\t\t\t\taddress-state, \n\t\t\t\t\t\t\taddress-postalcode\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationUS Core Medication Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationRequestUS Core MedicationRequest Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tstatus, \n\t\t\t\t\t\t\tintent, \n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\tencounter, \n\t\t\t\t\t\t\tauthoredon, patient+intent, patient+intent+encounter, patient+intent+status, patient+intent+authoredon\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tMedicationRequest:medication\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ObservationUS Core Smoking Status Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\n\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\n\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tstatus, \n\t\t\t\t\t\t\tcategory, \n\t\t\t\t\t\t\tcode, \n\t\t\t\t\t\t\tdate, \n\t\t\t\t\t\t\tpatient, patient+category+date, patient+category, patient+code, patient+code+date, patient+category+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    OrganizationUS Core Organization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PatientUS Core Patient Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tbirthdate, \n\t\t\t\t\t\t\tfamily, \n\t\t\t\t\t\t\tgender, \n\t\t\t\t\t\t\tgiven, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tname, birthdate+name, birthdate+family, gender+name, family+gender\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerUS Core Practitioner Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerRoleUS Core PractitionerRole Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tspecialty, \n\t\t\t\t\t\t\tpractitioner\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tPractitionerRole:endpoint, PractitionerRole:practitioner\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProcedureUS Core Procedure Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tstatus, \n\t\t\t\t\t\t\tpatient, \n\t\t\t\t\t\t\tdate, \n\t\t\t\t\t\t\tcode, patient+date, patient+code+date, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProvenanceUS Core Provenance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ValueSet\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$expand\n\t\t\t\t\t\t

    AllergyIntolerance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core AllergyIntolerance Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a AllergyIntolerance resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/AllergyIntolerance/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/AllergyIntolerance?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?clinical-status=[system]|[code]
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]&clinical-status=[system]|[code]

    CarePlan

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CarePlan Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a CarePlan resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/CarePlan/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/CarePlan?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?category=[system]|[code]
    SHOULDdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/CarePlan?date=[date]
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]
    SHOULDstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&date=[date]
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]
    SHOULDpatient+category+status+date\n\t\t\t\t\t\treference+token+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]&date=[date]

    CareTeam

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CareTeam Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a CareTeam resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/CareTeam/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/CareTeam?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]
    SHOULDstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CareTeam?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]&status=[status]

    Condition

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Condition Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Condition resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Condition/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Condition?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?category=[system]|[code]
    SHOULDclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?clinical-status=[system]|[code]
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]
    SHOULDonset-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Condition?onset-date=[onset-date]
    SHOULDcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&category=[system]|[code]
    SHOULDpatient+onset-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&onset-date=[onset-date]
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&clinical-status=[system]|[code]
    SHOULDpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&code=[system]|[code]

    Device

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Implantable Device Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Device resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Device/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Device?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]
    SHOULDtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Device?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]&type=[system]|[code]

    DiagnosticReport

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Report and Note exchange, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.
    create

    This conformance expectation applies only to the US Core DiagnosticReport Profile for Report and Note exchange profile. The conformance expectation for the US Core DiagnosticReport Profile for Laboratory Results Reporting is MAY.

    \n

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a DiagnosticReport resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/DiagnosticReport/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/DiagnosticReport?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?status=[status]
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]
    SHOULDcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?category=[system]|[code]
    SHOULDcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?code=[system]|[code]
    SHOULDdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DiagnosticReport?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]&date=[date]
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&status=[status]
    SHOULDpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]&date=[date]

    DocumentReference

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DocumentReference Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The DocumentReference.type binding SHALL support at a minimum the 5 Common Clinical Notes and may extend to the full US Core DocumentReference Type Value Set

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Operation Summary:

    • SHOULD support the \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$docref operation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

      A client SHOULD be capable of transacting a $docref operation and capable of receiving at least a reference to a generated CCD document, and MAY be able to receive other document types, if available. SHOULD be capable of receiving documents as included resources in response to the operation.

      GET [base]/DocumentReference/$docref?patient=[id]

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a DocumentReference resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/DocumentReference/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/DocumentReference?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULD_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?_id=[id]
    SHOULDstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?status=[status]
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]
    SHOULDcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?category=[system]|[code]
    SHOULDtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?type=[system]|[code]
    SHOULDdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?date=[date]
    SHOULDperiod\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?period=[period]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]&date=[date]
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]
    SHOULDpatient+type+period\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]&period=[period]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&status=[status]
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]

    Encounter

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Encounter Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Encounter resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Encounter/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Encounter?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULD_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?_id=[id]
    SHOULDclass\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]
    SHOULDdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]
    SHOULDidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?identifier=[system]|[code]
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]
    SHOULDstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?status=[status]
    SHOULDtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDdate+patient\n\t\t\t\t\t\tdate+reference\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]&patient=[patient]
    SHOULDclass+patient\n\t\t\t\t\t\ttoken+reference\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]&patient=[patient]
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&type=[system]|[code]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&status=[status]

    Goal

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Goal Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Goal resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Goal/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Goal?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDlifecycle-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Goal?lifecycle-status=[system]|[code]
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]
    SHOULDtarget-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Goal?target-date=[target-date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+target-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&target-date=[target-date]
    SHOULDpatient+lifecycle-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&lifecycle-status=[system]|[code]

    Immunization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Immunization Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Immunization resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Immunization/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Immunization?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]
    SHOULDstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Immunization?status=[status]
    SHOULDdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Immunization?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&date=[date]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&status=[status]

    Location

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Location Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Location resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Location/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Location?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?name=[name]
    SHOULDaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address=[address]
    SHOULDaddress-city\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-city=[address-city]
    SHOULDaddress-state\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-state=[address-state]
    SHOULDaddress-postalcode\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-postalcode=[address-postalcode]

    Medication

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Medication Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria SHALL be supported.

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Medication resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Medication/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Medication?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t


    MedicationRequest

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core MedicationRequest Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be contained or an external resource. The server application MAY choose any one way or more than one method, but if an external reference to Medication is used, the server SHALL support the _include` parameter for searching this element. The client application must support all methods.

    For example, A server SHALL be capable of returning all medications for a patient using one of or both:

    GET /MedicationRequest?patient=[id]

    GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a MedicationRequest resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/MedicationRequest/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _includes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tMedicationRequest:medication - GET [base]/MedicationRequest?[parameter=value]&_include=MedicationRequest:medication
      \n\t\t\t\t\t\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/MedicationRequest?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?status=[status]
    SHOULDintent\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?intent=[system]|[code]
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]
    SHOULDencounter\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?encounter=[encounter]
    SHOULDauthoredon\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/MedicationRequest?authoredon=[authoredon]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+intent\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]
    SHOULDpatient+intent+encounter\n\t\t\t\t\t\treference+token+reference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&encounter=[encounter]
    SHOULDpatient+intent+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&status=[status]
    SHOULDpatient+intent+authoredon\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&authoredon=[authoredon]

    Observation

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Smoking Status Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Observation resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Observation/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Observation?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?status=[status]
    SHOULDcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?category=[system]|[code]
    SHOULDcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?code=[system]|[code]
    SHOULDdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Observation?date=[date]
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&date=[date]
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]
    SHOULDpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]&date=[date]
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&status=[status]

    Organization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Organization Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Organization resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Organization/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Organization?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?name=[name]
    SHOULDaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?address=[address]

    Patient

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Patient Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Patient resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Patient/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Patient?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULD_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?_id=[id]
    SHOULDbirthdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]
    SHOULDfamily\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?family=[family]
    SHOULDgender\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]
    SHOULDgiven\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?given=[given]
    SHOULDidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?identifier=[system]|[code]
    SHOULDname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?name=[name]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDbirthdate+name\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&name=[name]
    SHOULDbirthdate+family\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&family=[family]
    SHOULDgender+name\n\t\t\t\t\t\ttoken+string\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]&name=[name]
    SHOULDfamily+gender\n\t\t\t\t\t\tstring+token\n\t\t\t\t\t\tGET [base]/Patient?family=[family]&gender=[system]|[code]

    Practitioner

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Practitioner Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Practitioner resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Practitioner/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Practitioner?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Practitioner?name=[name]
    SHOULDidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Practitioner?identifier=[system]|[code]

    PractitionerRole

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core PractitionerRole Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a PractitionerRole resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/PractitionerRole/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _includes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tPractitionerRole:endpoint - GET [base]/PractitionerRole?[parameter=value]&_include=PractitionerRole:endpoint
      \n\t\t\t\t\t\n\t\t\t\t\t\tPractitionerRole:practitioner - GET [base]/PractitionerRole?[parameter=value]&_include=PractitionerRole:practitioner
      \n\t\t\t\t\t\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/PractitionerRole?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDspecialty\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/PractitionerRole?specialty=[system]|[code]
    SHOULDpractitioner\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/PractitionerRole?practitioner=[practitioner]

    Procedure

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Procedure Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Procedure resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Procedure/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Client SHOULD be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Procedure?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHOULDstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?status=[status]
    SHOULDpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]
    SHOULDdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Procedure?date=[date]
    SHOULDcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&date=[date]
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&code=[system]|[code]&date=[date]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&status=[status]

    Provenance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Provenance Profile\n\t\t\t\t\n\t\t\t\t

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Client SHALL be capable of fetching a Provenance resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Provenance/[id]\n\t\t\t\t


    ValueSet

    Operation Summary:

    • SHOULD support the \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$expand operation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

      A client can determine the note and report types support by a server by invoking the standard FHIR Value Set Expansion ($expand) operation defined in the FHIR R4 specification. Because servers may support different read and write formats, it also is used to determine the formats (for example, text, pdf) the server supports read and write transactions.



    "},"url":"http://hl7.org/fhir/us/core/CapabilityStatement/us-core-client","version":"3.1.0","name":"UsCoreClientCapabilityStatement","title":"US Core Client CapabilityStatement","status":"active","experimental":false,"date":"2019-10-04T00:00:00+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"​The Section describes the expected capabilities of the US Core Client which is responsible for creating and initiating the queries for information about an individual patient. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined in the [Conformance Requirements for Server](CapabilityStatement-us-core-server.html). US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"kind":"requirements","fhirVersion":"4.0.1","format":["xml","json"],"patchFormat":["application/json-patch+json"],"implementationGuide":["http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core-3.1.0"],"rest":[{"mode":"client","documentation":"The US Core Client **SHALL**:\n\n1. Support fetching and querying of one or more US Core profile(s), using the supported RESTful interactions and search parameters declared in the US Core Server CapabilityStatement.\n","security":{"description":"1. See the [General Security Considerations] section for requirements and recommendations."},"resource":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"AllergyIntolerance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CarePlan","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CareTeam","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"onset-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Condition","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"onset-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-onset-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Device","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DiagnosticReport","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note","http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create","documentation":"This conformance expectation applies **only** to the *US Core DiagnosticReport Profile for Report and Note exchange* profile. The conformance expectation for the *US Core DiagnosticReport Profile for Laboratory Results Reporting* is **MAY**."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"},{"url":"required","valueString":"period"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DocumentReference","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference"],"documentation":"The DocumentReference.type binding SHALL support at a minimum the [5 Common Clinical Notes](ValueSet-us-core-clinical-note-type.html) and may extend to the full US Core DocumentReference Type Value Set","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-type","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"period","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-period","type":"date"}],"operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"docref","definition":"http://hl7.org/fhir/us/core/OperationDefinition/docref","documentation":"A client **SHOULD** be capable of transacting a $docref operation and capable of receiving at least a reference to a generated CCD document, and **MAY** be able to receive other document types, if available. **SHOULD** be capable of receiving documents as included resources in response to the operation.\n\n`GET [base]/DocumentReference/$docref?patient=[id]`"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"date"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"class"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Encounter","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"class","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-class","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"target-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"lifecycle-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Goal","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"lifecycle-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-lifecycle-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"target-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-target-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Immunization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"Location","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-location"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-city","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-city","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-state","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-state","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-postalcode","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-postalcode","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"Medication","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication"],"documentation":"The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria **SHALL** be supported.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"encounter"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"authoredon"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"MedicationRequest","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest"],"documentation":"The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be [contained](http://hl7.org/fhir/R4/references.html#contained) or an external resource. The server application **MAY** choose any one way or more than one method, but if an external reference to Medication is used, the server **SHALL** support the _include` parameter for searching this element. The client application must support all methods.\n\n For example, A server **SHALL** be capable of returning all medications for a patient using one of or both:\n\n `GET /MedicationRequest?patient=[id]`\n\n `GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication`","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchInclude":["MedicationRequest:medication"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"intent","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-intent","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"encounter","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-encounter","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"authoredon","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-authoredon","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Observation","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height","http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age","http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"Organization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"family"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"gender"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"family"},{"url":"required","valueString":"gender"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Patient","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"birthdate","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-birthdate","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"family","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-family","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"gender","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-gender","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"given","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-given","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-name","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"Practitioner","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-identifier","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"PractitionerRole","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchInclude":["PractitionerRole:endpoint","PractitionerRole:practitioner"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"specialty","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"practitioner","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Procedure","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"Provenance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"ValueSet","operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"expand","definition":"http://hl7.org/fhir/OperationDefinition/ValueSet-expand","documentation":"A client can determine the note and report types support by a server by invoking the standard FHIR Value Set Expansion ($expand) operation defined in the FHIR R4 specification. Because servers may support different read and write formats, it also is used to determine the formats (for example, text, pdf) the server supports read and write transactions."}]}],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"transaction"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"batch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"search-system"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-system"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/CapabilityStatement-us-core-server.json b/resources/uscore_v3.1.0/CapabilityStatement-us-core-server.json new file mode 100755 index 000000000..74e73f7d7 --- /dev/null +++ b/resources/uscore_v3.1.0/CapabilityStatement-us-core-server.json @@ -0,0 +1 @@ +{"resourceType":"CapabilityStatement","id":"us-core-server","text":{"status":"generated","div":"

    US Core Server CapabilityStatement

    • Implementation Guide Version: 3.1.0
    • FHIR Version: 4.0.1
    • Supported formats: xml, json
    • Published: 2019-10-04
    • Published by: HL7 International - US Realm Steering Committee

    This Section describes the expected capabilities of the US Core Server actor which is responsible for providing responses to the queries submitted by the US Core Requestors. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined. Systems implementing this capability statement should meet the ONC 2015 Common Clinical Data Set (CCDS) access requirement for Patient Selection 170.315(g)(7) and Application Access - Data Category Request 170.315(g)(8) and and the latest proposed ONC [U.S. Core Data for Interoperability (USCDI)]. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.

    FHIR RESTful Capabilities

    The US Core Server SHALL:

    1. Support the US Core Patient resource profile.
    2. Support at least one additional resource profile from the list of US Core Profiles.
    3. Implement the RESTful behavior according to the FHIR specification.
    4. Return the following response classes:\n
      • (Status 400): invalid parameter
      • (Status 401/4xx): unauthorized request
      • (Status 403): insufficient scope
      • (Status 404): unknown resource
      • (Status 410): deleted resource.
      \n
    5. Support json source formats for all US Core interactions.

    The US Core Server SHOULD:

    1. Support xml source formats for all US Core interactions.
    2. Identify the US Core profiles supported as part of the FHIR meta.profile attribute for each instance.
    3. Support xml resource formats for all Argonaut questionnaire interactions.

    Security:

    1. See the General Security Considerations section for requirements and recommendations.
    2. A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code.

    Summary of System Wide Interactions

  • MAY support the\ttransaction interaction.
  • MAY support the\tbatch interaction.
  • MAY support the\tsearch-system interaction.
  • MAY support the\thistory-system interaction.
  • RESTful Capabilities by Resource/Profile:

    Summary of Search Criteria

    Resource TypeSupported ProfilesSupported SearchesSupported _includesSupported _revincludesSupported Operations
    AllergyIntoleranceUS Core AllergyIntolerance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+clinical-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CarePlanUS Core CarePlan Profile\n\t\t\t\t\t\t\t, patient+category+date, patient+category+status+date, patient+category+status, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    CareTeamUS Core CareTeam Profile\n\t\t\t\t\t\t\t, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ConditionUS Core Condition Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+category, patient+onset-date, patient+clinical-status, patient+code\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DeviceUS Core Implantable Device Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+type\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DiagnosticReportUS Core DiagnosticReport Profile for Report and Note exchange, \n\n\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+status, patient+code+date, patient+code, patient+category+date, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    DocumentReferenceUS Core DocumentReference Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tpatient, patient+type, patient+type+period, patient+status, patient+category+date, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$docref\n\t\t\t\t\t\t
    EncounterUS Core Encounter Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tpatient, patient+status, class+patient, patient+type, date+patient\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    GoalUS Core Goal Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+target-date, patient+lifecycle-status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ImmunizationUS Core Immunization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+date, patient+status\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    LocationUS Core Location Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress, \n\t\t\t\t\t\t\taddress-city, \n\t\t\t\t\t\t\taddress-state, \n\t\t\t\t\t\t\taddress-postalcode\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationUS Core Medication Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    MedicationRequestUS Core MedicationRequest Profile\n\t\t\t\t\t\t\t, patient+intent+status, patient+intent+encounter, patient+intent+authoredon, patient+intent\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tMedicationRequest:medication\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ObservationUS Core Smoking Status Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\n\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\n\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\n\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\t\t\t, patient+code+date, patient+category+status, patient+code, patient+category+date, patient+category\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    OrganizationUS Core Organization Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\taddress\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PatientUS Core Patient Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t_id, \n\t\t\t\t\t\t\tidentifier, \n\t\t\t\t\t\t\tname, gender+name, birthdate+family, birthdate+name, family+gender\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerUS Core Practitioner Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tname, \n\t\t\t\t\t\t\tidentifier\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    PractitionerRoleUS Core PractitionerRole Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tspecialty, \n\t\t\t\t\t\t\tpractitioner\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tPractitionerRole:endpoint, PractitionerRole:practitioner\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProcedureUS Core Procedure Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tpatient, patient+code+date, patient+status, patient+date\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n Provenance:target\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ProvenanceUS Core Provenance Profile\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
    ValueSet\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n \n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$expand\n\t\t\t\t\t\t

    AllergyIntolerance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core AllergyIntolerance Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a AllergyIntolerance resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/AllergyIntolerance/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/AllergyIntolerance?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?clinical-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/AllergyIntolerance?patient=[patient]&clinical-status=[system]|[code]

    CarePlan

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CarePlan Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a CarePlan resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/CarePlan/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/CarePlan?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?category=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/CarePlan?date=[date]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CarePlan?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&date=[date]
    SHOULDpatient+category+status+date\n\t\t\t\t\t\treference+token+token+date\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]&date=[date]
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]&status=[status]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CarePlan?patient=[patient]&category=[system]|[code]

    CareTeam

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core CareTeam Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a CareTeam resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/CareTeam/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/CareTeam?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/CareTeam?status=[status]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/CareTeam?patient=[patient]&status=[status]

    Condition

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Condition Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Condition resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Condition/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Condition?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?category=[system]|[code]
    MAYclinical-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?clinical-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]
    MAYonset-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Condition?onset-date=[onset-date]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Condition?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&category=[system]|[code]
    SHOULDpatient+onset-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&onset-date=[onset-date]
    SHOULDpatient+clinical-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&clinical-status=[system]|[code]
    SHOULDpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Condition?patient=[patient]&code=[system]|[code]

    Device

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Implantable Device Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Device resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Device/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Device?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Device?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Device?patient=[patient]&type=[system]|[code]

    DiagnosticReport

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Report and Note exchange, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DiagnosticReport Profile for Laboratory Results Reporting\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.
    create

    This conformance expectation applies only to the US Core DiagnosticReport Profile for Report and Note exchange profile. The conformance expectation for the US Core DiagnosticReport Profile for Laboratory Results Reporting is MAY.

    \n

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a DiagnosticReport resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/DiagnosticReport/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/DiagnosticReport?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?category=[system]|[code]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DiagnosticReport?code=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DiagnosticReport?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&status=[status]
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]&date=[date]
    SHALLpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&code=[system]|[code]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DiagnosticReport?patient=[patient]&category=[system]|[code]

    DocumentReference

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core DocumentReference Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The DocumentReference.type binding SHALL support at a minimum the 5 Common Clinical Notes and may extend to the full US Core DocumentReference Type Value Set

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Operation Summary:

    • SHALL support the \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$docref operation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

      A server SHALL be capable of responding to a $docref operation and capable of returning at least a reference to a generated CCD document, if available. MAY provide references to other 'on-demand' and 'stable' documents (or 'delayed/deferred assembly') that meet the query parameters as well. If a context date range is supplied the server ** SHOULD** provide references to any document that falls within the date range If no date range is supplied, then the server SHALL provide references to last or current encounter. SHOULD document what resources, if any, are returned as included resources

      GET [base]/DocumentReference/$docref?patient=[id]

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a DocumentReference resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/DocumentReference/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/DocumentReference?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?_id=[id]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?category=[system]|[code]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/DocumentReference?type=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?date=[date]
    MAYperiod\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/DocumentReference?period=[period]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]
    SHOULDpatient+type+period\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&type=[system]|[code]&period=[period]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&status=[status]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/DocumentReference?patient=[patient]&category=[system]|[code]

    Encounter

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Encounter Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Encounter resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Encounter/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Encounter?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?_id=[id]
    MAYclass\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]
    SHOULDidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?identifier=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?status=[status]
    MAYtype\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Encounter?type=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&status=[status]
    SHOULDclass+patient\n\t\t\t\t\t\ttoken+reference\n\t\t\t\t\t\tGET [base]/Encounter?class=[system]|[code]&patient=[patient]
    SHOULDpatient+type\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Encounter?patient=[patient]&type=[system]|[code]
    SHALLdate+patient\n\t\t\t\t\t\tdate+reference\n\t\t\t\t\t\tGET [base]/Encounter?date=[date]&patient=[patient]

    Goal

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Goal Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Goal resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Goal/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Goal?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYlifecycle-status\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Goal?lifecycle-status=[system]|[code]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]
    MAYtarget-date\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Goal?target-date=[target-date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+target-date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&target-date=[target-date]
    SHOULDpatient+lifecycle-status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Goal?patient=[patient]&lifecycle-status=[system]|[code]

    Immunization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Immunization Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Immunization resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Immunization/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Immunization?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Immunization?status=[status]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Immunization?date=[date]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&date=[date]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Immunization?patient=[patient]&status=[status]

    Location

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Location Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Location resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Location/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Location?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?name=[name]
    SHALLaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address=[address]
    SHOULDaddress-city\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-city=[address-city]
    SHOULDaddress-state\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-state=[address-state]
    SHOULDaddress-postalcode\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Location?address-postalcode=[address-postalcode]

    Medication

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Medication Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria SHALL be supported.

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Medication resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Medication/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Medication?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t


    MedicationRequest

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core MedicationRequest Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be contained or an external resource. The server application MAY choose any one way or more than one method, but if an external reference to Medication is used, the server SHALL support the _include` parameter for searching this element. The client application must support all methods.

    For example, A server SHALL be capable of returning all medications for a patient using one of or both:

    GET /MedicationRequest?patient=[id]

    GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a MedicationRequest resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/MedicationRequest/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _includes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tMedicationRequest:medication - GET [base]/MedicationRequest?[parameter=value]&_include=MedicationRequest:medication
      \n\t\t\t\t\t\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/MedicationRequest?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?status=[status]
    MAYintent\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/MedicationRequest?intent=[system]|[code]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]
    MAYencounter\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/MedicationRequest?encounter=[encounter]
    MAYauthoredon\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/MedicationRequest?authoredon=[authoredon]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLpatient+intent+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&status=[status]
    SHOULDpatient+intent+encounter\n\t\t\t\t\t\treference+token+reference\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&encounter=[encounter]
    SHOULDpatient+intent+authoredon\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]&authoredon=[authoredon]
    SHALLpatient+intent\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/MedicationRequest?patient=[patient]&intent=[system]|[code]

    Observation

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Smoking Status Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric Weight for Height Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Laboratory Result Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pediatric BMI for Age Observation Profile, \n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Pulse Oximetry Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Observation resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Observation/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Observation?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?status=[status]
    MAYcategory\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?category=[system]|[code]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Observation?code=[system]|[code]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Observation?date=[date]
    MAYpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]&date=[date]
    SHOULDpatient+category+status\n\t\t\t\t\t\treference+token+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&status=[status]
    SHALLpatient+code\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&code=[system]|[code]
    SHALLpatient+category+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]&date=[date]
    SHALLpatient+category\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Observation?patient=[patient]&category=[system]|[code]

    Organization

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Organization Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Organization resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Organization/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Organization?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?name=[name]
    SHALLaddress\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Organization?address=[address]

    Patient

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Patient Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Patient resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Patient/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Patient?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALL_id\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?_id=[id]
    MAYbirthdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]
    MAYfamily\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?family=[family]
    MAYgender\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]
    MAYgiven\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?given=[given]
    SHALLidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Patient?identifier=[system]|[code]
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Patient?name=[name]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHALLgender+name\n\t\t\t\t\t\ttoken+string\n\t\t\t\t\t\tGET [base]/Patient?gender=[system]|[code]&name=[name]
    SHOULDbirthdate+family\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&family=[family]
    SHALLbirthdate+name\n\t\t\t\t\t\tdate+string\n\t\t\t\t\t\tGET [base]/Patient?birthdate=[birthdate]&name=[name]
    SHOULDfamily+gender\n\t\t\t\t\t\tstring+token\n\t\t\t\t\t\tGET [base]/Patient?family=[family]&gender=[system]|[code]

    Practitioner

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Practitioner Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Practitioner resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Practitioner/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Practitioner?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLname\n\t\t\t\t\t\t\tstring\n\t\t\t\t\t\tGET [base]/Practitioner?name=[name]
    SHALLidentifier\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Practitioner?identifier=[system]|[code]

    PractitionerRole

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core PractitionerRole Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a PractitionerRole resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/PractitionerRole/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHOULD be capable of supporting the following _includes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tPractitionerRole:endpoint - GET [base]/PractitionerRole?[parameter=value]&_include=PractitionerRole:endpoint
      \n\t\t\t\t\t\n\t\t\t\t\t\tPractitionerRole:practitioner - GET [base]/PractitionerRole?[parameter=value]&_include=PractitionerRole:practitioner
      \n\t\t\t\t\t\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/PractitionerRole?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    SHALLspecialty\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/PractitionerRole?specialty=[system]|[code]
    SHALLpractitioner\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/PractitionerRole?practitioner=[practitioner]

    Procedure

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Procedure Profile\n\t\t\t\t\n\t\t\t\t

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Procedure resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Procedure/[id]\n\t\t\t\t

    • \n\t\t\t\t\tA Server SHALL be capable of supporting the following _revincludes:\n\t\t\t\t\t
      \n\t\t\t\t\t\n\t\t\t\t\t\tProvenance:target - GET [base]/Procedure?[parameter=value]&_revinclude=Provenance:target
      \n\t\t\t\t\t\n\t\t\t\t

    Search Parameter Summary:

    ConformanceParameterTypeExample
    MAYstatus\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?status=[status]
    SHALLpatient\n\t\t\t\t\t\t\treference\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]
    MAYdate\n\t\t\t\t\t\t\tdate\n\t\t\t\t\t\tGET [base]/Procedure?date=[date]
    MAYcode\n\t\t\t\t\t\t\ttoken\n\t\t\t\t\t\tGET [base]/Procedure?code=[system]|[code]

    Search Parameter Combination Summary:

    ConformanceParameter CombinationTypesExample
    SHOULDpatient+code+date\n\t\t\t\t\t\treference+token+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&code=[system]|[code]&date=[date]
    SHOULDpatient+status\n\t\t\t\t\t\treference+token\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&status=[status]
    SHALLpatient+date\n\t\t\t\t\t\treference+date\n\t\t\t\t\t\tGET [base]/Procedure?patient=[patient]&date=[date]

    Provenance

    Supported Profiles:\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tUS Core Provenance Profile\n\t\t\t\t\n\t\t\t\t

    Resource Specific Documentation:

    If a system receives a provider in Provenance.agent.who as free text they must capture who sent them the information as the organization. On request they SHALL provide this organization as the source and MAY include the free text provider.

    Reference Policy: resolves

    Profile Interaction Summary:

    • SHALL support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsearch-type, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tread.
    • SHOULD support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvread, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-instance.
    • MAY support \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcreate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tupdate, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpatch, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdelete, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thistory-type.

    Fetch and Search Criteria:

    • \n\t\t\t\t\tA Server SHALL be capable of returning a Provenance resource using:\n\t\t\t\t\t
      \n\t\t\t\t\t\tGET [base]/Provenance/[id]\n\t\t\t\t


    ValueSet

    Operation Summary:

    • SHOULD support the \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$expand operation\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

      A client can determine the note and report types support by a server by invoking the standard FHIR Value Set Expansion ($expand) operation defined in the FHIR R4 specification. Because servers may support different read and write formats, it also is used to determine the formats (for example, text, pdf) the server supports read and write transactions.



    "},"url":"http://hl7.org/fhir/us/core/CapabilityStatement/us-core-server","version":"3.1.0","name":"UsCoreServerCapabilityStatement","title":"US Core Server CapabilityStatement","status":"active","experimental":false,"date":"2019-10-04T00:00:00+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"This Section describes the expected capabilities of the US Core Server actor which is responsible for providing responses to the queries submitted by the US Core Requestors. The complete list of FHIR profiles, RESTful operations, and search parameters supported by US Core Servers are defined. Systems implementing this capability statement should meet the ONC 2015 Common Clinical Data Set (CCDS) access requirement for Patient Selection 170.315(g)(7) and Application Access - Data Category Request 170.315(g)(8) and and the latest proposed ONC [U.S. Core Data for Interoperability (USCDI)]. US Core Clients have the option of choosing from this list to access necessary data based on their local use cases and other contextual requirements.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"kind":"requirements","fhirVersion":"4.0.1","format":["xml","json"],"patchFormat":["application/json-patch+json"],"implementationGuide":["http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core-3.1.0"],"rest":[{"mode":"server","documentation":"The US Core Server **SHALL**:\n\n1. Support the US Core Patient resource profile.\n1. Support at least one additional resource profile from the list of US Core Profiles.\n1. Implement the RESTful behavior according to the FHIR specification.\n1. Return the following response classes:\n - (Status 400): invalid parameter\n - (Status 401/4xx): unauthorized request\n - (Status 403): insufficient scope\n - (Status 404): unknown resource\n - (Status 410): deleted resource.\n1. Support json source formats for all US Core interactions.\n\nThe US Core Server **SHOULD**:\n\n1. Support xml source formats for all US Core interactions.\n1. Identify the US Core profiles supported as part of the FHIR `meta.profile` attribute for each instance.\n1. Support xml resource formats for all Argonaut questionnaire interactions.","security":{"description":"1. See the [General Security Considerations](security.html) section for requirements and recommendations.\n1. A server **SHALL** reject any unauthorized requests by returning an `HTTP 401` unauthorized response code."},"resource":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"AllergyIntolerance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CarePlan","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"CareTeam","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-status","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"onset-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"clinical-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Condition","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"clinical-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-clinical-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"onset-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-onset-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Device","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DiagnosticReport","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note","http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create","documentation":"This conformance expectation applies **only** to the *US Core DiagnosticReport Profile for Report and Note exchange* profile. The conformance expectation for the *US Core DiagnosticReport Profile for Laboratory Results Reporting* is **MAY**."},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"},{"url":"required","valueString":"period"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"DocumentReference","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference"],"documentation":"The DocumentReference.type binding SHALL support at a minimum the [5 Common Clinical Notes](ValueSet-us-core-clinical-note-type.html) and may extend to the full US Core DocumentReference Type Value Set","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-type","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"period","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-period","type":"date"}],"operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"docref","definition":"http://hl7.org/fhir/us/core/OperationDefinition/docref","documentation":"A server **SHALL** be capable of responding to a $docref operation and capable of returning at least a reference to a generated CCD document, if available. **MAY** provide references to other 'on-demand' and 'stable' documents (or 'delayed/deferred assembly') that meet the query parameters as well. If a context date range is supplied the server ** SHOULD** provide references to any document that falls within the date range If no date range is supplied, then the server **SHALL** provide references to last or current encounter. **SHOULD** document what resources, if any, are returned as included resources\n\n`GET [base]/DocumentReference/$docref?patient=[id]`"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"class"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"type"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"date"},{"url":"required","valueString":"patient"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Encounter","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"class","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-class","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"type","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-type","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"target-date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"lifecycle-status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Goal","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"lifecycle-status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-lifecycle-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"target-date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-target-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Immunization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-date","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Location","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-location"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-city","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-city","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-state","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-state","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"address-postalcode","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-postalcode","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Medication","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication"],"documentation":"The MedicationStatement and MedicationRequest resources can represent a medication, using an external reference to a Medication resource. If an external Medication Resource is used in a MedicationStatement or a MedicationRequest, then the READ and SEARCH Criteria **SHALL** be supported.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"encounter"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"},{"url":"required","valueString":"authoredon"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"intent"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"MedicationRequest","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest"],"documentation":"The MedicationRequest resources can represent a medication using either a code or refer to the Medication resource. When referencing Medication, the resource may be [contained](http://hl7.org/fhir/R4/references.html#contained) or an external resource. The server application **MAY** choose any one way or more than one method, but if an external reference to Medication is used, the server **SHALL** support the _include` parameter for searching this element. The client application must support all methods.\n\n For example, A server **SHALL** be capable of returning all medications for a patient using one of or both:\n\n `GET /MedicationRequest?patient=[id]`\n\n `GET /MedicationRequest?patient=[id]&_include=MedicationRequest:medication`","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchInclude":["MedicationRequest:medication"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"intent","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-intent","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"encounter","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-encounter","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"authoredon","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-authoredon","type":"date"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"category"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Observation","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height","http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab","http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age","http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"category","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-category","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-code","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-patient","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Organization","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"address","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"gender"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"family"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"birthdate"},{"url":"required","valueString":"name"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"family"},{"url":"required","valueString":"gender"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Patient","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"_id","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-id","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"birthdate","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-birthdate","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"family","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-family","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"gender","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-gender","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"given","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-given","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-identifier","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-name","type":"string"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Practitioner","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"name","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-name","type":"string"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"identifier","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-identifier","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"PractitionerRole","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchInclude":["PractitionerRole:endpoint","PractitionerRole:practitioner"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"specialty","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"practitioner","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner","type":"reference"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"code"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"status"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"},{"url":"required","valueString":"patient"},{"url":"required","valueString":"date"}],"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-search-parameter-combination"}],"type":"Procedure","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure"],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"],"searchRevInclude":["Provenance:target"],"searchParam":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"status","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-status","type":"token"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"name":"patient","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-patient","type":"reference"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"date","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-date","type":"date"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"name":"code","definition":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-code","type":"token"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"type":"Provenance","supportedProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance"],"documentation":"If a system receives a provider in `Provenance.agent.who` as free text they must capture who sent them the information as the organization. On request they **SHALL** provide this organization as the source and **MAY** include the free text provider.","interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"create"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"search-type"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}],"code":"read"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"vread"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"update"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"patch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"delete"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"code":"history-instance"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-type"}],"referencePolicy":["resolves"]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"type":"ValueSet","operation":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}],"name":"expand","definition":"http://hl7.org/fhir/OperationDefinition/ValueSet-expand","documentation":"A client can determine the note and report types support by a server by invoking the standard FHIR Value Set Expansion ($expand) operation defined in the FHIR R4 specification. Because servers may support different read and write formats, it also is used to determine the formats (for example, text, pdf) the server supports read and write transactions."}]}],"interaction":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"transaction"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"batch"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"search-system"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}],"code":"history-system"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/CodeSystem-careplan-category.json b/resources/uscore_v3.1.0/CodeSystem-careplan-category.json new file mode 100755 index 000000000..09c5479ce --- /dev/null +++ b/resources/uscore_v3.1.0/CodeSystem-careplan-category.json @@ -0,0 +1 @@ +{"resourceType":"CodeSystem","id":"careplan-category","text":{"status":"generated","div":"

    US Core CarePlan Category Extension Codes

    Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.

    \n

    This code system http://hl7.org/fhir/us/core/CodeSystem/careplan-category defines the following codes:

    CodeDisplayDefinition
    assess-plan Assessment and Plan of TreatmentThe clinical conclusions and assumptions that guide the patient's treatment and the clinical activities formulated for a patient.
    "},"url":"http://hl7.org/fhir/us/core/CodeSystem/careplan-category","version":"3.1.0","name":"USCoreCarePlanCategoryExtensionCodes","title":"US Core CarePlan Category Extension Codes","status":"active","date":"2019-11-06T13:08:22+11:00","publisher":"HL7 US Realm Steering Committee","description":"Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.\n","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"caseSensitive":true,"content":"complete","concept":[{"code":"assess-plan","display":"Assessment and Plan of Treatment","definition":"The clinical conclusions and assumptions that guide the patient's treatment and the clinical activities formulated for a patient."}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/CodeSystem-cdcrec.json b/resources/uscore_v3.1.0/CodeSystem-cdcrec.json new file mode 100755 index 000000000..0d531704b --- /dev/null +++ b/resources/uscore_v3.1.0/CodeSystem-cdcrec.json @@ -0,0 +1 @@ +{"resourceType":"CodeSystem","id":"cdcrec","text":{"status":"generated","div":"

    Race & Ethnicity - CDC

    The U.S. Centers for Disease Control and Prevention (CDC) has prepared a code set for use in codingrace and ethnicity data. This code set is based on current federal standards for classifying data onrace and ethnicity, specifically the minimum race and ethnicity categories defined by the U.S. Office ofManagement and Budget (OMB) and a more detailed set of race and ethnicity categories maintainedby the U.S. Bureau of the Census (BC). The main purpose of the code set is to facilitate use of federalstandards for classifying data on race and ethnicity when these data are exchanged, stored, retrieved,or analyzed in electronic form. At the same time, the code set can be applied to paper-based recordsystems to the extent that these systems are used to collect, maintain, and report data on race andethnicity in accordance with current federal standards. Source: Race and Ethnicity Code Set Version 1.0.

    \n

    Properties

    CodeURLDescriptionType
    abstractTrue if an element is considered 'abstract' - in other words, the code is not for use as a real conceptboolean

    This code system urn:oid:2.16.840.1.113883.6.238 defines the following codes:

    LvlCodeDisplayDefinition
    11000-9 RaceRace, Note that this is an abstract 'grouping' concept and not for use as a real concept
    2  1002-5 American Indian or Alaska NativeAmerican Indian or Alaska Native
    3    1004-1 American IndianAmerican Indian
    3    1735-0 Alaska NativeAlaska Native
    3    1006-6 AbenakiAbenaki
    3    1008-2 AlgonquianAlgonquian
    3    1010-8 ApacheApache
    3    1021-5 ArapahoArapaho
    3    1026-4 ArikaraArikara
    3    1028-0 AssiniboineAssiniboine
    3    1030-6 Assiniboine SiouxAssiniboine Sioux
    3    1033-0 BannockBannock
    3    1035-5 BlackfeetBlackfeet
    3    1037-1 BrothertonBrotherton
    3    1039-7 Burt Lake BandBurt Lake Band
    3    1041-3 CaddoCaddo
    3    1044-7 CahuillaCahuilla
    3    1053-8 California TribesCalifornia Tribes
    3    1068-6 Canadian and Latin American IndianCanadian and Latin American Indian
    3    1076-9 CatawbaCatawba
    3    1078-5 CayuseCayuse
    3    1080-1 ChehalisChehalis
    3    1082-7 ChemakuanChemakuan
    3    1086-8 ChemehueviChemehuevi
    3    1088-4 CherokeeCherokee
    3    1100-7 Cherokee ShawneeCherokee Shawnee
    3    1102-3 CheyenneCheyenne
    3    1106-4 Cheyenne-ArapahoCheyenne-Arapaho
    3    1108-0 ChickahominyChickahominy
    3    1112-2 ChickasawChickasaw
    3    1114-8 ChinookChinook
    3    1123-9 ChippewaChippewa
    3    1150-2 Chippewa CreeChippewa Cree
    3    1153-6 ChitimachaChitimacha
    3    1155-1 ChoctawChoctaw
    3    1162-7 ChumashChumash
    3    1165-0 Clear LakeClear Lake
    3    1167-6 Coeur D'AleneCoeur D'Alene
    3    1169-2 CoharieCoharie
    3    1171-8 Colorado RiverColorado River
    3    1173-4 ColvilleColville
    3    1175-9 ComancheComanche
    3    1178-3 Coos, Lower Umpqua, SiuslawCoos, Lower Umpqua, Siuslaw
    3    1180-9 CoosCoos
    3    1182-5 CoquillesCoquilles
    3    1184-1 CostanoanCostanoan
    3    1186-6 CoushattaCoushatta
    3    1189-0 CowlitzCowlitz
    3    1191-6 CreeCree
    3    1193-2 CreekCreek
    3    1207-0 CroatanCroatan
    3    1209-6 CrowCrow
    3    1211-2 CupenoCupeno
    3    1214-6 DelawareDelaware
    3    1222-9 DieguenoDiegueno
    3    1233-6 Eastern TribesEastern Tribes
    3    1250-0 EsselenEsselen
    3    1252-6 Fort BelknapFort Belknap
    3    1254-2 Fort BertholdFort Berthold
    3    1256-7 Fort McdowellFort Mcdowell
    3    1258-3 Fort HallFort Hall
    3    1260-9 GabrielenoGabrieleno
    3    1262-5 Grand RondeGrand Ronde
    3    1264-1 Gros VentresGros Ventres
    3    1267-4 HaliwaHaliwa
    3    1269-0 HidatsaHidatsa
    3    1271-6 HoopaHoopa
    3    1275-7 Hoopa ExtensionHoopa Extension
    3    1277-3 HoumaHouma
    3    1279-9 Inaja-CosmitInaja-Cosmit
    3    1281-5 IowaIowa
    3    1285-6 IroquoisIroquois
    3    1297-1 JuanenoJuaneno
    3    1299-7 KalispelKalispel
    3    1301-1 KarukKaruk
    3    1303-7 KawKaw
    3    1305-2 KickapooKickapoo
    3    1309-4 KiowaKiowa
    3    1312-8 KlallamKlallam
    3    1317-7 KlamathKlamath
    3    1319-3 KonkowKonkow
    3    1321-9 KootenaiKootenai
    3    1323-5 LassikLassik
    3    1325-0 Long IslandLong Island
    3    1331-8 LuisenoLuiseno
    3    1340-9 LumbeeLumbee
    3    1342-5 LummiLummi
    3    1344-1 MaiduMaidu
    3    1348-2 MakahMakah
    3    1350-8 MaliseetMaliseet
    3    1352-4 MandanMandan
    3    1354-0 MattaponiMattaponi
    3    1356-5 MenomineeMenominee
    3    1358-1 MiamiMiami
    3    1363-1 MiccosukeeMiccosukee
    3    1365-6 MicmacMicmac
    3    1368-0 Mission IndiansMission Indians
    3    1370-6 MiwokMiwok
    3    1372-2 ModocModoc
    3    1374-8 MoheganMohegan
    3    1376-3 MonoMono
    3    1378-9 NanticokeNanticoke
    3    1380-5 NarragansettNarragansett
    3    1382-1 NavajoNavajo
    3    1387-0 Nez PerceNez Perce
    3    1389-6 NomalakiNomalaki
    3    1391-2 Northwest TribesNorthwest Tribes
    3    1403-5 OmahaOmaha
    3    1405-0 Oregon AthabaskanOregon Athabaskan
    3    1407-6 OsageOsage
    3    1409-2 Otoe-MissouriaOtoe-Missouria
    3    1411-8 OttawaOttawa
    3    1416-7 PaiutePaiute
    3    1439-9 PamunkeyPamunkey
    3    1441-5 PassamaquoddyPassamaquoddy
    3    1445-6 PawneePawnee
    3    1448-0 PenobscotPenobscot
    3    1450-6 PeoriaPeoria
    3    1453-0 PequotPequot
    3    1456-3 PimaPima
    3    1460-5 PiscatawayPiscataway
    3    1462-1 Pit RiverPit River
    3    1464-7 PomoPomo
    3    1474-6 PoncaPonca
    3    1478-7 PotawatomiPotawatomi
    3    1487-8 PowhatanPowhatan
    3    1489-4 PuebloPueblo
    3    1518-0 Puget Sound SalishPuget Sound Salish
    3    1541-2 QuapawQuapaw
    3    1543-8 QuinaultQuinault
    3    1545-3 RappahannockRappahannock
    3    1547-9 Reno-SparksReno-Sparks
    3    1549-5 Round ValleyRound Valley
    3    1551-1 Sac and FoxSac and Fox
    3    1556-0 SalinanSalinan
    3    1558-6 SalishSalish
    3    1560-2 Salish and KootenaiSalish and Kootenai
    3    1562-8 SchaghticokeSchaghticoke
    3    1564-4 Scott ValleyScott Valley
    3    1566-9 SeminoleSeminole
    3    1573-5 SerranoSerrano
    3    1576-8 ShastaShasta
    3    1578-4 ShawneeShawnee
    3    1582-6 ShinnecockShinnecock
    3    1584-2 Shoalwater BayShoalwater Bay
    3    1586-7 ShoshoneShoshone
    3    1602-2 Shoshone PaiuteShoshone Paiute
    3    1607-1 SiletzSiletz
    3    1609-7 SiouxSioux
    3    1643-6 SiuslawSiuslaw
    3    1645-1 SpokaneSpokane
    3    1647-7 StewartStewart
    3    1649-3 StockbridgeStockbridge
    3    1651-9 SusanvilleSusanville
    3    1653-5 Tohono O'OdhamTohono O'Odham
    3    1659-2 TolowaTolowa
    3    1661-8 TonkawaTonkawa
    3    1663-4 TyghTygh
    3    1665-9 UmatillaUmatilla
    3    1667-5 UmpquaUmpqua
    3    1670-9 UteUte
    3    1675-8 WailakiWailaki
    3    1677-4 Walla-WallaWalla-Walla
    3    1679-0 WampanoagWampanoag
    3    1683-2 Warm SpringsWarm Springs
    3    1685-7 WascopumWascopum
    3    1687-3 WashoeWashoe
    3    1692-3 WichitaWichita
    3    1694-9 Wind RiverWind River
    3    1696-4 WinnebagoWinnebago
    3    1700-4 WinnemuccaWinnemucca
    3    1702-0 WintunWintun
    3    1704-6 WiyotWiyot
    3    1707-9 YakamaYakama
    3    1709-5 Yakama CowlitzYakama Cowlitz
    3    1711-1 YaquiYaqui
    3    1715-2 Yavapai ApacheYavapai Apache
    3    1717-8 YokutsYokuts
    3    1722-8 YuchiYuchi
    3    1724-4 YumanYuman
    3    1732-7 YurokYurok
    3    1011-6 ChiricahuaChiricahua
    3    1012-4 Fort Sill ApacheFort Sill Apache
    3    1013-2 Jicarilla ApacheJicarilla Apache
    3    1014-0 Lipan ApacheLipan Apache
    3    1015-7 Mescalero ApacheMescalero Apache
    3    1016-5 Oklahoma ApacheOklahoma Apache
    3    1017-3 Payson ApachePayson Apache
    3    1018-1 San Carlos ApacheSan Carlos Apache
    3    1019-9 White Mountain ApacheWhite Mountain Apache
    3    1022-3 Northern ArapahoNorthern Arapaho
    3    1023-1 Southern ArapahoSouthern Arapaho
    3    1024-9 Wind River ArapahoWind River Arapaho
    3    1031-4 Fort Peck Assiniboine SiouxFort Peck Assiniboine Sioux
    3    1042-1 Oklahoma CadoOklahoma Cado
    3    1045-4 Agua Caliente CahuillaAgua Caliente Cahuilla
    3    1046-2 AugustineAugustine
    3    1047-0 CabazonCabazon
    3    1048-8 Los CoyotesLos Coyotes
    3    1049-6 MorongoMorongo
    3    1050-4 Santa Rosa CahuillaSanta Rosa Cahuilla
    3    1051-2 Torres-MartinezTorres-Martinez
    3    1054-6 CahtoCahto
    3    1055-3 ChimarikoChimariko
    3    1056-1 Coast MiwokCoast Miwok
    3    1057-9 DiggerDigger
    3    1058-7 KawaiisuKawaiisu
    3    1059-5 Kern RiverKern River
    3    1060-3 MattoleMattole
    3    1061-1 Red WoodRed Wood
    3    1062-9 Santa RosaSanta Rosa
    3    1063-7 TakelmaTakelma
    3    1064-5 WappoWappo
    3    1065-2 YanaYana
    3    1066-0 YukiYuki
    3    1069-4 Canadian IndianCanadian Indian
    3    1070-2 Central American IndianCentral American Indian
    3    1071-0 French American IndianFrench American Indian
    3    1072-8 Mexican American IndianMexican American Indian
    3    1073-6 South American IndianSouth American Indian
    3    1074-4 Spanish American IndianSpanish American Indian
    3    1083-5 HohHoh
    3    1084-3 QuileuteQuileute
    3    1089-2 Cherokee AlabamaCherokee Alabama
    3    1090-0 Cherokees of Northeast AlabamaCherokees of Northeast Alabama
    3    1091-8 Cherokees of Southeast AlabamaCherokees of Southeast Alabama
    3    1092-6 Eastern CherokeeEastern Cherokee
    3    1093-4 Echota CherokeeEchota Cherokee
    3    1094-2 Etowah CherokeeEtowah Cherokee
    3    1095-9 Northern CherokeeNorthern Cherokee
    3    1096-7 TuscolaTuscola
    3    1097-5 United Keetowah Band of CherokeeUnited Keetowah Band of Cherokee
    3    1098-3 Western CherokeeWestern Cherokee
    3    1103-1 Northern CheyenneNorthern Cheyenne
    3    1104-9 Southern CheyenneSouthern Cheyenne
    3    1109-8 Eastern ChickahominyEastern Chickahominy
    3    1110-6 Western ChickahominyWestern Chickahominy
    3    1115-5 ClatsopClatsop
    3    1116-3 Columbia River ChinookColumbia River Chinook
    3    1117-1 KathlametKathlamet
    3    1118-9 Upper ChinookUpper Chinook
    3    1119-7 Wakiakum ChinookWakiakum Chinook
    3    1120-5 Willapa ChinookWillapa Chinook
    3    1121-3 WishramWishram
    3    1124-7 Bad RiverBad River
    3    1125-4 Bay Mills ChippewaBay Mills Chippewa
    3    1126-2 Bois ForteBois Forte
    3    1127-0 Burt Lake ChippewaBurt Lake Chippewa
    3    1128-8 Fond du LacFond du Lac
    3    1129-6 Grand PortageGrand Portage
    3    1130-4 Grand Traverse Band of Ottawa/ChippewaGrand Traverse Band of Ottawa/Chippewa
    3    1131-2 KeweenawKeweenaw
    3    1132-0 Lac Courte OreillesLac Courte Oreilles
    3    1133-8 Lac du FlambeauLac du Flambeau
    3    1134-6 Lac Vieux Desert ChippewaLac Vieux Desert Chippewa
    3    1135-3 Lake SuperiorLake Superior
    3    1136-1 Leech LakeLeech Lake
    3    1137-9 Little Shell ChippewaLittle Shell Chippewa
    3    1138-7 Mille LacsMille Lacs
    3    1139-5 Minnesota ChippewaMinnesota Chippewa
    3    1140-3 OntonagonOntonagon
    3    1141-1 Red Cliff ChippewaRed Cliff Chippewa
    3    1142-9 Red Lake ChippewaRed Lake Chippewa
    3    1143-7 Saginaw ChippewaSaginaw Chippewa
    3    1144-5 St. Croix ChippewaSt. Croix Chippewa
    3    1145-2 Sault Ste. Marie ChippewaSault Ste. Marie Chippewa
    3    1146-0 Sokoagon ChippewaSokoagon Chippewa
    3    1147-8 Turtle MountainTurtle Mountain
    3    1148-6 White EarthWhite Earth
    3    1151-0 Rocky Boy's Chippewa CreeRocky Boy's Chippewa Cree
    3    1156-9 Clifton ChoctawClifton Choctaw
    3    1157-7 Jena ChoctawJena Choctaw
    3    1158-5 Mississippi ChoctawMississippi Choctaw
    3    1159-3 Mowa Band of ChoctawMowa Band of Choctaw
    3    1160-1 Oklahoma ChoctawOklahoma Choctaw
    3    1163-5 Santa YnezSanta Ynez
    3    1176-7 Oklahoma ComancheOklahoma Comanche
    3    1187-4 Alabama CoushattaAlabama Coushatta
    3    1194-0 Alabama CreekAlabama Creek
    3    1195-7 Alabama QuassarteAlabama Quassarte
    3    1196-5 Eastern CreekEastern Creek
    3    1197-3 Eastern MuscogeeEastern Muscogee
    3    1198-1 KialegeeKialegee
    3    1199-9 Lower MuscogeeLower Muscogee
    3    1200-5 Machis Lower Creek IndianMachis Lower Creek Indian
    3    1201-3 Poarch BandPoarch Band
    3    1202-1 Principal Creek Indian NationPrincipal Creek Indian Nation
    3    1203-9 Star Clan of Muscogee CreeksStar Clan of Muscogee Creeks
    3    1204-7 ThlopthloccoThlopthlocco
    3    1205-4 TuckabacheeTuckabachee
    3    1212-0 Agua CalienteAgua Caliente
    3    1215-3 Eastern DelawareEastern Delaware
    3    1216-1 Lenni-LenapeLenni-Lenape
    3    1217-9 MunseeMunsee
    3    1218-7 Oklahoma DelawareOklahoma Delaware
    3    1219-5 Rampough MountainRampough Mountain
    3    1220-3 Sand HillSand Hill
    3    1223-7 CampoCampo
    3    1224-5 Capitan GrandeCapitan Grande
    3    1225-2 CuyapaipeCuyapaipe
    3    1226-0 La PostaLa Posta
    3    1227-8 ManzanitaManzanita
    3    1228-6 Mesa GrandeMesa Grande
    3    1229-4 San PasqualSan Pasqual
    3    1230-2 Santa YsabelSanta Ysabel
    3    1231-0 SycuanSycuan
    3    1234-4 AttacapaAttacapa
    3    1235-1 BiloxiBiloxi
    3    1236-9 Georgetown (Eastern Tribes)Georgetown (Eastern Tribes)
    3    1237-7 MoorMoor
    3    1238-5 NansemondNansemond
    3    1239-3 NatchezNatchez
    3    1240-1 Nausu WaiwashNausu Waiwash
    3    1241-9 NipmucNipmuc
    3    1242-7 PaugussettPaugussett
    3    1243-5 Pocomoke AcohonockPocomoke Acohonock
    3    1244-3 Southeastern IndiansSoutheastern Indians
    3    1245-0 SusquehanockSusquehanock
    3    1246-8 Tunica BiloxiTunica Biloxi
    3    1247-6 Waccamaw-SiousanWaccamaw-Siousan
    3    1248-4 WicomicoWicomico
    3    1265-8 AtsinaAtsina
    3    1272-4 TrinityTrinity
    3    1273-2 WhilkutWhilkut
    3    1282-3 Iowa of Kansas-NebraskaIowa of Kansas-Nebraska
    3    1283-1 Iowa of OklahomaIowa of Oklahoma
    3    1286-4 CayugaCayuga
    3    1287-2 MohawkMohawk
    3    1288-0 OneidaOneida
    3    1289-8 OnondagaOnondaga
    3    1290-6 SenecaSeneca
    3    1291-4 Seneca NationSeneca Nation
    3    1292-2 Seneca-CayugaSeneca-Cayuga
    3    1293-0 Tonawanda SenecaTonawanda Seneca
    3    1294-8 TuscaroraTuscarora
    3    1295-5 WyandotteWyandotte
    3    1306-0 Oklahoma KickapooOklahoma Kickapoo
    3    1307-8 Texas KickapooTexas Kickapoo
    3    1310-2 Oklahoma KiowaOklahoma Kiowa
    3    1313-6 JamestownJamestown
    3    1314-4 Lower ElwhaLower Elwha
    3    1315-1 Port Gamble KlallamPort Gamble Klallam
    3    1326-8 MatinecockMatinecock
    3    1327-6 MontaukMontauk
    3    1328-4 PoospatuckPoospatuck
    3    1329-2 SetauketSetauket
    3    1332-6 La JollaLa Jolla
    3    1333-4 PalaPala
    3    1334-2 PaumaPauma
    3    1335-9 PechangaPechanga
    3    1336-7 SobobaSoboba
    3    1337-5 Twenty-Nine PalmsTwenty-Nine Palms
    3    1338-3 TemeculaTemecula
    3    1345-8 Mountain MaiduMountain Maidu
    3    1346-6 NishinamNishinam
    3    1359-9 Illinois MiamiIllinois Miami
    3    1360-7 Indiana MiamiIndiana Miami
    3    1361-5 Oklahoma MiamiOklahoma Miami
    3    1366-4 AroostookAroostook
    3    1383-9 Alamo NavajoAlamo Navajo
    3    1384-7 Canoncito NavajoCanoncito Navajo
    3    1385-4 Ramah NavajoRamah Navajo
    3    1392-0 AlseaAlsea
    3    1393-8 CeliloCelilo
    3    1394-6 ColumbiaColumbia
    3    1395-3 KalapuyaKalapuya
    3    1396-1 MolalaMolala
    3    1397-9 TalakamishTalakamish
    3    1398-7 TeninoTenino
    3    1399-5 TillamookTillamook
    3    1400-1 WenatcheeWenatchee
    3    1401-9 YahooskinYahooskin
    3    1412-6 Burt Lake OttawaBurt Lake Ottawa
    3    1413-4 Michigan OttawaMichigan Ottawa
    3    1414-2 Oklahoma OttawaOklahoma Ottawa
    3    1417-5 BishopBishop
    3    1418-3 BridgeportBridgeport
    3    1419-1 Burns PaiuteBurns Paiute
    3    1420-9 CedarvilleCedarville
    3    1421-7 Fort BidwellFort Bidwell
    3    1422-5 Fort IndependenceFort Independence
    3    1423-3 KaibabKaibab
    3    1424-1 Las VegasLas Vegas
    3    1425-8 Lone PineLone Pine
    3    1426-6 LovelockLovelock
    3    1427-4 Malheur PaiuteMalheur Paiute
    3    1428-2 MoapaMoapa
    3    1429-0 Northern PaiuteNorthern Paiute
    3    1430-8 Owens ValleyOwens Valley
    3    1431-6 Pyramid LakePyramid Lake
    3    1432-4 San Juan Southern PaiuteSan Juan Southern Paiute
    3    1433-2 Southern PaiuteSouthern Paiute
    3    1434-0 Summit LakeSummit Lake
    3    1435-7 Utu Utu Gwaitu PaiuteUtu Utu Gwaitu Paiute
    3    1436-5 Walker RiverWalker River
    3    1437-3 Yerington PaiuteYerington Paiute
    3    1442-3 Indian TownshipIndian Township
    3    1443-1 Pleasant Point PassamaquoddyPleasant Point Passamaquoddy
    3    1446-4 Oklahoma PawneeOklahoma Pawnee
    3    1451-4 Oklahoma PeoriaOklahoma Peoria
    3    1454-8 Marshantucket PequotMarshantucket Pequot
    3    1457-1 Gila River Pima-MaricopaGila River Pima-Maricopa
    3    1458-9 Salt River Pima-MaricopaSalt River Pima-Maricopa
    3    1465-4 Central PomoCentral Pomo
    3    1466-2 Dry CreekDry Creek
    3    1467-0 Eastern PomoEastern Pomo
    3    1468-8 KashiaKashia
    3    1469-6 Northern PomoNorthern Pomo
    3    1470-4 Scotts ValleyScotts Valley
    3    1471-2 StonyfordStonyford
    3    1472-0 Sulphur BankSulphur Bank
    3    1475-3 Nebraska PoncaNebraska Ponca
    3    1476-1 Oklahoma PoncaOklahoma Ponca
    3    1479-5 Citizen Band PotawatomiCitizen Band Potawatomi
    3    1480-3 Forest CountyForest County
    3    1481-1 HannahvilleHannahville
    3    1482-9 Huron PotawatomiHuron Potawatomi
    3    1483-7 Pokagon PotawatomiPokagon Potawatomi
    3    1484-5 Prairie BandPrairie Band
    3    1485-2 Wisconsin PotawatomiWisconsin Potawatomi
    3    1490-2 AcomaAcoma
    3    1491-0 Arizona TewaArizona Tewa
    3    1492-8 CochitiCochiti
    3    1493-6 HopiHopi
    3    1494-4 IsletaIsleta
    3    1495-1 JemezJemez
    3    1496-9 KeresKeres
    3    1497-7 LagunaLaguna
    3    1498-5 NambeNambe
    3    1499-3 PicurisPicuris
    3    1500-8 PiroPiro
    3    1501-6 PojoaquePojoaque
    3    1502-4 San FelipeSan Felipe
    3    1503-2 San IldefonsoSan Ildefonso
    3    1504-0 San Juan PuebloSan Juan Pueblo
    3    1505-7 San Juan DeSan Juan De
    3    1506-5 San JuanSan Juan
    3    1507-3 SandiaSandia
    3    1508-1 Santa AnaSanta Ana
    3    1509-9 Santa ClaraSanta Clara
    3    1510-7 Santo DomingoSanto Domingo
    3    1511-5 TaosTaos
    3    1512-3 TesuqueTesuque
    3    1513-1 TewaTewa
    3    1514-9 TiguaTigua
    3    1515-6 ZiaZia
    3    1516-4 ZuniZuni
    3    1519-8 DuwamishDuwamish
    3    1520-6 KikiallusKikiallus
    3    1521-4 Lower SkagitLower Skagit
    3    1522-2 MuckleshootMuckleshoot
    3    1523-0 NisquallyNisqually
    3    1524-8 NooksackNooksack
    3    1525-5 Port MadisonPort Madison
    3    1526-3 PuyallupPuyallup
    3    1527-1 SamishSamish
    3    1528-9 Sauk-SuiattleSauk-Suiattle
    3    1529-7 SkokomishSkokomish
    3    1530-5 SkykomishSkykomish
    3    1531-3 SnohomishSnohomish
    3    1532-1 SnoqualmieSnoqualmie
    3    1533-9 Squaxin IslandSquaxin Island
    3    1534-7 SteilacoomSteilacoom
    3    1535-4 StillaguamishStillaguamish
    3    1536-2 SuquamishSuquamish
    3    1537-0 SwinomishSwinomish
    3    1538-8 TulalipTulalip
    3    1539-6 Upper SkagitUpper Skagit
    3    1552-9 Iowa Sac and FoxIowa Sac and Fox
    3    1553-7 Missouri Sac and FoxMissouri Sac and Fox
    3    1554-5 Oklahoma Sac and FoxOklahoma Sac and Fox
    3    1567-7 Big CypressBig Cypress
    3    1568-5 BrightonBrighton
    3    1569-3 Florida SeminoleFlorida Seminole
    3    1570-1 Hollywood SeminoleHollywood Seminole
    3    1571-9 Oklahoma SeminoleOklahoma Seminole
    3    1574-3 San ManualSan Manual
    3    1579-2 Absentee ShawneeAbsentee Shawnee
    3    1580-0 Eastern ShawneeEastern Shawnee
    3    1587-5 Battle MountainBattle Mountain
    3    1588-3 DuckwaterDuckwater
    3    1589-1 ElkoElko
    3    1590-9 ElyEly
    3    1591-7 GoshuteGoshute
    3    1592-5 PanamintPanamint
    3    1593-3 Ruby ValleyRuby Valley
    3    1594-1 Skull ValleySkull Valley
    3    1595-8 South Fork ShoshoneSouth Fork Shoshone
    3    1596-6 Te-Moak Western ShoshoneTe-Moak Western Shoshone
    3    1597-4 Timbi-Sha ShoshoneTimbi-Sha Shoshone
    3    1598-2 WashakieWashakie
    3    1599-0 Wind River ShoshoneWind River Shoshone
    3    1600-6 YombaYomba
    3    1603-0 Duck ValleyDuck Valley
    3    1604-8 FallonFallon
    3    1605-5 Fort McDermittFort McDermitt
    3    1610-5 Blackfoot SiouxBlackfoot Sioux
    3    1611-3 Brule SiouxBrule Sioux
    3    1612-1 Cheyenne River SiouxCheyenne River Sioux
    3    1613-9 Crow Creek SiouxCrow Creek Sioux
    3    1614-7 Dakota SiouxDakota Sioux
    3    1615-4 Flandreau SanteeFlandreau Santee
    3    1616-2 Fort PeckFort Peck
    3    1617-0 Lake Traverse SiouxLake Traverse Sioux
    3    1618-8 Lower Brule SiouxLower Brule Sioux
    3    1619-6 Lower SiouxLower Sioux
    3    1620-4 Mdewakanton SiouxMdewakanton Sioux
    3    1621-2 MiniconjouMiniconjou
    3    1622-0 Oglala SiouxOglala Sioux
    3    1623-8 Pine Ridge SiouxPine Ridge Sioux
    3    1624-6 Pipestone SiouxPipestone Sioux
    3    1625-3 Prairie Island SiouxPrairie Island Sioux
    3    1626-1 Prior Lake SiouxPrior Lake Sioux
    3    1627-9 Rosebud SiouxRosebud Sioux
    3    1628-7 Sans Arc SiouxSans Arc Sioux
    3    1629-5 Santee SiouxSantee Sioux
    3    1630-3 Sisseton-WahpetonSisseton-Wahpeton
    3    1631-1 Sisseton SiouxSisseton Sioux
    3    1632-9 Spirit Lake SiouxSpirit Lake Sioux
    3    1633-7 Standing Rock SiouxStanding Rock Sioux
    3    1634-5 Teton SiouxTeton Sioux
    3    1635-2 Two Kettle SiouxTwo Kettle Sioux
    3    1636-0 Upper SiouxUpper Sioux
    3    1637-8 Wahpekute SiouxWahpekute Sioux
    3    1638-6 Wahpeton SiouxWahpeton Sioux
    3    1639-4 Wazhaza SiouxWazhaza Sioux
    3    1640-2 Yankton SiouxYankton Sioux
    3    1641-0 Yanktonai SiouxYanktonai Sioux
    3    1654-3 Ak-ChinAk-Chin
    3    1655-0 Gila BendGila Bend
    3    1656-8 San XavierSan Xavier
    3    1657-6 SellsSells
    3    1668-3 Cow Creek UmpquaCow Creek Umpqua
    3    1671-7 Allen CanyonAllen Canyon
    3    1672-5 Uintah UteUintah Ute
    3    1673-3 Ute Mountain UteUte Mountain Ute
    3    1680-8 Gay Head WampanoagGay Head Wampanoag
    3    1681-6 Mashpee WampanoagMashpee Wampanoag
    3    1688-1 AlpineAlpine
    3    1689-9 CarsonCarson
    3    1690-7 DresslervilleDresslerville
    3    1697-2 Ho-chunkHo-chunk
    3    1698-0 Nebraska WinnebagoNebraska Winnebago
    3    1705-3 Table BluffTable Bluff
    3    1712-9 Barrio LibreBarrio Libre
    3    1713-7 Pascua YaquiPascua Yaqui
    3    1718-6 ChukchansiChukchansi
    3    1719-4 TachiTachi
    3    1720-2 Tule RiverTule River
    3    1725-1 CocopahCocopah
    3    1726-9 HavasupaiHavasupai
    3    1727-7 HualapaiHualapai
    3    1728-5 MaricopaMaricopa
    3    1729-3 MohaveMohave
    3    1730-1 QuechanQuechan
    3    1731-9 YavapaiYavapai
    3    1733-5 Coast YurokCoast Yurok
    3    1737-6 Alaska IndianAlaska Indian
    3    1840-8 EskimoEskimo
    3    1966-1 AleutAleut
    3    1739-2 Alaskan AthabascanAlaskan Athabascan
    3    1811-9 Southeast AlaskaSoutheast Alaska
    3    1740-0 AhtnaAhtna
    3    1741-8 AlatnaAlatna
    3    1742-6 AlexanderAlexander
    3    1743-4 AllakaketAllakaket
    3    1744-2 AlanvikAlanvik
    3    1745-9 AnvikAnvik
    3    1746-7 ArcticArctic
    3    1747-5 BeaverBeaver
    3    1748-3 Birch CreekBirch Creek
    3    1749-1 CantwellCantwell
    3    1750-9 ChalkyitsikChalkyitsik
    3    1751-7 ChickaloonChickaloon
    3    1752-5 ChistochinaChistochina
    3    1753-3 ChitinaChitina
    3    1754-1 CircleCircle
    3    1755-8 Cook InletCook Inlet
    3    1756-6 Copper CenterCopper Center
    3    1757-4 Copper RiverCopper River
    3    1758-2 Dot LakeDot Lake
    3    1759-0 DoyonDoyon
    3    1760-8 EagleEagle
    3    1761-6 EklutnaEklutna
    3    1762-4 EvansvilleEvansville
    3    1763-2 Fort YukonFort Yukon
    3    1764-0 GakonaGakona
    3    1765-7 GalenaGalena
    3    1766-5 GraylingGrayling
    3    1767-3 GulkanaGulkana
    3    1768-1 Healy LakeHealy Lake
    3    1769-9 Holy CrossHoly Cross
    3    1770-7 HughesHughes
    3    1771-5 HusliaHuslia
    3    1772-3 IliamnaIliamna
    3    1773-1 KaltagKaltag
    3    1774-9 Kluti KaahKluti Kaah
    3    1775-6 KnikKnik
    3    1776-4 KoyukukKoyukuk
    3    1777-2 Lake MinchuminaLake Minchumina
    3    1778-0 LimeLime
    3    1779-8 McgrathMcgrath
    3    1780-6 Manley Hot SpringsManley Hot Springs
    3    1781-4 Mentasta LakeMentasta Lake
    3    1782-2 MintoMinto
    3    1783-0 NenanaNenana
    3    1784-8 NikolaiNikolai
    3    1785-5 NinilchikNinilchik
    3    1786-3 NondaltonNondalton
    3    1787-1 NorthwayNorthway
    3    1788-9 NulatoNulato
    3    1789-7 Pedro BayPedro Bay
    3    1790-5 RampartRampart
    3    1791-3 RubyRuby
    3    1792-1 SalamatofSalamatof
    3    1793-9 SeldoviaSeldovia
    3    1794-7 SlanaSlana
    3    1795-4 ShagelukShageluk
    3    1796-2 StevensStevens
    3    1797-0 Stony RiverStony River
    3    1798-8 TakotnaTakotna
    3    1799-6 TanacrossTanacross
    3    1800-2 TanainaTanaina
    3    1801-0 TananaTanana
    3    1802-8 Tanana ChiefsTanana Chiefs
    3    1803-6 TazlinaTazlina
    3    1804-4 TelidaTelida
    3    1805-1 TetlinTetlin
    3    1806-9 TokTok
    3    1807-7 TyonekTyonek
    3    1808-5 VenetieVenetie
    3    1809-3 WisemanWiseman
    3    1813-5 Tlingit-HaidaTlingit-Haida
    3    1837-4 TsimshianTsimshian
    3    1814-3 AngoonAngoon
    3    1815-0 Central Council of Tlingit and Haida TribesCentral Council of Tlingit and Haida Tribes
    3    1816-8 ChilkatChilkat
    3    1817-6 ChilkootChilkoot
    3    1818-4 CraigCraig
    3    1819-2 DouglasDouglas
    3    1820-0 HaidaHaida
    3    1821-8 HoonahHoonah
    3    1822-6 HydaburgHydaburg
    3    1823-4 KakeKake
    3    1824-2 KasaanKasaan
    3    1825-9 KenaitzeKenaitze
    3    1826-7 KetchikanKetchikan
    3    1827-5 KlawockKlawock
    3    1828-3 PelicanPelican
    3    1829-1 PetersburgPetersburg
    3    1830-9 SaxmanSaxman
    3    1831-7 SitkaSitka
    3    1832-5 Tenakee SpringsTenakee Springs
    3    1833-3 TlingitTlingit
    3    1834-1 WrangellWrangell
    3    1835-8 YakutatYakutat
    3    1838-2 MetlakatlaMetlakatla
    3    1842-4 Greenland EskimoGreenland Eskimo
    3    1844-0 Inupiat EskimoInupiat Eskimo
    3    1891-1 Siberian EskimoSiberian Eskimo
    3    1896-0 Yupik EskimoYupik Eskimo
    3    1845-7 AmblerAmbler
    3    1846-5 AnaktuvukAnaktuvuk
    3    1847-3 Anaktuvuk PassAnaktuvuk Pass
    3    1848-1 Arctic Slope InupiatArctic Slope Inupiat
    3    1849-9 Arctic Slope CorporationArctic Slope Corporation
    3    1850-7 AtqasukAtqasuk
    3    1851-5 BarrowBarrow
    3    1852-3 Bering Straits InupiatBering Straits Inupiat
    3    1853-1 Brevig MissionBrevig Mission
    3    1854-9 BucklandBuckland
    3    1855-6 ChinikChinik
    3    1856-4 CouncilCouncil
    3    1857-2 DeeringDeering
    3    1858-0 ElimElim
    3    1859-8 GolovinGolovin
    3    1860-6 Inalik DiomedeInalik Diomede
    3    1861-4 InupiaqInupiaq
    3    1862-2 KaktovikKaktovik
    3    1863-0 KawerakKawerak
    3    1864-8 KianaKiana
    3    1865-5 KivalinaKivalina
    3    1866-3 KobukKobuk
    3    1867-1 KotzebueKotzebue
    3    1868-9 KoyukKoyuk
    3    1869-7 KwigukKwiguk
    3    1870-5 Mauneluk InupiatMauneluk Inupiat
    3    1871-3 Nana InupiatNana Inupiat
    3    1872-1 NoatakNoatak
    3    1873-9 NomeNome
    3    1874-7 NoorvikNoorvik
    3    1875-4 NuiqsutNuiqsut
    3    1876-2 Point HopePoint Hope
    3    1877-0 Point LayPoint Lay
    3    1878-8 SelawikSelawik
    3    1879-6 ShaktoolikShaktoolik
    3    1880-4 ShishmarefShishmaref
    3    1881-2 ShungnakShungnak
    3    1882-0 SolomonSolomon
    3    1883-8 TellerTeller
    3    1884-6 UnalakleetUnalakleet
    3    1885-3 WainwrightWainwright
    3    1886-1 WalesWales
    3    1887-9 White MountainWhite Mountain
    3    1888-7 White Mountain InupiatWhite Mountain Inupiat
    3    1889-5 Mary's IglooMary's Igloo
    3    1892-9 GambellGambell
    3    1893-7 SavoongaSavoonga
    3    1894-5 Siberian YupikSiberian Yupik
    3    1897-8 AkiachakAkiachak
    3    1898-6 AkiakAkiak
    3    1899-4 AlakanukAlakanuk
    3    1900-0 AleknagikAleknagik
    3    1901-8 AndreafskyAndreafsky
    3    1902-6 AniakAniak
    3    1903-4 AtmautluakAtmautluak
    3    1904-2 BethelBethel
    3    1905-9 Bill Moore's SloughBill Moore's Slough
    3    1906-7 Bristol Bay YupikBristol Bay Yupik
    3    1907-5 Calista YupikCalista Yupik
    3    1908-3 ChefornakChefornak
    3    1909-1 ChevakChevak
    3    1910-9 ChuathbalukChuathbaluk
    3    1911-7 Clark's PointClark's Point
    3    1912-5 Crooked CreekCrooked Creek
    3    1913-3 DillinghamDillingham
    3    1914-1 EekEek
    3    1915-8 EkukEkuk
    3    1916-6 EkwokEkwok
    3    1917-4 EmmonakEmmonak
    3    1918-2 Goodnews BayGoodnews Bay
    3    1919-0 Hooper BayHooper Bay
    3    1920-8 Iqurmuit (Russian Mission)Iqurmuit (Russian Mission)
    3    1921-6 KalskagKalskag
    3    1922-4 KasiglukKasigluk
    3    1923-2 KipnukKipnuk
    3    1924-0 KoliganekKoliganek
    3    1925-7 KongiganakKongiganak
    3    1926-5 KotlikKotlik
    3    1927-3 KwethlukKwethluk
    3    1928-1 KwigillingokKwigillingok
    3    1929-9 LevelockLevelock
    3    1930-7 Lower KalskagLower Kalskag
    3    1931-5 ManokotakManokotak
    3    1932-3 MarshallMarshall
    3    1933-1 MekoryukMekoryuk
    3    1934-9 Mountain VillageMountain Village
    3    1935-6 NaknekNaknek
    3    1936-4 NapaumuteNapaumute
    3    1937-2 NapakiakNapakiak
    3    1938-0 NapaskiakNapaskiak
    3    1939-8 NewhalenNewhalen
    3    1940-6 New StuyahokNew Stuyahok
    3    1941-4 NewtokNewtok
    3    1942-2 NightmuteNightmute
    3    1943-0 NunapitchukvNunapitchukv
    3    1944-8 OscarvilleOscarville
    3    1945-5 Pilot StationPilot Station
    3    1946-3 Pitkas PointPitkas Point
    3    1947-1 PlatinumPlatinum
    3    1948-9 Portage CreekPortage Creek
    3    1949-7 QuinhagakQuinhagak
    3    1950-5 Red DevilRed Devil
    3    1951-3 St. MichaelSt. Michael
    3    1952-1 Scammon BayScammon Bay
    3    1953-9 Sheldon's PointSheldon's Point
    3    1954-7 SleetmuteSleetmute
    3    1955-4 StebbinsStebbins
    3    1956-2 TogiakTogiak
    3    1957-0 ToksookToksook
    3    1958-8 TulukskakTulukskak
    3    1959-6 TuntutuliakTuntutuliak
    3    1960-4 TununakTununak
    3    1961-2 Twin HillsTwin Hills
    3    1962-0 Georgetown (Yupik-Eskimo)Georgetown (Yupik-Eskimo)
    3    1963-8 St. Mary'sSt. Mary's
    3    1964-6 UmkumiateUmkumiate
    3    1968-7 Alutiiq AleutAlutiiq Aleut
    3    1972-9 Bristol Bay AleutBristol Bay Aleut
    3    1984-4 Chugach AleutChugach Aleut
    3    1990-1 EyakEyak
    3    1992-7 Koniag AleutKoniag Aleut
    3    2002-4 SugpiaqSugpiaq
    3    2004-0 SuqpigaqSuqpigaq
    3    2006-5 Unangan AleutUnangan Aleut
    3    1969-5 TatitlekTatitlek
    3    1970-3 UgashikUgashik
    3    1973-7 ChignikChignik
    3    1974-5 Chignik LakeChignik Lake
    3    1975-2 EgegikEgegik
    3    1976-0 IgiugigIgiugig
    3    1977-8 Ivanof BayIvanof Bay
    3    1978-6 King SalmonKing Salmon
    3    1979-4 KokhanokKokhanok
    3    1980-2 PerryvillePerryville
    3    1981-0 Pilot PointPilot Point
    3    1982-8 Port HeidenPort Heiden
    3    1985-1 ChenegaChenega
    3    1986-9 Chugach CorporationChugach Corporation
    3    1987-7 English BayEnglish Bay
    3    1988-5 Port GrahamPort Graham
    3    1993-5 AkhiokAkhiok
    3    1994-3 AgdaaguxAgdaagux
    3    1995-0 KarlukKarluk
    3    1996-8 KodiakKodiak
    3    1997-6 Larsen BayLarsen Bay
    3    1998-4 Old HarborOld Harbor
    3    1999-2 OuzinkieOuzinkie
    3    2000-8 Port LionsPort Lions
    3    2007-3 AkutanAkutan
    3    2008-1 Aleut CorporationAleut Corporation
    3    2009-9 AleutianAleutian
    3    2010-7 Aleutian IslanderAleutian Islander
    3    2011-5 AtkaAtka
    3    2012-3 BelkofskiBelkofski
    3    2013-1 Chignik LagoonChignik Lagoon
    3    2014-9 King CoveKing Cove
    3    2015-6 False PassFalse Pass
    3    2016-4 Nelson LagoonNelson Lagoon
    3    2017-2 NikolskiNikolski
    3    2018-0 Pauloff HarborPauloff Harbor
    3    2019-8 Qagan ToyagunginQagan Toyagungin
    3    2020-6 QawalanginQawalangin
    3    2021-4 St. GeorgeSt. George
    3    2022-2 St. PaulSt. Paul
    3    2023-0 Sand PointSand Point
    3    2024-8 South NaknekSouth Naknek
    3    2025-5 UnalaskaUnalaska
    3    2026-3 UngaUnga
    2  2028-9 AsianAsian
    3    2029-7 Asian IndianAsian Indian
    3    2030-5 BangladeshiBangladeshi
    3    2031-3 BhutaneseBhutanese
    3    2032-1 BurmeseBurmese
    3    2033-9 CambodianCambodian
    3    2034-7 ChineseChinese
    3    2035-4 TaiwaneseTaiwanese
    3    2036-2 FilipinoFilipino
    3    2037-0 HmongHmong
    3    2038-8 IndonesianIndonesian
    3    2039-6 JapaneseJapanese
    3    2040-4 KoreanKorean
    3    2041-2 LaotianLaotian
    3    2042-0 MalaysianMalaysian
    3    2043-8 OkinawanOkinawan
    3    2044-6 PakistaniPakistani
    3    2045-3 Sri LankanSri Lankan
    3    2046-1 ThaiThai
    3    2047-9 VietnameseVietnamese
    3    2048-7 Iwo JimanIwo Jiman
    3    2049-5 MaldivianMaldivian
    3    2050-3 NepaleseNepalese
    3    2051-1 SingaporeanSingaporean
    3    2052-9 MadagascarMadagascar
    2  2054-5 Black or African AmericanBlack or African American
    3    2056-0 BlackBlack
    3    2058-6 African AmericanAfrican American
    3    2060-2 AfricanAfrican
    3    2067-7 BahamianBahamian
    3    2068-5 BarbadianBarbadian
    3    2069-3 DominicanDominican
    3    2070-1 Dominica IslanderDominica Islander
    3    2071-9 HaitianHaitian
    3    2072-7 JamaicanJamaican
    3    2073-5 TobagoanTobagoan
    3    2074-3 TrinidadianTrinidadian
    3    2075-0 West IndianWest Indian
    3    2061-0 BotswananBotswanan
    3    2062-8 EthiopianEthiopian
    3    2063-6 LiberianLiberian
    3    2064-4 NamibianNamibian
    3    2065-1 NigerianNigerian
    3    2066-9 ZaireanZairean
    2  2076-8 Native Hawaiian or Other Pacific IslanderNative Hawaiian or Other Pacific Islander
    3    2078-4 PolynesianPolynesian
    3    2085-9 MicronesianMicronesian
    3    2100-6 MelanesianMelanesian
    3    2500-7 Other Pacific IslanderOther Pacific Islander
    3    2079-2 Native HawaiianNative Hawaiian
    3    2080-0 SamoanSamoan
    3    2081-8 TahitianTahitian
    3    2082-6 TonganTongan
    3    2083-4 TokelauanTokelauan
    3    2086-7 Guamanian or ChamorroGuamanian or Chamorro
    3    2087-5 GuamanianGuamanian
    3    2088-3 ChamorroChamorro
    3    2089-1 Mariana IslanderMariana Islander
    3    2090-9 MarshalleseMarshallese
    3    2091-7 PalauanPalauan
    3    2092-5 CarolinianCarolinian
    3    2093-3 KosraeanKosraean
    3    2094-1 PohnpeianPohnpeian
    3    2095-8 SaipaneseSaipanese
    3    2096-6 KiribatiKiribati
    3    2097-4 ChuukeseChuukese
    3    2098-2 YapeseYapese
    3    2101-4 FijianFijian
    3    2102-2 Papua New GuineanPapua New Guinean
    3    2103-0 Solomon IslanderSolomon Islander
    3    2104-8 New HebridesNew Hebrides
    2  2106-3 WhiteWhite
    3    2108-9 EuropeanEuropean
    3    2118-8 Middle Eastern or North AfricanMiddle Eastern or North African
    3    2129-5 ArabArab
    3    2109-7 ArmenianArmenian
    3    2110-5 EnglishEnglish
    3    2111-3 FrenchFrench
    3    2112-1 GermanGerman
    3    2113-9 IrishIrish
    3    2114-7 ItalianItalian
    3    2115-4 PolishPolish
    3    2116-2 ScottishScottish
    3    2119-6 AssyrianAssyrian
    3    2120-4 EgyptianEgyptian
    3    2121-2 IranianIranian
    3    2122-0 IraqiIraqi
    3    2123-8 LebaneseLebanese
    3    2124-6 PalestinianPalestinian
    3    2125-3 SyrianSyrian
    3    2126-1 AfghanistaniAfghanistani
    3    2127-9 IsraeiliIsraeili
    2  2131-1 Other RaceNote that this term remains in the table for completeness, even though within HL7, the notion of Other code is deprecated.
    12133-7 EthnicityEthnicity Note that this is an abstract 'grouping' concept and not for use as a real concept
    2  2135-2 Hispanic or LatinoHispanic or Latino
    3    2137-8 SpaniardSpaniard
    3    2148-5 MexicanMexican
    3    2155-0 Central AmericanCentral American
    3    2165-9 South AmericanSouth American
    3    2178-2 Latin AmericanLatin American
    3    2180-8 Puerto RicanPuerto Rican
    3    2182-4 CubanCuban
    3    2184-0 DominicanDominican
    3    2138-6 AndalusianAndalusian
    3    2139-4 AsturianAsturian
    3    2140-2 CastillianCastillian
    3    2141-0 CatalonianCatalonian
    3    2142-8 Belearic IslanderBelearic Islander
    3    2143-6 GallegoGallego
    3    2144-4 ValencianValencian
    3    2145-1 CanarianCanarian
    3    2146-9 Spanish BasqueSpanish Basque
    3    2149-3 Mexican AmericanMexican American
    3    2150-1 MexicanoMexicano
    3    2151-9 ChicanoChicano
    3    2152-7 La RazaLa Raza
    3    2153-5 Mexican American IndianMexican American Indian
    3    2156-8 Costa RicanCosta Rican
    3    2157-6 GuatemalanGuatemalan
    3    2158-4 HonduranHonduran
    3    2159-2 NicaraguanNicaraguan
    3    2160-0 PanamanianPanamanian
    3    2161-8 SalvadoranSalvadoran
    3    2162-6 Central American IndianCentral American Indian
    3    2163-4 Canal ZoneCanal Zone
    3    2166-7 ArgentineanArgentinean
    3    2167-5 BolivianBolivian
    3    2168-3 ChileanChilean
    3    2169-1 ColombianColombian
    3    2170-9 EcuadorianEcuadorian
    3    2171-7 ParaguayanParaguayan
    3    2172-5 PeruvianPeruvian
    3    2173-3 UruguayanUruguayan
    3    2174-1 VenezuelanVenezuelan
    3    2175-8 South American IndianSouth American Indian
    3    2176-6 CriolloCriollo
    2  2186-5 Not Hispanic or LatinoNote that this term remains in the table for completeness, even though within HL7, the notion of "not otherwise coded" term is deprecated.
    "},"url":"urn:oid:2.16.840.1.113883.6.238","identifier":[{"value":"2.16.840.1.113883.6.238"}],"version":"3.1.0","name":"RaceAndEthnicityCDC","title":"Race & Ethnicity - CDC","status":"active","experimental":false,"date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://hl7.org"}]}],"description":" The U.S. Centers for Disease Control and Prevention (CDC) has prepared a code set for use in codingrace and ethnicity data. This code set is based on current federal standards for classifying data onrace and ethnicity, specifically the minimum race and ethnicity categories defined by the U.S. Office ofManagement and Budget (OMB) and a more detailed set of race and ethnicity categories maintainedby the U.S. Bureau of the Census (BC). The main purpose of the code set is to facilitate use of federalstandards for classifying data on race and ethnicity when these data are exchanged, stored, retrieved,or analyzed in electronic form. At the same time, the code set can be applied to paper-based recordsystems to the extent that these systems are used to collect, maintain, and report data on race andethnicity in accordance with current federal standards. Source: [Race and Ethnicity Code Set Version 1.0](https://www.cdc.gov/phin/resources/vocabulary/documents/cdc-race--ethnicity-background-and-purpose.pdf).","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"caseSensitive":true,"hierarchyMeaning":"is-a","content":"complete","count":966,"property":[{"code":"abstract","description":"True if an element is considered 'abstract' - in other words, the code is not for use as a real concept","type":"boolean"}],"concept":[{"code":"1000-9","display":"Race","definition":"Race, Note that this is an abstract 'grouping' concept and not for use as a real concept","property":[{"code":"abstract","valueBoolean":true}],"concept":[{"code":"1002-5","display":"American Indian or Alaska Native","definition":"American Indian or Alaska Native","concept":[{"code":"1004-1","display":"American Indian","definition":"American Indian"},{"code":"1735-0","display":"Alaska Native","definition":"Alaska Native"},{"code":"1006-6","display":"Abenaki","definition":"Abenaki"},{"code":"1008-2","display":"Algonquian","definition":"Algonquian"},{"code":"1010-8","display":"Apache","definition":"Apache"},{"code":"1021-5","display":"Arapaho","definition":"Arapaho"},{"code":"1026-4","display":"Arikara","definition":"Arikara"},{"code":"1028-0","display":"Assiniboine","definition":"Assiniboine"},{"code":"1030-6","display":"Assiniboine Sioux","definition":"Assiniboine Sioux"},{"code":"1033-0","display":"Bannock","definition":"Bannock"},{"code":"1035-5","display":"Blackfeet","definition":"Blackfeet"},{"code":"1037-1","display":"Brotherton","definition":"Brotherton"},{"code":"1039-7","display":"Burt Lake Band","definition":"Burt Lake Band"},{"code":"1041-3","display":"Caddo","definition":"Caddo"},{"code":"1044-7","display":"Cahuilla","definition":"Cahuilla"},{"code":"1053-8","display":"California Tribes","definition":"California Tribes"},{"code":"1068-6","display":"Canadian and Latin American Indian","definition":"Canadian and Latin American Indian"},{"code":"1076-9","display":"Catawba","definition":"Catawba"},{"code":"1078-5","display":"Cayuse","definition":"Cayuse"},{"code":"1080-1","display":"Chehalis","definition":"Chehalis"},{"code":"1082-7","display":"Chemakuan","definition":"Chemakuan"},{"code":"1086-8","display":"Chemehuevi","definition":"Chemehuevi"},{"code":"1088-4","display":"Cherokee","definition":"Cherokee"},{"code":"1100-7","display":"Cherokee Shawnee","definition":"Cherokee Shawnee"},{"code":"1102-3","display":"Cheyenne","definition":"Cheyenne"},{"code":"1106-4","display":"Cheyenne-Arapaho","definition":"Cheyenne-Arapaho"},{"code":"1108-0","display":"Chickahominy","definition":"Chickahominy"},{"code":"1112-2","display":"Chickasaw","definition":"Chickasaw"},{"code":"1114-8","display":"Chinook","definition":"Chinook"},{"code":"1123-9","display":"Chippewa","definition":"Chippewa"},{"code":"1150-2","display":"Chippewa Cree","definition":"Chippewa Cree"},{"code":"1153-6","display":"Chitimacha","definition":"Chitimacha"},{"code":"1155-1","display":"Choctaw","definition":"Choctaw"},{"code":"1162-7","display":"Chumash","definition":"Chumash"},{"code":"1165-0","display":"Clear Lake","definition":"Clear Lake"},{"code":"1167-6","display":"Coeur D'Alene","definition":"Coeur D'Alene"},{"code":"1169-2","display":"Coharie","definition":"Coharie"},{"code":"1171-8","display":"Colorado River","definition":"Colorado River"},{"code":"1173-4","display":"Colville","definition":"Colville"},{"code":"1175-9","display":"Comanche","definition":"Comanche"},{"code":"1178-3","display":"Coos, Lower Umpqua, Siuslaw","definition":"Coos, Lower Umpqua, Siuslaw"},{"code":"1180-9","display":"Coos","definition":"Coos"},{"code":"1182-5","display":"Coquilles","definition":"Coquilles"},{"code":"1184-1","display":"Costanoan","definition":"Costanoan"},{"code":"1186-6","display":"Coushatta","definition":"Coushatta"},{"code":"1189-0","display":"Cowlitz","definition":"Cowlitz"},{"code":"1191-6","display":"Cree","definition":"Cree"},{"code":"1193-2","display":"Creek","definition":"Creek"},{"code":"1207-0","display":"Croatan","definition":"Croatan"},{"code":"1209-6","display":"Crow","definition":"Crow"},{"code":"1211-2","display":"Cupeno","definition":"Cupeno"},{"code":"1214-6","display":"Delaware","definition":"Delaware"},{"code":"1222-9","display":"Diegueno","definition":"Diegueno"},{"code":"1233-6","display":"Eastern Tribes","definition":"Eastern Tribes"},{"code":"1250-0","display":"Esselen","definition":"Esselen"},{"code":"1252-6","display":"Fort Belknap","definition":"Fort Belknap"},{"code":"1254-2","display":"Fort Berthold","definition":"Fort Berthold"},{"code":"1256-7","display":"Fort Mcdowell","definition":"Fort Mcdowell"},{"code":"1258-3","display":"Fort Hall","definition":"Fort Hall"},{"code":"1260-9","display":"Gabrieleno","definition":"Gabrieleno"},{"code":"1262-5","display":"Grand Ronde","definition":"Grand Ronde"},{"code":"1264-1","display":"Gros Ventres","definition":"Gros Ventres"},{"code":"1267-4","display":"Haliwa","definition":"Haliwa"},{"code":"1269-0","display":"Hidatsa","definition":"Hidatsa"},{"code":"1271-6","display":"Hoopa","definition":"Hoopa"},{"code":"1275-7","display":"Hoopa Extension","definition":"Hoopa Extension"},{"code":"1277-3","display":"Houma","definition":"Houma"},{"code":"1279-9","display":"Inaja-Cosmit","definition":"Inaja-Cosmit"},{"code":"1281-5","display":"Iowa","definition":"Iowa"},{"code":"1285-6","display":"Iroquois","definition":"Iroquois"},{"code":"1297-1","display":"Juaneno","definition":"Juaneno"},{"code":"1299-7","display":"Kalispel","definition":"Kalispel"},{"code":"1301-1","display":"Karuk","definition":"Karuk"},{"code":"1303-7","display":"Kaw","definition":"Kaw"},{"code":"1305-2","display":"Kickapoo","definition":"Kickapoo"},{"code":"1309-4","display":"Kiowa","definition":"Kiowa"},{"code":"1312-8","display":"Klallam","definition":"Klallam"},{"code":"1317-7","display":"Klamath","definition":"Klamath"},{"code":"1319-3","display":"Konkow","definition":"Konkow"},{"code":"1321-9","display":"Kootenai","definition":"Kootenai"},{"code":"1323-5","display":"Lassik","definition":"Lassik"},{"code":"1325-0","display":"Long Island","definition":"Long Island"},{"code":"1331-8","display":"Luiseno","definition":"Luiseno"},{"code":"1340-9","display":"Lumbee","definition":"Lumbee"},{"code":"1342-5","display":"Lummi","definition":"Lummi"},{"code":"1344-1","display":"Maidu","definition":"Maidu"},{"code":"1348-2","display":"Makah","definition":"Makah"},{"code":"1350-8","display":"Maliseet","definition":"Maliseet"},{"code":"1352-4","display":"Mandan","definition":"Mandan"},{"code":"1354-0","display":"Mattaponi","definition":"Mattaponi"},{"code":"1356-5","display":"Menominee","definition":"Menominee"},{"code":"1358-1","display":"Miami","definition":"Miami"},{"code":"1363-1","display":"Miccosukee","definition":"Miccosukee"},{"code":"1365-6","display":"Micmac","definition":"Micmac"},{"code":"1368-0","display":"Mission Indians","definition":"Mission Indians"},{"code":"1370-6","display":"Miwok","definition":"Miwok"},{"code":"1372-2","display":"Modoc","definition":"Modoc"},{"code":"1374-8","display":"Mohegan","definition":"Mohegan"},{"code":"1376-3","display":"Mono","definition":"Mono"},{"code":"1378-9","display":"Nanticoke","definition":"Nanticoke"},{"code":"1380-5","display":"Narragansett","definition":"Narragansett"},{"code":"1382-1","display":"Navajo","definition":"Navajo"},{"code":"1387-0","display":"Nez Perce","definition":"Nez Perce"},{"code":"1389-6","display":"Nomalaki","definition":"Nomalaki"},{"code":"1391-2","display":"Northwest Tribes","definition":"Northwest Tribes"},{"code":"1403-5","display":"Omaha","definition":"Omaha"},{"code":"1405-0","display":"Oregon Athabaskan","definition":"Oregon Athabaskan"},{"code":"1407-6","display":"Osage","definition":"Osage"},{"code":"1409-2","display":"Otoe-Missouria","definition":"Otoe-Missouria"},{"code":"1411-8","display":"Ottawa","definition":"Ottawa"},{"code":"1416-7","display":"Paiute","definition":"Paiute"},{"code":"1439-9","display":"Pamunkey","definition":"Pamunkey"},{"code":"1441-5","display":"Passamaquoddy","definition":"Passamaquoddy"},{"code":"1445-6","display":"Pawnee","definition":"Pawnee"},{"code":"1448-0","display":"Penobscot","definition":"Penobscot"},{"code":"1450-6","display":"Peoria","definition":"Peoria"},{"code":"1453-0","display":"Pequot","definition":"Pequot"},{"code":"1456-3","display":"Pima","definition":"Pima"},{"code":"1460-5","display":"Piscataway","definition":"Piscataway"},{"code":"1462-1","display":"Pit River","definition":"Pit River"},{"code":"1464-7","display":"Pomo","definition":"Pomo"},{"code":"1474-6","display":"Ponca","definition":"Ponca"},{"code":"1478-7","display":"Potawatomi","definition":"Potawatomi"},{"code":"1487-8","display":"Powhatan","definition":"Powhatan"},{"code":"1489-4","display":"Pueblo","definition":"Pueblo"},{"code":"1518-0","display":"Puget Sound Salish","definition":"Puget Sound Salish"},{"code":"1541-2","display":"Quapaw","definition":"Quapaw"},{"code":"1543-8","display":"Quinault","definition":"Quinault"},{"code":"1545-3","display":"Rappahannock","definition":"Rappahannock"},{"code":"1547-9","display":"Reno-Sparks","definition":"Reno-Sparks"},{"code":"1549-5","display":"Round Valley","definition":"Round Valley"},{"code":"1551-1","display":"Sac and Fox","definition":"Sac and Fox"},{"code":"1556-0","display":"Salinan","definition":"Salinan"},{"code":"1558-6","display":"Salish","definition":"Salish"},{"code":"1560-2","display":"Salish and Kootenai","definition":"Salish and Kootenai"},{"code":"1562-8","display":"Schaghticoke","definition":"Schaghticoke"},{"code":"1564-4","display":"Scott Valley","definition":"Scott Valley"},{"code":"1566-9","display":"Seminole","definition":"Seminole"},{"code":"1573-5","display":"Serrano","definition":"Serrano"},{"code":"1576-8","display":"Shasta","definition":"Shasta"},{"code":"1578-4","display":"Shawnee","definition":"Shawnee"},{"code":"1582-6","display":"Shinnecock","definition":"Shinnecock"},{"code":"1584-2","display":"Shoalwater Bay","definition":"Shoalwater Bay"},{"code":"1586-7","display":"Shoshone","definition":"Shoshone"},{"code":"1602-2","display":"Shoshone Paiute","definition":"Shoshone Paiute"},{"code":"1607-1","display":"Siletz","definition":"Siletz"},{"code":"1609-7","display":"Sioux","definition":"Sioux"},{"code":"1643-6","display":"Siuslaw","definition":"Siuslaw"},{"code":"1645-1","display":"Spokane","definition":"Spokane"},{"code":"1647-7","display":"Stewart","definition":"Stewart"},{"code":"1649-3","display":"Stockbridge","definition":"Stockbridge"},{"code":"1651-9","display":"Susanville","definition":"Susanville"},{"code":"1653-5","display":"Tohono O'Odham","definition":"Tohono O'Odham"},{"code":"1659-2","display":"Tolowa","definition":"Tolowa"},{"code":"1661-8","display":"Tonkawa","definition":"Tonkawa"},{"code":"1663-4","display":"Tygh","definition":"Tygh"},{"code":"1665-9","display":"Umatilla","definition":"Umatilla"},{"code":"1667-5","display":"Umpqua","definition":"Umpqua"},{"code":"1670-9","display":"Ute","definition":"Ute"},{"code":"1675-8","display":"Wailaki","definition":"Wailaki"},{"code":"1677-4","display":"Walla-Walla","definition":"Walla-Walla"},{"code":"1679-0","display":"Wampanoag","definition":"Wampanoag"},{"code":"1683-2","display":"Warm Springs","definition":"Warm Springs"},{"code":"1685-7","display":"Wascopum","definition":"Wascopum"},{"code":"1687-3","display":"Washoe","definition":"Washoe"},{"code":"1692-3","display":"Wichita","definition":"Wichita"},{"code":"1694-9","display":"Wind River","definition":"Wind River"},{"code":"1696-4","display":"Winnebago","definition":"Winnebago"},{"code":"1700-4","display":"Winnemucca","definition":"Winnemucca"},{"code":"1702-0","display":"Wintun","definition":"Wintun"},{"code":"1704-6","display":"Wiyot","definition":"Wiyot"},{"code":"1707-9","display":"Yakama","definition":"Yakama"},{"code":"1709-5","display":"Yakama Cowlitz","definition":"Yakama Cowlitz"},{"code":"1711-1","display":"Yaqui","definition":"Yaqui"},{"code":"1715-2","display":"Yavapai Apache","definition":"Yavapai Apache"},{"code":"1717-8","display":"Yokuts","definition":"Yokuts"},{"code":"1722-8","display":"Yuchi","definition":"Yuchi"},{"code":"1724-4","display":"Yuman","definition":"Yuman"},{"code":"1732-7","display":"Yurok","definition":"Yurok"},{"code":"1011-6","display":"Chiricahua","definition":"Chiricahua"},{"code":"1012-4","display":"Fort Sill Apache","definition":"Fort Sill Apache"},{"code":"1013-2","display":"Jicarilla Apache","definition":"Jicarilla Apache"},{"code":"1014-0","display":"Lipan Apache","definition":"Lipan Apache"},{"code":"1015-7","display":"Mescalero Apache","definition":"Mescalero Apache"},{"code":"1016-5","display":"Oklahoma Apache","definition":"Oklahoma Apache"},{"code":"1017-3","display":"Payson Apache","definition":"Payson Apache"},{"code":"1018-1","display":"San Carlos Apache","definition":"San Carlos Apache"},{"code":"1019-9","display":"White Mountain Apache","definition":"White Mountain Apache"},{"code":"1022-3","display":"Northern Arapaho","definition":"Northern Arapaho"},{"code":"1023-1","display":"Southern Arapaho","definition":"Southern Arapaho"},{"code":"1024-9","display":"Wind River Arapaho","definition":"Wind River Arapaho"},{"code":"1031-4","display":"Fort Peck Assiniboine Sioux","definition":"Fort Peck Assiniboine Sioux"},{"code":"1042-1","display":"Oklahoma Cado","definition":"Oklahoma Cado"},{"code":"1045-4","display":"Agua Caliente Cahuilla","definition":"Agua Caliente Cahuilla"},{"code":"1046-2","display":"Augustine","definition":"Augustine"},{"code":"1047-0","display":"Cabazon","definition":"Cabazon"},{"code":"1048-8","display":"Los Coyotes","definition":"Los Coyotes"},{"code":"1049-6","display":"Morongo","definition":"Morongo"},{"code":"1050-4","display":"Santa Rosa Cahuilla","definition":"Santa Rosa Cahuilla"},{"code":"1051-2","display":"Torres-Martinez","definition":"Torres-Martinez"},{"code":"1054-6","display":"Cahto","definition":"Cahto"},{"code":"1055-3","display":"Chimariko","definition":"Chimariko"},{"code":"1056-1","display":"Coast Miwok","definition":"Coast Miwok"},{"code":"1057-9","display":"Digger","definition":"Digger"},{"code":"1058-7","display":"Kawaiisu","definition":"Kawaiisu"},{"code":"1059-5","display":"Kern River","definition":"Kern River"},{"code":"1060-3","display":"Mattole","definition":"Mattole"},{"code":"1061-1","display":"Red Wood","definition":"Red Wood"},{"code":"1062-9","display":"Santa Rosa","definition":"Santa Rosa"},{"code":"1063-7","display":"Takelma","definition":"Takelma"},{"code":"1064-5","display":"Wappo","definition":"Wappo"},{"code":"1065-2","display":"Yana","definition":"Yana"},{"code":"1066-0","display":"Yuki","definition":"Yuki"},{"code":"1069-4","display":"Canadian Indian","definition":"Canadian Indian"},{"code":"1070-2","display":"Central American Indian","definition":"Central American Indian"},{"code":"1071-0","display":"French American Indian","definition":"French American Indian"},{"code":"1072-8","display":"Mexican American Indian","definition":"Mexican American Indian"},{"code":"1073-6","display":"South American Indian","definition":"South American Indian"},{"code":"1074-4","display":"Spanish American Indian","definition":"Spanish American Indian"},{"code":"1083-5","display":"Hoh","definition":"Hoh"},{"code":"1084-3","display":"Quileute","definition":"Quileute"},{"code":"1089-2","display":"Cherokee Alabama","definition":"Cherokee Alabama"},{"code":"1090-0","display":"Cherokees of Northeast Alabama","definition":"Cherokees of Northeast Alabama"},{"code":"1091-8","display":"Cherokees of Southeast Alabama","definition":"Cherokees of Southeast Alabama"},{"code":"1092-6","display":"Eastern Cherokee","definition":"Eastern Cherokee"},{"code":"1093-4","display":"Echota Cherokee","definition":"Echota Cherokee"},{"code":"1094-2","display":"Etowah Cherokee","definition":"Etowah Cherokee"},{"code":"1095-9","display":"Northern Cherokee","definition":"Northern Cherokee"},{"code":"1096-7","display":"Tuscola","definition":"Tuscola"},{"code":"1097-5","display":"United Keetowah Band of Cherokee","definition":"United Keetowah Band of Cherokee"},{"code":"1098-3","display":"Western Cherokee","definition":"Western Cherokee"},{"code":"1103-1","display":"Northern Cheyenne","definition":"Northern Cheyenne"},{"code":"1104-9","display":"Southern Cheyenne","definition":"Southern Cheyenne"},{"code":"1109-8","display":"Eastern Chickahominy","definition":"Eastern Chickahominy"},{"code":"1110-6","display":"Western Chickahominy","definition":"Western Chickahominy"},{"code":"1115-5","display":"Clatsop","definition":"Clatsop"},{"code":"1116-3","display":"Columbia River Chinook","definition":"Columbia River Chinook"},{"code":"1117-1","display":"Kathlamet","definition":"Kathlamet"},{"code":"1118-9","display":"Upper Chinook","definition":"Upper Chinook"},{"code":"1119-7","display":"Wakiakum Chinook","definition":"Wakiakum Chinook"},{"code":"1120-5","display":"Willapa Chinook","definition":"Willapa Chinook"},{"code":"1121-3","display":"Wishram","definition":"Wishram"},{"code":"1124-7","display":"Bad River","definition":"Bad River"},{"code":"1125-4","display":"Bay Mills Chippewa","definition":"Bay Mills Chippewa"},{"code":"1126-2","display":"Bois Forte","definition":"Bois Forte"},{"code":"1127-0","display":"Burt Lake Chippewa","definition":"Burt Lake Chippewa"},{"code":"1128-8","display":"Fond du Lac","definition":"Fond du Lac"},{"code":"1129-6","display":"Grand Portage","definition":"Grand Portage"},{"code":"1130-4","display":"Grand Traverse Band of Ottawa/Chippewa","definition":"Grand Traverse Band of Ottawa/Chippewa"},{"code":"1131-2","display":"Keweenaw","definition":"Keweenaw"},{"code":"1132-0","display":"Lac Courte Oreilles","definition":"Lac Courte Oreilles"},{"code":"1133-8","display":"Lac du Flambeau","definition":"Lac du Flambeau"},{"code":"1134-6","display":"Lac Vieux Desert Chippewa","definition":"Lac Vieux Desert Chippewa"},{"code":"1135-3","display":"Lake Superior","definition":"Lake Superior"},{"code":"1136-1","display":"Leech Lake","definition":"Leech Lake"},{"code":"1137-9","display":"Little Shell Chippewa","definition":"Little Shell Chippewa"},{"code":"1138-7","display":"Mille Lacs","definition":"Mille Lacs"},{"code":"1139-5","display":"Minnesota Chippewa","definition":"Minnesota Chippewa"},{"code":"1140-3","display":"Ontonagon","definition":"Ontonagon"},{"code":"1141-1","display":"Red Cliff Chippewa","definition":"Red Cliff Chippewa"},{"code":"1142-9","display":"Red Lake Chippewa","definition":"Red Lake Chippewa"},{"code":"1143-7","display":"Saginaw Chippewa","definition":"Saginaw Chippewa"},{"code":"1144-5","display":"St. Croix Chippewa","definition":"St. Croix Chippewa"},{"code":"1145-2","display":"Sault Ste. Marie Chippewa","definition":"Sault Ste. Marie Chippewa"},{"code":"1146-0","display":"Sokoagon Chippewa","definition":"Sokoagon Chippewa"},{"code":"1147-8","display":"Turtle Mountain","definition":"Turtle Mountain"},{"code":"1148-6","display":"White Earth","definition":"White Earth"},{"code":"1151-0","display":"Rocky Boy's Chippewa Cree","definition":"Rocky Boy's Chippewa Cree"},{"code":"1156-9","display":"Clifton Choctaw","definition":"Clifton Choctaw"},{"code":"1157-7","display":"Jena Choctaw","definition":"Jena Choctaw"},{"code":"1158-5","display":"Mississippi Choctaw","definition":"Mississippi Choctaw"},{"code":"1159-3","display":"Mowa Band of Choctaw","definition":"Mowa Band of Choctaw"},{"code":"1160-1","display":"Oklahoma Choctaw","definition":"Oklahoma Choctaw"},{"code":"1163-5","display":"Santa Ynez","definition":"Santa Ynez"},{"code":"1176-7","display":"Oklahoma Comanche","definition":"Oklahoma Comanche"},{"code":"1187-4","display":"Alabama Coushatta","definition":"Alabama Coushatta"},{"code":"1194-0","display":"Alabama Creek","definition":"Alabama Creek"},{"code":"1195-7","display":"Alabama Quassarte","definition":"Alabama Quassarte"},{"code":"1196-5","display":"Eastern Creek","definition":"Eastern Creek"},{"code":"1197-3","display":"Eastern Muscogee","definition":"Eastern Muscogee"},{"code":"1198-1","display":"Kialegee","definition":"Kialegee"},{"code":"1199-9","display":"Lower Muscogee","definition":"Lower Muscogee"},{"code":"1200-5","display":"Machis Lower Creek Indian","definition":"Machis Lower Creek Indian"},{"code":"1201-3","display":"Poarch Band","definition":"Poarch Band"},{"code":"1202-1","display":"Principal Creek Indian Nation","definition":"Principal Creek Indian Nation"},{"code":"1203-9","display":"Star Clan of Muscogee Creeks","definition":"Star Clan of Muscogee Creeks"},{"code":"1204-7","display":"Thlopthlocco","definition":"Thlopthlocco"},{"code":"1205-4","display":"Tuckabachee","definition":"Tuckabachee"},{"code":"1212-0","display":"Agua Caliente","definition":"Agua Caliente"},{"code":"1215-3","display":"Eastern Delaware","definition":"Eastern Delaware"},{"code":"1216-1","display":"Lenni-Lenape","definition":"Lenni-Lenape"},{"code":"1217-9","display":"Munsee","definition":"Munsee"},{"code":"1218-7","display":"Oklahoma Delaware","definition":"Oklahoma Delaware"},{"code":"1219-5","display":"Rampough Mountain","definition":"Rampough Mountain"},{"code":"1220-3","display":"Sand Hill","definition":"Sand Hill"},{"code":"1223-7","display":"Campo","definition":"Campo"},{"code":"1224-5","display":"Capitan Grande","definition":"Capitan Grande"},{"code":"1225-2","display":"Cuyapaipe","definition":"Cuyapaipe"},{"code":"1226-0","display":"La Posta","definition":"La Posta"},{"code":"1227-8","display":"Manzanita","definition":"Manzanita"},{"code":"1228-6","display":"Mesa Grande","definition":"Mesa Grande"},{"code":"1229-4","display":"San Pasqual","definition":"San Pasqual"},{"code":"1230-2","display":"Santa Ysabel","definition":"Santa Ysabel"},{"code":"1231-0","display":"Sycuan","definition":"Sycuan"},{"code":"1234-4","display":"Attacapa","definition":"Attacapa"},{"code":"1235-1","display":"Biloxi","definition":"Biloxi"},{"code":"1236-9","display":"Georgetown (Eastern Tribes)","definition":"Georgetown (Eastern Tribes)"},{"code":"1237-7","display":"Moor","definition":"Moor"},{"code":"1238-5","display":"Nansemond","definition":"Nansemond"},{"code":"1239-3","display":"Natchez","definition":"Natchez"},{"code":"1240-1","display":"Nausu Waiwash","definition":"Nausu Waiwash"},{"code":"1241-9","display":"Nipmuc","definition":"Nipmuc"},{"code":"1242-7","display":"Paugussett","definition":"Paugussett"},{"code":"1243-5","display":"Pocomoke Acohonock","definition":"Pocomoke Acohonock"},{"code":"1244-3","display":"Southeastern Indians","definition":"Southeastern Indians"},{"code":"1245-0","display":"Susquehanock","definition":"Susquehanock"},{"code":"1246-8","display":"Tunica Biloxi","definition":"Tunica Biloxi"},{"code":"1247-6","display":"Waccamaw-Siousan","definition":"Waccamaw-Siousan"},{"code":"1248-4","display":"Wicomico","definition":"Wicomico"},{"code":"1265-8","display":"Atsina","definition":"Atsina"},{"code":"1272-4","display":"Trinity","definition":"Trinity"},{"code":"1273-2","display":"Whilkut","definition":"Whilkut"},{"code":"1282-3","display":"Iowa of Kansas-Nebraska","definition":"Iowa of Kansas-Nebraska"},{"code":"1283-1","display":"Iowa of Oklahoma","definition":"Iowa of Oklahoma"},{"code":"1286-4","display":"Cayuga","definition":"Cayuga"},{"code":"1287-2","display":"Mohawk","definition":"Mohawk"},{"code":"1288-0","display":"Oneida","definition":"Oneida"},{"code":"1289-8","display":"Onondaga","definition":"Onondaga"},{"code":"1290-6","display":"Seneca","definition":"Seneca"},{"code":"1291-4","display":"Seneca Nation","definition":"Seneca Nation"},{"code":"1292-2","display":"Seneca-Cayuga","definition":"Seneca-Cayuga"},{"code":"1293-0","display":"Tonawanda Seneca","definition":"Tonawanda Seneca"},{"code":"1294-8","display":"Tuscarora","definition":"Tuscarora"},{"code":"1295-5","display":"Wyandotte","definition":"Wyandotte"},{"code":"1306-0","display":"Oklahoma Kickapoo","definition":"Oklahoma Kickapoo"},{"code":"1307-8","display":"Texas Kickapoo","definition":"Texas Kickapoo"},{"code":"1310-2","display":"Oklahoma Kiowa","definition":"Oklahoma Kiowa"},{"code":"1313-6","display":"Jamestown","definition":"Jamestown"},{"code":"1314-4","display":"Lower Elwha","definition":"Lower Elwha"},{"code":"1315-1","display":"Port Gamble Klallam","definition":"Port Gamble Klallam"},{"code":"1326-8","display":"Matinecock","definition":"Matinecock"},{"code":"1327-6","display":"Montauk","definition":"Montauk"},{"code":"1328-4","display":"Poospatuck","definition":"Poospatuck"},{"code":"1329-2","display":"Setauket","definition":"Setauket"},{"code":"1332-6","display":"La Jolla","definition":"La Jolla"},{"code":"1333-4","display":"Pala","definition":"Pala"},{"code":"1334-2","display":"Pauma","definition":"Pauma"},{"code":"1335-9","display":"Pechanga","definition":"Pechanga"},{"code":"1336-7","display":"Soboba","definition":"Soboba"},{"code":"1337-5","display":"Twenty-Nine Palms","definition":"Twenty-Nine Palms"},{"code":"1338-3","display":"Temecula","definition":"Temecula"},{"code":"1345-8","display":"Mountain Maidu","definition":"Mountain Maidu"},{"code":"1346-6","display":"Nishinam","definition":"Nishinam"},{"code":"1359-9","display":"Illinois Miami","definition":"Illinois Miami"},{"code":"1360-7","display":"Indiana Miami","definition":"Indiana Miami"},{"code":"1361-5","display":"Oklahoma Miami","definition":"Oklahoma Miami"},{"code":"1366-4","display":"Aroostook","definition":"Aroostook"},{"code":"1383-9","display":"Alamo Navajo","definition":"Alamo Navajo"},{"code":"1384-7","display":"Canoncito Navajo","definition":"Canoncito Navajo"},{"code":"1385-4","display":"Ramah Navajo","definition":"Ramah Navajo"},{"code":"1392-0","display":"Alsea","definition":"Alsea"},{"code":"1393-8","display":"Celilo","definition":"Celilo"},{"code":"1394-6","display":"Columbia","definition":"Columbia"},{"code":"1395-3","display":"Kalapuya","definition":"Kalapuya"},{"code":"1396-1","display":"Molala","definition":"Molala"},{"code":"1397-9","display":"Talakamish","definition":"Talakamish"},{"code":"1398-7","display":"Tenino","definition":"Tenino"},{"code":"1399-5","display":"Tillamook","definition":"Tillamook"},{"code":"1400-1","display":"Wenatchee","definition":"Wenatchee"},{"code":"1401-9","display":"Yahooskin","definition":"Yahooskin"},{"code":"1412-6","display":"Burt Lake Ottawa","definition":"Burt Lake Ottawa"},{"code":"1413-4","display":"Michigan Ottawa","definition":"Michigan Ottawa"},{"code":"1414-2","display":"Oklahoma Ottawa","definition":"Oklahoma Ottawa"},{"code":"1417-5","display":"Bishop","definition":"Bishop"},{"code":"1418-3","display":"Bridgeport","definition":"Bridgeport"},{"code":"1419-1","display":"Burns Paiute","definition":"Burns Paiute"},{"code":"1420-9","display":"Cedarville","definition":"Cedarville"},{"code":"1421-7","display":"Fort Bidwell","definition":"Fort Bidwell"},{"code":"1422-5","display":"Fort Independence","definition":"Fort Independence"},{"code":"1423-3","display":"Kaibab","definition":"Kaibab"},{"code":"1424-1","display":"Las Vegas","definition":"Las Vegas"},{"code":"1425-8","display":"Lone Pine","definition":"Lone Pine"},{"code":"1426-6","display":"Lovelock","definition":"Lovelock"},{"code":"1427-4","display":"Malheur Paiute","definition":"Malheur Paiute"},{"code":"1428-2","display":"Moapa","definition":"Moapa"},{"code":"1429-0","display":"Northern Paiute","definition":"Northern Paiute"},{"code":"1430-8","display":"Owens Valley","definition":"Owens Valley"},{"code":"1431-6","display":"Pyramid Lake","definition":"Pyramid Lake"},{"code":"1432-4","display":"San Juan Southern Paiute","definition":"San Juan Southern Paiute"},{"code":"1433-2","display":"Southern Paiute","definition":"Southern Paiute"},{"code":"1434-0","display":"Summit Lake","definition":"Summit Lake"},{"code":"1435-7","display":"Utu Utu Gwaitu Paiute","definition":"Utu Utu Gwaitu Paiute"},{"code":"1436-5","display":"Walker River","definition":"Walker River"},{"code":"1437-3","display":"Yerington Paiute","definition":"Yerington Paiute"},{"code":"1442-3","display":"Indian Township","definition":"Indian Township"},{"code":"1443-1","display":"Pleasant Point Passamaquoddy","definition":"Pleasant Point Passamaquoddy"},{"code":"1446-4","display":"Oklahoma Pawnee","definition":"Oklahoma Pawnee"},{"code":"1451-4","display":"Oklahoma Peoria","definition":"Oklahoma Peoria"},{"code":"1454-8","display":"Marshantucket Pequot","definition":"Marshantucket Pequot"},{"code":"1457-1","display":"Gila River Pima-Maricopa","definition":"Gila River Pima-Maricopa"},{"code":"1458-9","display":"Salt River Pima-Maricopa","definition":"Salt River Pima-Maricopa"},{"code":"1465-4","display":"Central Pomo","definition":"Central Pomo"},{"code":"1466-2","display":"Dry Creek","definition":"Dry Creek"},{"code":"1467-0","display":"Eastern Pomo","definition":"Eastern Pomo"},{"code":"1468-8","display":"Kashia","definition":"Kashia"},{"code":"1469-6","display":"Northern Pomo","definition":"Northern Pomo"},{"code":"1470-4","display":"Scotts Valley","definition":"Scotts Valley"},{"code":"1471-2","display":"Stonyford","definition":"Stonyford"},{"code":"1472-0","display":"Sulphur Bank","definition":"Sulphur Bank"},{"code":"1475-3","display":"Nebraska Ponca","definition":"Nebraska Ponca"},{"code":"1476-1","display":"Oklahoma Ponca","definition":"Oklahoma Ponca"},{"code":"1479-5","display":"Citizen Band Potawatomi","definition":"Citizen Band Potawatomi"},{"code":"1480-3","display":"Forest County","definition":"Forest County"},{"code":"1481-1","display":"Hannahville","definition":"Hannahville"},{"code":"1482-9","display":"Huron Potawatomi","definition":"Huron Potawatomi"},{"code":"1483-7","display":"Pokagon Potawatomi","definition":"Pokagon Potawatomi"},{"code":"1484-5","display":"Prairie Band","definition":"Prairie Band"},{"code":"1485-2","display":"Wisconsin Potawatomi","definition":"Wisconsin Potawatomi"},{"code":"1490-2","display":"Acoma","definition":"Acoma"},{"code":"1491-0","display":"Arizona Tewa","definition":"Arizona Tewa"},{"code":"1492-8","display":"Cochiti","definition":"Cochiti"},{"code":"1493-6","display":"Hopi","definition":"Hopi"},{"code":"1494-4","display":"Isleta","definition":"Isleta"},{"code":"1495-1","display":"Jemez","definition":"Jemez"},{"code":"1496-9","display":"Keres","definition":"Keres"},{"code":"1497-7","display":"Laguna","definition":"Laguna"},{"code":"1498-5","display":"Nambe","definition":"Nambe"},{"code":"1499-3","display":"Picuris","definition":"Picuris"},{"code":"1500-8","display":"Piro","definition":"Piro"},{"code":"1501-6","display":"Pojoaque","definition":"Pojoaque"},{"code":"1502-4","display":"San Felipe","definition":"San Felipe"},{"code":"1503-2","display":"San Ildefonso","definition":"San Ildefonso"},{"code":"1504-0","display":"San Juan Pueblo","definition":"San Juan Pueblo"},{"code":"1505-7","display":"San Juan De","definition":"San Juan De"},{"code":"1506-5","display":"San Juan","definition":"San Juan"},{"code":"1507-3","display":"Sandia","definition":"Sandia"},{"code":"1508-1","display":"Santa Ana","definition":"Santa Ana"},{"code":"1509-9","display":"Santa Clara","definition":"Santa Clara"},{"code":"1510-7","display":"Santo Domingo","definition":"Santo Domingo"},{"code":"1511-5","display":"Taos","definition":"Taos"},{"code":"1512-3","display":"Tesuque","definition":"Tesuque"},{"code":"1513-1","display":"Tewa","definition":"Tewa"},{"code":"1514-9","display":"Tigua","definition":"Tigua"},{"code":"1515-6","display":"Zia","definition":"Zia"},{"code":"1516-4","display":"Zuni","definition":"Zuni"},{"code":"1519-8","display":"Duwamish","definition":"Duwamish"},{"code":"1520-6","display":"Kikiallus","definition":"Kikiallus"},{"code":"1521-4","display":"Lower Skagit","definition":"Lower Skagit"},{"code":"1522-2","display":"Muckleshoot","definition":"Muckleshoot"},{"code":"1523-0","display":"Nisqually","definition":"Nisqually"},{"code":"1524-8","display":"Nooksack","definition":"Nooksack"},{"code":"1525-5","display":"Port Madison","definition":"Port Madison"},{"code":"1526-3","display":"Puyallup","definition":"Puyallup"},{"code":"1527-1","display":"Samish","definition":"Samish"},{"code":"1528-9","display":"Sauk-Suiattle","definition":"Sauk-Suiattle"},{"code":"1529-7","display":"Skokomish","definition":"Skokomish"},{"code":"1530-5","display":"Skykomish","definition":"Skykomish"},{"code":"1531-3","display":"Snohomish","definition":"Snohomish"},{"code":"1532-1","display":"Snoqualmie","definition":"Snoqualmie"},{"code":"1533-9","display":"Squaxin Island","definition":"Squaxin Island"},{"code":"1534-7","display":"Steilacoom","definition":"Steilacoom"},{"code":"1535-4","display":"Stillaguamish","definition":"Stillaguamish"},{"code":"1536-2","display":"Suquamish","definition":"Suquamish"},{"code":"1537-0","display":"Swinomish","definition":"Swinomish"},{"code":"1538-8","display":"Tulalip","definition":"Tulalip"},{"code":"1539-6","display":"Upper Skagit","definition":"Upper Skagit"},{"code":"1552-9","display":"Iowa Sac and Fox","definition":"Iowa Sac and Fox"},{"code":"1553-7","display":"Missouri Sac and Fox","definition":"Missouri Sac and Fox"},{"code":"1554-5","display":"Oklahoma Sac and Fox","definition":"Oklahoma Sac and Fox"},{"code":"1567-7","display":"Big Cypress","definition":"Big Cypress"},{"code":"1568-5","display":"Brighton","definition":"Brighton"},{"code":"1569-3","display":"Florida Seminole","definition":"Florida Seminole"},{"code":"1570-1","display":"Hollywood Seminole","definition":"Hollywood Seminole"},{"code":"1571-9","display":"Oklahoma Seminole","definition":"Oklahoma Seminole"},{"code":"1574-3","display":"San Manual","definition":"San Manual"},{"code":"1579-2","display":"Absentee Shawnee","definition":"Absentee Shawnee"},{"code":"1580-0","display":"Eastern Shawnee","definition":"Eastern Shawnee"},{"code":"1587-5","display":"Battle Mountain","definition":"Battle Mountain"},{"code":"1588-3","display":"Duckwater","definition":"Duckwater"},{"code":"1589-1","display":"Elko","definition":"Elko"},{"code":"1590-9","display":"Ely","definition":"Ely"},{"code":"1591-7","display":"Goshute","definition":"Goshute"},{"code":"1592-5","display":"Panamint","definition":"Panamint"},{"code":"1593-3","display":"Ruby Valley","definition":"Ruby Valley"},{"code":"1594-1","display":"Skull Valley","definition":"Skull Valley"},{"code":"1595-8","display":"South Fork Shoshone","definition":"South Fork Shoshone"},{"code":"1596-6","display":"Te-Moak Western Shoshone","definition":"Te-Moak Western Shoshone"},{"code":"1597-4","display":"Timbi-Sha Shoshone","definition":"Timbi-Sha Shoshone"},{"code":"1598-2","display":"Washakie","definition":"Washakie"},{"code":"1599-0","display":"Wind River Shoshone","definition":"Wind River Shoshone"},{"code":"1600-6","display":"Yomba","definition":"Yomba"},{"code":"1603-0","display":"Duck Valley","definition":"Duck Valley"},{"code":"1604-8","display":"Fallon","definition":"Fallon"},{"code":"1605-5","display":"Fort McDermitt","definition":"Fort McDermitt"},{"code":"1610-5","display":"Blackfoot Sioux","definition":"Blackfoot Sioux"},{"code":"1611-3","display":"Brule Sioux","definition":"Brule Sioux"},{"code":"1612-1","display":"Cheyenne River Sioux","definition":"Cheyenne River Sioux"},{"code":"1613-9","display":"Crow Creek Sioux","definition":"Crow Creek Sioux"},{"code":"1614-7","display":"Dakota Sioux","definition":"Dakota Sioux"},{"code":"1615-4","display":"Flandreau Santee","definition":"Flandreau Santee"},{"code":"1616-2","display":"Fort Peck","definition":"Fort Peck"},{"code":"1617-0","display":"Lake Traverse Sioux","definition":"Lake Traverse Sioux"},{"code":"1618-8","display":"Lower Brule Sioux","definition":"Lower Brule Sioux"},{"code":"1619-6","display":"Lower Sioux","definition":"Lower Sioux"},{"code":"1620-4","display":"Mdewakanton Sioux","definition":"Mdewakanton Sioux"},{"code":"1621-2","display":"Miniconjou","definition":"Miniconjou"},{"code":"1622-0","display":"Oglala Sioux","definition":"Oglala Sioux"},{"code":"1623-8","display":"Pine Ridge Sioux","definition":"Pine Ridge Sioux"},{"code":"1624-6","display":"Pipestone Sioux","definition":"Pipestone Sioux"},{"code":"1625-3","display":"Prairie Island Sioux","definition":"Prairie Island Sioux"},{"code":"1626-1","display":"Prior Lake Sioux","definition":"Prior Lake Sioux"},{"code":"1627-9","display":"Rosebud Sioux","definition":"Rosebud Sioux"},{"code":"1628-7","display":"Sans Arc Sioux","definition":"Sans Arc Sioux"},{"code":"1629-5","display":"Santee Sioux","definition":"Santee Sioux"},{"code":"1630-3","display":"Sisseton-Wahpeton","definition":"Sisseton-Wahpeton"},{"code":"1631-1","display":"Sisseton Sioux","definition":"Sisseton Sioux"},{"code":"1632-9","display":"Spirit Lake Sioux","definition":"Spirit Lake Sioux"},{"code":"1633-7","display":"Standing Rock Sioux","definition":"Standing Rock Sioux"},{"code":"1634-5","display":"Teton Sioux","definition":"Teton Sioux"},{"code":"1635-2","display":"Two Kettle Sioux","definition":"Two Kettle Sioux"},{"code":"1636-0","display":"Upper Sioux","definition":"Upper Sioux"},{"code":"1637-8","display":"Wahpekute Sioux","definition":"Wahpekute Sioux"},{"code":"1638-6","display":"Wahpeton Sioux","definition":"Wahpeton Sioux"},{"code":"1639-4","display":"Wazhaza Sioux","definition":"Wazhaza Sioux"},{"code":"1640-2","display":"Yankton Sioux","definition":"Yankton Sioux"},{"code":"1641-0","display":"Yanktonai Sioux","definition":"Yanktonai Sioux"},{"code":"1654-3","display":"Ak-Chin","definition":"Ak-Chin"},{"code":"1655-0","display":"Gila Bend","definition":"Gila Bend"},{"code":"1656-8","display":"San Xavier","definition":"San Xavier"},{"code":"1657-6","display":"Sells","definition":"Sells"},{"code":"1668-3","display":"Cow Creek Umpqua","definition":"Cow Creek Umpqua"},{"code":"1671-7","display":"Allen Canyon","definition":"Allen Canyon"},{"code":"1672-5","display":"Uintah Ute","definition":"Uintah Ute"},{"code":"1673-3","display":"Ute Mountain Ute","definition":"Ute Mountain Ute"},{"code":"1680-8","display":"Gay Head Wampanoag","definition":"Gay Head Wampanoag"},{"code":"1681-6","display":"Mashpee Wampanoag","definition":"Mashpee Wampanoag"},{"code":"1688-1","display":"Alpine","definition":"Alpine"},{"code":"1689-9","display":"Carson","definition":"Carson"},{"code":"1690-7","display":"Dresslerville","definition":"Dresslerville"},{"code":"1697-2","display":"Ho-chunk","definition":"Ho-chunk"},{"code":"1698-0","display":"Nebraska Winnebago","definition":"Nebraska Winnebago"},{"code":"1705-3","display":"Table Bluff","definition":"Table Bluff"},{"code":"1712-9","display":"Barrio Libre","definition":"Barrio Libre"},{"code":"1713-7","display":"Pascua Yaqui","definition":"Pascua Yaqui"},{"code":"1718-6","display":"Chukchansi","definition":"Chukchansi"},{"code":"1719-4","display":"Tachi","definition":"Tachi"},{"code":"1720-2","display":"Tule River","definition":"Tule River"},{"code":"1725-1","display":"Cocopah","definition":"Cocopah"},{"code":"1726-9","display":"Havasupai","definition":"Havasupai"},{"code":"1727-7","display":"Hualapai","definition":"Hualapai"},{"code":"1728-5","display":"Maricopa","definition":"Maricopa"},{"code":"1729-3","display":"Mohave","definition":"Mohave"},{"code":"1730-1","display":"Quechan","definition":"Quechan"},{"code":"1731-9","display":"Yavapai","definition":"Yavapai"},{"code":"1733-5","display":"Coast Yurok","definition":"Coast Yurok"},{"code":"1737-6","display":"Alaska Indian","definition":"Alaska Indian"},{"code":"1840-8","display":"Eskimo","definition":"Eskimo"},{"code":"1966-1","display":"Aleut","definition":"Aleut"},{"code":"1739-2","display":"Alaskan Athabascan","definition":"Alaskan Athabascan"},{"code":"1811-9","display":"Southeast Alaska","definition":"Southeast Alaska"},{"code":"1740-0","display":"Ahtna","definition":"Ahtna"},{"code":"1741-8","display":"Alatna","definition":"Alatna"},{"code":"1742-6","display":"Alexander","definition":"Alexander"},{"code":"1743-4","display":"Allakaket","definition":"Allakaket"},{"code":"1744-2","display":"Alanvik","definition":"Alanvik"},{"code":"1745-9","display":"Anvik","definition":"Anvik"},{"code":"1746-7","display":"Arctic","definition":"Arctic"},{"code":"1747-5","display":"Beaver","definition":"Beaver"},{"code":"1748-3","display":"Birch Creek","definition":"Birch Creek"},{"code":"1749-1","display":"Cantwell","definition":"Cantwell"},{"code":"1750-9","display":"Chalkyitsik","definition":"Chalkyitsik"},{"code":"1751-7","display":"Chickaloon","definition":"Chickaloon"},{"code":"1752-5","display":"Chistochina","definition":"Chistochina"},{"code":"1753-3","display":"Chitina","definition":"Chitina"},{"code":"1754-1","display":"Circle","definition":"Circle"},{"code":"1755-8","display":"Cook Inlet","definition":"Cook Inlet"},{"code":"1756-6","display":"Copper Center","definition":"Copper Center"},{"code":"1757-4","display":"Copper River","definition":"Copper River"},{"code":"1758-2","display":"Dot Lake","definition":"Dot Lake"},{"code":"1759-0","display":"Doyon","definition":"Doyon"},{"code":"1760-8","display":"Eagle","definition":"Eagle"},{"code":"1761-6","display":"Eklutna","definition":"Eklutna"},{"code":"1762-4","display":"Evansville","definition":"Evansville"},{"code":"1763-2","display":"Fort Yukon","definition":"Fort Yukon"},{"code":"1764-0","display":"Gakona","definition":"Gakona"},{"code":"1765-7","display":"Galena","definition":"Galena"},{"code":"1766-5","display":"Grayling","definition":"Grayling"},{"code":"1767-3","display":"Gulkana","definition":"Gulkana"},{"code":"1768-1","display":"Healy Lake","definition":"Healy Lake"},{"code":"1769-9","display":"Holy Cross","definition":"Holy Cross"},{"code":"1770-7","display":"Hughes","definition":"Hughes"},{"code":"1771-5","display":"Huslia","definition":"Huslia"},{"code":"1772-3","display":"Iliamna","definition":"Iliamna"},{"code":"1773-1","display":"Kaltag","definition":"Kaltag"},{"code":"1774-9","display":"Kluti Kaah","definition":"Kluti Kaah"},{"code":"1775-6","display":"Knik","definition":"Knik"},{"code":"1776-4","display":"Koyukuk","definition":"Koyukuk"},{"code":"1777-2","display":"Lake Minchumina","definition":"Lake Minchumina"},{"code":"1778-0","display":"Lime","definition":"Lime"},{"code":"1779-8","display":"Mcgrath","definition":"Mcgrath"},{"code":"1780-6","display":"Manley Hot Springs","definition":"Manley Hot Springs"},{"code":"1781-4","display":"Mentasta Lake","definition":"Mentasta Lake"},{"code":"1782-2","display":"Minto","definition":"Minto"},{"code":"1783-0","display":"Nenana","definition":"Nenana"},{"code":"1784-8","display":"Nikolai","definition":"Nikolai"},{"code":"1785-5","display":"Ninilchik","definition":"Ninilchik"},{"code":"1786-3","display":"Nondalton","definition":"Nondalton"},{"code":"1787-1","display":"Northway","definition":"Northway"},{"code":"1788-9","display":"Nulato","definition":"Nulato"},{"code":"1789-7","display":"Pedro Bay","definition":"Pedro Bay"},{"code":"1790-5","display":"Rampart","definition":"Rampart"},{"code":"1791-3","display":"Ruby","definition":"Ruby"},{"code":"1792-1","display":"Salamatof","definition":"Salamatof"},{"code":"1793-9","display":"Seldovia","definition":"Seldovia"},{"code":"1794-7","display":"Slana","definition":"Slana"},{"code":"1795-4","display":"Shageluk","definition":"Shageluk"},{"code":"1796-2","display":"Stevens","definition":"Stevens"},{"code":"1797-0","display":"Stony River","definition":"Stony River"},{"code":"1798-8","display":"Takotna","definition":"Takotna"},{"code":"1799-6","display":"Tanacross","definition":"Tanacross"},{"code":"1800-2","display":"Tanaina","definition":"Tanaina"},{"code":"1801-0","display":"Tanana","definition":"Tanana"},{"code":"1802-8","display":"Tanana Chiefs","definition":"Tanana Chiefs"},{"code":"1803-6","display":"Tazlina","definition":"Tazlina"},{"code":"1804-4","display":"Telida","definition":"Telida"},{"code":"1805-1","display":"Tetlin","definition":"Tetlin"},{"code":"1806-9","display":"Tok","definition":"Tok"},{"code":"1807-7","display":"Tyonek","definition":"Tyonek"},{"code":"1808-5","display":"Venetie","definition":"Venetie"},{"code":"1809-3","display":"Wiseman","definition":"Wiseman"},{"code":"1813-5","display":"Tlingit-Haida","definition":"Tlingit-Haida"},{"code":"1837-4","display":"Tsimshian","definition":"Tsimshian"},{"code":"1814-3","display":"Angoon","definition":"Angoon"},{"code":"1815-0","display":"Central Council of Tlingit and Haida Tribes","definition":"Central Council of Tlingit and Haida Tribes"},{"code":"1816-8","display":"Chilkat","definition":"Chilkat"},{"code":"1817-6","display":"Chilkoot","definition":"Chilkoot"},{"code":"1818-4","display":"Craig","definition":"Craig"},{"code":"1819-2","display":"Douglas","definition":"Douglas"},{"code":"1820-0","display":"Haida","definition":"Haida"},{"code":"1821-8","display":"Hoonah","definition":"Hoonah"},{"code":"1822-6","display":"Hydaburg","definition":"Hydaburg"},{"code":"1823-4","display":"Kake","definition":"Kake"},{"code":"1824-2","display":"Kasaan","definition":"Kasaan"},{"code":"1825-9","display":"Kenaitze","definition":"Kenaitze"},{"code":"1826-7","display":"Ketchikan","definition":"Ketchikan"},{"code":"1827-5","display":"Klawock","definition":"Klawock"},{"code":"1828-3","display":"Pelican","definition":"Pelican"},{"code":"1829-1","display":"Petersburg","definition":"Petersburg"},{"code":"1830-9","display":"Saxman","definition":"Saxman"},{"code":"1831-7","display":"Sitka","definition":"Sitka"},{"code":"1832-5","display":"Tenakee Springs","definition":"Tenakee Springs"},{"code":"1833-3","display":"Tlingit","definition":"Tlingit"},{"code":"1834-1","display":"Wrangell","definition":"Wrangell"},{"code":"1835-8","display":"Yakutat","definition":"Yakutat"},{"code":"1838-2","display":"Metlakatla","definition":"Metlakatla"},{"code":"1842-4","display":"Greenland Eskimo","definition":"Greenland Eskimo"},{"code":"1844-0","display":"Inupiat Eskimo","definition":"Inupiat Eskimo"},{"code":"1891-1","display":"Siberian Eskimo","definition":"Siberian Eskimo"},{"code":"1896-0","display":"Yupik Eskimo","definition":"Yupik Eskimo"},{"code":"1845-7","display":"Ambler","definition":"Ambler"},{"code":"1846-5","display":"Anaktuvuk","definition":"Anaktuvuk"},{"code":"1847-3","display":"Anaktuvuk Pass","definition":"Anaktuvuk Pass"},{"code":"1848-1","display":"Arctic Slope Inupiat","definition":"Arctic Slope Inupiat"},{"code":"1849-9","display":"Arctic Slope Corporation","definition":"Arctic Slope Corporation"},{"code":"1850-7","display":"Atqasuk","definition":"Atqasuk"},{"code":"1851-5","display":"Barrow","definition":"Barrow"},{"code":"1852-3","display":"Bering Straits Inupiat","definition":"Bering Straits Inupiat"},{"code":"1853-1","display":"Brevig Mission","definition":"Brevig Mission"},{"code":"1854-9","display":"Buckland","definition":"Buckland"},{"code":"1855-6","display":"Chinik","definition":"Chinik"},{"code":"1856-4","display":"Council","definition":"Council"},{"code":"1857-2","display":"Deering","definition":"Deering"},{"code":"1858-0","display":"Elim","definition":"Elim"},{"code":"1859-8","display":"Golovin","definition":"Golovin"},{"code":"1860-6","display":"Inalik Diomede","definition":"Inalik Diomede"},{"code":"1861-4","display":"Inupiaq","definition":"Inupiaq"},{"code":"1862-2","display":"Kaktovik","definition":"Kaktovik"},{"code":"1863-0","display":"Kawerak","definition":"Kawerak"},{"code":"1864-8","display":"Kiana","definition":"Kiana"},{"code":"1865-5","display":"Kivalina","definition":"Kivalina"},{"code":"1866-3","display":"Kobuk","definition":"Kobuk"},{"code":"1867-1","display":"Kotzebue","definition":"Kotzebue"},{"code":"1868-9","display":"Koyuk","definition":"Koyuk"},{"code":"1869-7","display":"Kwiguk","definition":"Kwiguk"},{"code":"1870-5","display":"Mauneluk Inupiat","definition":"Mauneluk Inupiat"},{"code":"1871-3","display":"Nana Inupiat","definition":"Nana Inupiat"},{"code":"1872-1","display":"Noatak","definition":"Noatak"},{"code":"1873-9","display":"Nome","definition":"Nome"},{"code":"1874-7","display":"Noorvik","definition":"Noorvik"},{"code":"1875-4","display":"Nuiqsut","definition":"Nuiqsut"},{"code":"1876-2","display":"Point Hope","definition":"Point Hope"},{"code":"1877-0","display":"Point Lay","definition":"Point Lay"},{"code":"1878-8","display":"Selawik","definition":"Selawik"},{"code":"1879-6","display":"Shaktoolik","definition":"Shaktoolik"},{"code":"1880-4","display":"Shishmaref","definition":"Shishmaref"},{"code":"1881-2","display":"Shungnak","definition":"Shungnak"},{"code":"1882-0","display":"Solomon","definition":"Solomon"},{"code":"1883-8","display":"Teller","definition":"Teller"},{"code":"1884-6","display":"Unalakleet","definition":"Unalakleet"},{"code":"1885-3","display":"Wainwright","definition":"Wainwright"},{"code":"1886-1","display":"Wales","definition":"Wales"},{"code":"1887-9","display":"White Mountain","definition":"White Mountain"},{"code":"1888-7","display":"White Mountain Inupiat","definition":"White Mountain Inupiat"},{"code":"1889-5","display":"Mary's Igloo","definition":"Mary's Igloo"},{"code":"1892-9","display":"Gambell","definition":"Gambell"},{"code":"1893-7","display":"Savoonga","definition":"Savoonga"},{"code":"1894-5","display":"Siberian Yupik","definition":"Siberian Yupik"},{"code":"1897-8","display":"Akiachak","definition":"Akiachak"},{"code":"1898-6","display":"Akiak","definition":"Akiak"},{"code":"1899-4","display":"Alakanuk","definition":"Alakanuk"},{"code":"1900-0","display":"Aleknagik","definition":"Aleknagik"},{"code":"1901-8","display":"Andreafsky","definition":"Andreafsky"},{"code":"1902-6","display":"Aniak","definition":"Aniak"},{"code":"1903-4","display":"Atmautluak","definition":"Atmautluak"},{"code":"1904-2","display":"Bethel","definition":"Bethel"},{"code":"1905-9","display":"Bill Moore's Slough","definition":"Bill Moore's Slough"},{"code":"1906-7","display":"Bristol Bay Yupik","definition":"Bristol Bay Yupik"},{"code":"1907-5","display":"Calista Yupik","definition":"Calista Yupik"},{"code":"1908-3","display":"Chefornak","definition":"Chefornak"},{"code":"1909-1","display":"Chevak","definition":"Chevak"},{"code":"1910-9","display":"Chuathbaluk","definition":"Chuathbaluk"},{"code":"1911-7","display":"Clark's Point","definition":"Clark's Point"},{"code":"1912-5","display":"Crooked Creek","definition":"Crooked Creek"},{"code":"1913-3","display":"Dillingham","definition":"Dillingham"},{"code":"1914-1","display":"Eek","definition":"Eek"},{"code":"1915-8","display":"Ekuk","definition":"Ekuk"},{"code":"1916-6","display":"Ekwok","definition":"Ekwok"},{"code":"1917-4","display":"Emmonak","definition":"Emmonak"},{"code":"1918-2","display":"Goodnews Bay","definition":"Goodnews Bay"},{"code":"1919-0","display":"Hooper Bay","definition":"Hooper Bay"},{"code":"1920-8","display":"Iqurmuit (Russian Mission)","definition":"Iqurmuit (Russian Mission)"},{"code":"1921-6","display":"Kalskag","definition":"Kalskag"},{"code":"1922-4","display":"Kasigluk","definition":"Kasigluk"},{"code":"1923-2","display":"Kipnuk","definition":"Kipnuk"},{"code":"1924-0","display":"Koliganek","definition":"Koliganek"},{"code":"1925-7","display":"Kongiganak","definition":"Kongiganak"},{"code":"1926-5","display":"Kotlik","definition":"Kotlik"},{"code":"1927-3","display":"Kwethluk","definition":"Kwethluk"},{"code":"1928-1","display":"Kwigillingok","definition":"Kwigillingok"},{"code":"1929-9","display":"Levelock","definition":"Levelock"},{"code":"1930-7","display":"Lower Kalskag","definition":"Lower Kalskag"},{"code":"1931-5","display":"Manokotak","definition":"Manokotak"},{"code":"1932-3","display":"Marshall","definition":"Marshall"},{"code":"1933-1","display":"Mekoryuk","definition":"Mekoryuk"},{"code":"1934-9","display":"Mountain Village","definition":"Mountain Village"},{"code":"1935-6","display":"Naknek","definition":"Naknek"},{"code":"1936-4","display":"Napaumute","definition":"Napaumute"},{"code":"1937-2","display":"Napakiak","definition":"Napakiak"},{"code":"1938-0","display":"Napaskiak","definition":"Napaskiak"},{"code":"1939-8","display":"Newhalen","definition":"Newhalen"},{"code":"1940-6","display":"New Stuyahok","definition":"New Stuyahok"},{"code":"1941-4","display":"Newtok","definition":"Newtok"},{"code":"1942-2","display":"Nightmute","definition":"Nightmute"},{"code":"1943-0","display":"Nunapitchukv","definition":"Nunapitchukv"},{"code":"1944-8","display":"Oscarville","definition":"Oscarville"},{"code":"1945-5","display":"Pilot Station","definition":"Pilot Station"},{"code":"1946-3","display":"Pitkas Point","definition":"Pitkas Point"},{"code":"1947-1","display":"Platinum","definition":"Platinum"},{"code":"1948-9","display":"Portage Creek","definition":"Portage Creek"},{"code":"1949-7","display":"Quinhagak","definition":"Quinhagak"},{"code":"1950-5","display":"Red Devil","definition":"Red Devil"},{"code":"1951-3","display":"St. Michael","definition":"St. Michael"},{"code":"1952-1","display":"Scammon Bay","definition":"Scammon Bay"},{"code":"1953-9","display":"Sheldon's Point","definition":"Sheldon's Point"},{"code":"1954-7","display":"Sleetmute","definition":"Sleetmute"},{"code":"1955-4","display":"Stebbins","definition":"Stebbins"},{"code":"1956-2","display":"Togiak","definition":"Togiak"},{"code":"1957-0","display":"Toksook","definition":"Toksook"},{"code":"1958-8","display":"Tulukskak","definition":"Tulukskak"},{"code":"1959-6","display":"Tuntutuliak","definition":"Tuntutuliak"},{"code":"1960-4","display":"Tununak","definition":"Tununak"},{"code":"1961-2","display":"Twin Hills","definition":"Twin Hills"},{"code":"1962-0","display":"Georgetown (Yupik-Eskimo)","definition":"Georgetown (Yupik-Eskimo)"},{"code":"1963-8","display":"St. Mary's","definition":"St. Mary's"},{"code":"1964-6","display":"Umkumiate","definition":"Umkumiate"},{"code":"1968-7","display":"Alutiiq Aleut","definition":"Alutiiq Aleut"},{"code":"1972-9","display":"Bristol Bay Aleut","definition":"Bristol Bay Aleut"},{"code":"1984-4","display":"Chugach Aleut","definition":"Chugach Aleut"},{"code":"1990-1","display":"Eyak","definition":"Eyak"},{"code":"1992-7","display":"Koniag Aleut","definition":"Koniag Aleut"},{"code":"2002-4","display":"Sugpiaq","definition":"Sugpiaq"},{"code":"2004-0","display":"Suqpigaq","definition":"Suqpigaq"},{"code":"2006-5","display":"Unangan Aleut","definition":"Unangan Aleut"},{"code":"1969-5","display":"Tatitlek","definition":"Tatitlek"},{"code":"1970-3","display":"Ugashik","definition":"Ugashik"},{"code":"1973-7","display":"Chignik","definition":"Chignik"},{"code":"1974-5","display":"Chignik Lake","definition":"Chignik Lake"},{"code":"1975-2","display":"Egegik","definition":"Egegik"},{"code":"1976-0","display":"Igiugig","definition":"Igiugig"},{"code":"1977-8","display":"Ivanof Bay","definition":"Ivanof Bay"},{"code":"1978-6","display":"King Salmon","definition":"King Salmon"},{"code":"1979-4","display":"Kokhanok","definition":"Kokhanok"},{"code":"1980-2","display":"Perryville","definition":"Perryville"},{"code":"1981-0","display":"Pilot Point","definition":"Pilot Point"},{"code":"1982-8","display":"Port Heiden","definition":"Port Heiden"},{"code":"1985-1","display":"Chenega","definition":"Chenega"},{"code":"1986-9","display":"Chugach Corporation","definition":"Chugach Corporation"},{"code":"1987-7","display":"English Bay","definition":"English Bay"},{"code":"1988-5","display":"Port Graham","definition":"Port Graham"},{"code":"1993-5","display":"Akhiok","definition":"Akhiok"},{"code":"1994-3","display":"Agdaagux","definition":"Agdaagux"},{"code":"1995-0","display":"Karluk","definition":"Karluk"},{"code":"1996-8","display":"Kodiak","definition":"Kodiak"},{"code":"1997-6","display":"Larsen Bay","definition":"Larsen Bay"},{"code":"1998-4","display":"Old Harbor","definition":"Old Harbor"},{"code":"1999-2","display":"Ouzinkie","definition":"Ouzinkie"},{"code":"2000-8","display":"Port Lions","definition":"Port Lions"},{"code":"2007-3","display":"Akutan","definition":"Akutan"},{"code":"2008-1","display":"Aleut Corporation","definition":"Aleut Corporation"},{"code":"2009-9","display":"Aleutian","definition":"Aleutian"},{"code":"2010-7","display":"Aleutian Islander","definition":"Aleutian Islander"},{"code":"2011-5","display":"Atka","definition":"Atka"},{"code":"2012-3","display":"Belkofski","definition":"Belkofski"},{"code":"2013-1","display":"Chignik Lagoon","definition":"Chignik Lagoon"},{"code":"2014-9","display":"King Cove","definition":"King Cove"},{"code":"2015-6","display":"False Pass","definition":"False Pass"},{"code":"2016-4","display":"Nelson Lagoon","definition":"Nelson Lagoon"},{"code":"2017-2","display":"Nikolski","definition":"Nikolski"},{"code":"2018-0","display":"Pauloff Harbor","definition":"Pauloff Harbor"},{"code":"2019-8","display":"Qagan Toyagungin","definition":"Qagan Toyagungin"},{"code":"2020-6","display":"Qawalangin","definition":"Qawalangin"},{"code":"2021-4","display":"St. George","definition":"St. George"},{"code":"2022-2","display":"St. Paul","definition":"St. Paul"},{"code":"2023-0","display":"Sand Point","definition":"Sand Point"},{"code":"2024-8","display":"South Naknek","definition":"South Naknek"},{"code":"2025-5","display":"Unalaska","definition":"Unalaska"},{"code":"2026-3","display":"Unga","definition":"Unga"}]},{"code":"2028-9","display":"Asian","definition":"Asian","concept":[{"code":"2029-7","display":"Asian Indian","definition":"Asian Indian"},{"code":"2030-5","display":"Bangladeshi","definition":"Bangladeshi"},{"code":"2031-3","display":"Bhutanese","definition":"Bhutanese"},{"code":"2032-1","display":"Burmese","definition":"Burmese"},{"code":"2033-9","display":"Cambodian","definition":"Cambodian"},{"code":"2034-7","display":"Chinese","definition":"Chinese"},{"code":"2035-4","display":"Taiwanese","definition":"Taiwanese"},{"code":"2036-2","display":"Filipino","definition":"Filipino"},{"code":"2037-0","display":"Hmong","definition":"Hmong"},{"code":"2038-8","display":"Indonesian","definition":"Indonesian"},{"code":"2039-6","display":"Japanese","definition":"Japanese"},{"code":"2040-4","display":"Korean","definition":"Korean"},{"code":"2041-2","display":"Laotian","definition":"Laotian"},{"code":"2042-0","display":"Malaysian","definition":"Malaysian"},{"code":"2043-8","display":"Okinawan","definition":"Okinawan"},{"code":"2044-6","display":"Pakistani","definition":"Pakistani"},{"code":"2045-3","display":"Sri Lankan","definition":"Sri Lankan"},{"code":"2046-1","display":"Thai","definition":"Thai"},{"code":"2047-9","display":"Vietnamese","definition":"Vietnamese"},{"code":"2048-7","display":"Iwo Jiman","definition":"Iwo Jiman"},{"code":"2049-5","display":"Maldivian","definition":"Maldivian"},{"code":"2050-3","display":"Nepalese","definition":"Nepalese"},{"code":"2051-1","display":"Singaporean","definition":"Singaporean"},{"code":"2052-9","display":"Madagascar","definition":"Madagascar"}]},{"code":"2054-5","display":"Black or African American","definition":"Black or African American","concept":[{"code":"2056-0","display":"Black","definition":"Black"},{"code":"2058-6","display":"African American","definition":"African American"},{"code":"2060-2","display":"African","definition":"African"},{"code":"2067-7","display":"Bahamian","definition":"Bahamian"},{"code":"2068-5","display":"Barbadian","definition":"Barbadian"},{"code":"2069-3","display":"Dominican","definition":"Dominican"},{"code":"2070-1","display":"Dominica Islander","definition":"Dominica Islander"},{"code":"2071-9","display":"Haitian","definition":"Haitian"},{"code":"2072-7","display":"Jamaican","definition":"Jamaican"},{"code":"2073-5","display":"Tobagoan","definition":"Tobagoan"},{"code":"2074-3","display":"Trinidadian","definition":"Trinidadian"},{"code":"2075-0","display":"West Indian","definition":"West Indian"},{"code":"2061-0","display":"Botswanan","definition":"Botswanan"},{"code":"2062-8","display":"Ethiopian","definition":"Ethiopian"},{"code":"2063-6","display":"Liberian","definition":"Liberian"},{"code":"2064-4","display":"Namibian","definition":"Namibian"},{"code":"2065-1","display":"Nigerian","definition":"Nigerian"},{"code":"2066-9","display":"Zairean","definition":"Zairean"}]},{"code":"2076-8","display":"Native Hawaiian or Other Pacific Islander","definition":"Native Hawaiian or Other Pacific Islander","concept":[{"code":"2078-4","display":"Polynesian","definition":"Polynesian"},{"code":"2085-9","display":"Micronesian","definition":"Micronesian"},{"code":"2100-6","display":"Melanesian","definition":"Melanesian"},{"code":"2500-7","display":"Other Pacific Islander","definition":"Other Pacific Islander"},{"code":"2079-2","display":"Native Hawaiian","definition":"Native Hawaiian"},{"code":"2080-0","display":"Samoan","definition":"Samoan"},{"code":"2081-8","display":"Tahitian","definition":"Tahitian"},{"code":"2082-6","display":"Tongan","definition":"Tongan"},{"code":"2083-4","display":"Tokelauan","definition":"Tokelauan"},{"code":"2086-7","display":"Guamanian or Chamorro","definition":"Guamanian or Chamorro"},{"code":"2087-5","display":"Guamanian","definition":"Guamanian"},{"code":"2088-3","display":"Chamorro","definition":"Chamorro"},{"code":"2089-1","display":"Mariana Islander","definition":"Mariana Islander"},{"code":"2090-9","display":"Marshallese","definition":"Marshallese"},{"code":"2091-7","display":"Palauan","definition":"Palauan"},{"code":"2092-5","display":"Carolinian","definition":"Carolinian"},{"code":"2093-3","display":"Kosraean","definition":"Kosraean"},{"code":"2094-1","display":"Pohnpeian","definition":"Pohnpeian"},{"code":"2095-8","display":"Saipanese","definition":"Saipanese"},{"code":"2096-6","display":"Kiribati","definition":"Kiribati"},{"code":"2097-4","display":"Chuukese","definition":"Chuukese"},{"code":"2098-2","display":"Yapese","definition":"Yapese"},{"code":"2101-4","display":"Fijian","definition":"Fijian"},{"code":"2102-2","display":"Papua New Guinean","definition":"Papua New Guinean"},{"code":"2103-0","display":"Solomon Islander","definition":"Solomon Islander"},{"code":"2104-8","display":"New Hebrides","definition":"New Hebrides"}]},{"code":"2106-3","display":"White","definition":"White","concept":[{"code":"2108-9","display":"European","definition":"European"},{"code":"2118-8","display":"Middle Eastern or North African","definition":"Middle Eastern or North African"},{"code":"2129-5","display":"Arab","definition":"Arab"},{"code":"2109-7","display":"Armenian","definition":"Armenian"},{"code":"2110-5","display":"English","definition":"English"},{"code":"2111-3","display":"French","definition":"French"},{"code":"2112-1","display":"German","definition":"German"},{"code":"2113-9","display":"Irish","definition":"Irish"},{"code":"2114-7","display":"Italian","definition":"Italian"},{"code":"2115-4","display":"Polish","definition":"Polish"},{"code":"2116-2","display":"Scottish","definition":"Scottish"},{"code":"2119-6","display":"Assyrian","definition":"Assyrian"},{"code":"2120-4","display":"Egyptian","definition":"Egyptian"},{"code":"2121-2","display":"Iranian","definition":"Iranian"},{"code":"2122-0","display":"Iraqi","definition":"Iraqi"},{"code":"2123-8","display":"Lebanese","definition":"Lebanese"},{"code":"2124-6","display":"Palestinian","definition":"Palestinian"},{"code":"2125-3","display":"Syrian","definition":"Syrian"},{"code":"2126-1","display":"Afghanistani","definition":"Afghanistani"},{"code":"2127-9","display":"Israeili","definition":"Israeili"}]},{"code":"2131-1","display":"Other Race","definition":"Note that this term remains in the table for completeness, even though within HL7, the notion of Other code is deprecated."}]},{"code":"2133-7","display":"Ethnicity","definition":"Ethnicity Note that this is an abstract 'grouping' concept and not for use as a real concept","property":[{"code":"abstract","valueBoolean":true}],"concept":[{"code":"2135-2","display":"Hispanic or Latino","definition":"Hispanic or Latino","concept":[{"code":"2137-8","display":"Spaniard","definition":"Spaniard"},{"code":"2148-5","display":"Mexican","definition":"Mexican"},{"code":"2155-0","display":"Central American","definition":"Central American"},{"code":"2165-9","display":"South American","definition":"South American"},{"code":"2178-2","display":"Latin American","definition":"Latin American"},{"code":"2180-8","display":"Puerto Rican","definition":"Puerto Rican"},{"code":"2182-4","display":"Cuban","definition":"Cuban"},{"code":"2184-0","display":"Dominican","definition":"Dominican"},{"code":"2138-6","display":"Andalusian","definition":"Andalusian"},{"code":"2139-4","display":"Asturian","definition":"Asturian"},{"code":"2140-2","display":"Castillian","definition":"Castillian"},{"code":"2141-0","display":"Catalonian","definition":"Catalonian"},{"code":"2142-8","display":"Belearic Islander","definition":"Belearic Islander"},{"code":"2143-6","display":"Gallego","definition":"Gallego"},{"code":"2144-4","display":"Valencian","definition":"Valencian"},{"code":"2145-1","display":"Canarian","definition":"Canarian"},{"code":"2146-9","display":"Spanish Basque","definition":"Spanish Basque"},{"code":"2149-3","display":"Mexican American","definition":"Mexican American"},{"code":"2150-1","display":"Mexicano","definition":"Mexicano"},{"code":"2151-9","display":"Chicano","definition":"Chicano"},{"code":"2152-7","display":"La Raza","definition":"La Raza"},{"code":"2153-5","display":"Mexican American Indian","definition":"Mexican American Indian"},{"code":"2156-8","display":"Costa Rican","definition":"Costa Rican"},{"code":"2157-6","display":"Guatemalan","definition":"Guatemalan"},{"code":"2158-4","display":"Honduran","definition":"Honduran"},{"code":"2159-2","display":"Nicaraguan","definition":"Nicaraguan"},{"code":"2160-0","display":"Panamanian","definition":"Panamanian"},{"code":"2161-8","display":"Salvadoran","definition":"Salvadoran"},{"code":"2162-6","display":"Central American Indian","definition":"Central American Indian"},{"code":"2163-4","display":"Canal Zone","definition":"Canal Zone"},{"code":"2166-7","display":"Argentinean","definition":"Argentinean"},{"code":"2167-5","display":"Bolivian","definition":"Bolivian"},{"code":"2168-3","display":"Chilean","definition":"Chilean"},{"code":"2169-1","display":"Colombian","definition":"Colombian"},{"code":"2170-9","display":"Ecuadorian","definition":"Ecuadorian"},{"code":"2171-7","display":"Paraguayan","definition":"Paraguayan"},{"code":"2172-5","display":"Peruvian","definition":"Peruvian"},{"code":"2173-3","display":"Uruguayan","definition":"Uruguayan"},{"code":"2174-1","display":"Venezuelan","definition":"Venezuelan"},{"code":"2175-8","display":"South American Indian","definition":"South American Indian"},{"code":"2176-6","display":"Criollo","definition":"Criollo"}]},{"code":"2186-5","display":"Not Hispanic or Latino","definition":"Note that this term remains in the table for completeness, even though within HL7, the notion of \"not otherwise coded\" term is deprecated."}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/CodeSystem-condition-category.json b/resources/uscore_v3.1.0/CodeSystem-condition-category.json new file mode 100755 index 000000000..6a29d9189 --- /dev/null +++ b/resources/uscore_v3.1.0/CodeSystem-condition-category.json @@ -0,0 +1 @@ +{"resourceType":"CodeSystem","id":"condition-category","text":{"status":"extensions","div":"

    US Core Condition Category Extension Codes

    Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.

    \n

    Properties

    CodeURLDescriptionType
    statushttp://hl7.org/fhir/concept-properties#statusA property that indicates the status of the concept. One of active, experimental, deprecated, retiredcode

    This code system http://hl7.org/fhir/us/core/CodeSystem/condition-category defines the following codes:

    CodeDisplayDefinitionDeprecated
    problem ProblemThe patients problems as identified by the provider(s). Items on the provider’s problem listDeprecated
    health-concern Health ConcernAdditional health concerns from other stakeholders which are outside the provider’s problem list.
    "},"url":"http://hl7.org/fhir/us/core/CodeSystem/condition-category","version":"3.1.0","name":"USCoreConditionCategoryExtensionCodes","title":"US Core Condition Category Extension Codes","status":"active","date":"2019-11-06T13:08:22+11:00","publisher":"HL7 US Realm Steering Committee","description":"Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.\n","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"caseSensitive":true,"content":"complete","property":[{"code":"status","uri":"http://hl7.org/fhir/concept-properties#status","description":"A property that indicates the status of the concept. One of active, experimental, deprecated, retired","type":"code"}],"concept":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/codesystem-replacedby","valueCoding":{"system":"http://terminology.hl7.org/CodeSystem/condition-category","code":"problem-list-item","display":"Problem List Item"}}],"code":"problem","display":"Problem","definition":"The patients problems as identified by the provider(s). Items on the provider’s problem list","property":[{"code":"status","valueCode":"deprecated"}]},{"code":"health-concern","display":"Health Concern","definition":"Additional health concerns from other stakeholders which are outside the provider’s problem list."}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/CodeSystem-us-core-documentreference-category.json b/resources/uscore_v3.1.0/CodeSystem-us-core-documentreference-category.json new file mode 100755 index 000000000..de8cafbbf --- /dev/null +++ b/resources/uscore_v3.1.0/CodeSystem-us-core-documentreference-category.json @@ -0,0 +1 @@ +{"resourceType":"CodeSystem","id":"us-core-documentreference-category","text":{"status":"generated","div":"

    US Core DocumentReferences Category Codes

    The US Core DocumentReferences Type Code System is a 'starter set' of categories supported for fetching and storing DocumentReference Resources.

    \n

    This code system http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category defines the following codes:

    CodeDisplayDefinition
    clinical-note Clinical NotePart of health record where healthcare professionals record details to document a patient's clinical status or achievements during the course of a hospitalization or over the course of outpatient care ([Wikipedia](https://en.wikipedia.org/wiki/Progress_note))
    "},"url":"http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category","version":"3.1.0","name":"USCoreDocumentReferencesCategoryCodes","title":"US Core DocumentReferences Category Codes","status":"active","date":"2019-05-21T00:00:00+10:00","description":"The US Core DocumentReferences Type Code System is a 'starter set' of categories supported for fetching and storing DocumentReference Resources.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"caseSensitive":true,"valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-category","content":"complete","count":2,"concept":[{"code":"clinical-note","display":"Clinical Note","definition":"Part of health record where healthcare professionals record details to document a patient's clinical status or achievements during the course of a hospitalization or over the course of outpatient care ([Wikipedia](https://en.wikipedia.org/wiki/Progress_note))"}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/CodeSystem-us-core-provenance-participant-type.json b/resources/uscore_v3.1.0/CodeSystem-us-core-provenance-participant-type.json new file mode 100755 index 000000000..192b29ae0 --- /dev/null +++ b/resources/uscore_v3.1.0/CodeSystem-us-core-provenance-participant-type.json @@ -0,0 +1 @@ +{"resourceType":"CodeSystem","id":"us-core-provenance-participant-type","text":{"status":"generated","div":"

    US Core Provenance Participant Type Extension Codes

    Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.

    \n

    This code system http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type defines the following codes:

    CodeDisplayDefinition
    transmitter TransmitterThe entity that provided the copy to your system.
    "},"url":"http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type","version":"3.1.0","name":"USCoreProvenancePaticipantTypeExtensionCodes","title":"US Core Provenance Participant Type Extension Codes","status":"active","date":"2019-11-06T13:08:22+11:00","publisher":"HL7 US Realm Steering Committee","description":"Set of codes that are needed for implementation of the US-Core profiles. These codes are used as extensions to the FHIR and US Core value sets.\n","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"caseSensitive":true,"content":"complete","concept":[{"code":"transmitter","display":"Transmitter","definition":"The entity that provided the copy to your system."}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ConceptMap-ndc-cvx.json b/resources/uscore_v3.1.0/ConceptMap-ndc-cvx.json new file mode 100755 index 000000000..014318944 --- /dev/null +++ b/resources/uscore_v3.1.0/ConceptMap-ndc-cvx.json @@ -0,0 +1 @@ +{"resourceType":"ConceptMap","id":"ndc-cvx","text":{"status":"generated","div":"

    USCoreNDCtoCVXCodeMapping (http://hl7.org/fhir/us/core/ConceptMap/ndc-cvx)

    Mapping from http://hl7.org/fhir/us/core/ValueSet/us-core-ndc-vaccine-codes to http://hl7.org/fhir/us/core/ValueSet/us-core-vaccines-cvx

    ACTIVE. Published on 21/05/2019 12:00:00 AM by HL7 US Realm Steering Committee.

    Unit of Use [NDC code] (https://www2a.cdc.gov/vaccines/iis/iisstandards/ndc_crosswalk.asp) mapping to the CVX Vaccine codes. Note: source = NDC and target = CVX

    \n

    Source CodeRelationshipDestination Code
    00005-0100-02broader162
    00005-0100-05broader162
    00005-0100-10broader162
    00005-1970-50broader100
    00005-1971-02broader133
    00005-1971-04broader133
    00005-1971-05broader133
    00006-4045-00broader62
    00006-4045-41broader62
    00006-4047-20broader116
    00006-4047-41broader116
    00006-4093-02broader08
    00006-4093-09broader08
    00006-4094-02broader43
    00006-4094-09broader43
    00006-4095-02broader83
    00006-4095-09broader83
    00006-4096-02broader52
    00006-4096-09broader52
    00006-4109-02broader62
    00006-4109-09broader62
    00006-4119-02broader165
    00006-4119-03broader165
    00006-4121-02broader165
    00006-4133-41broader09
    00006-4171-00broader94
    00006-4681-00broader03
    00006-4739-00broader33
    00006-4826-00broader21
    00006-4827-00broader21
    00006-4831-41broader83
    00006-4837-02broader33
    00006-4837-03broader33
    00006-4841-00broader52
    00006-4841-41broader52
    00006-4897-00broader49
    00006-4898-00broader51
    00006-4943-00broader33
    00006-4963-00broader121
    00006-4963-41broader121
    00006-4980-00broader08
    00006-4981-00broader08
    00006-4992-00broader44
    00006-4995-00broader43
    00006-4995-41broader43
    00006-4999-00broader94
    00052-0603-02broader19
    13533-0131-01broader09
    14362-0111-04broader09
    17478-0131-01broader09
    19515-0845-11broader141
    19515-0850-52broader140
    19515-0889-07broader141
    19515-0890-07broader141
    19515-0891-11broader158
    19515-0893-07broader141
    19515-0894-52broader150
    19515-0895-11broader158
    19515-0896-11broader158
    19515-0898-11broader158
    19515-0900-11broader158
    19515-0901-52broader150
    19515-0903-11broader158
    19515-0908-52broader150
    19515-0909-52broader150
    19515-0912-52broader150
    21695-0413-01broader09
    33332-0010-01broader140
    33332-0013-01broader140
    33332-0014-01broader140
    33332-0015-01broader140
    33332-0016-01broader140
    33332-0017-01broader140
    33332-0018-01broader140
    33332-0110-10broader141
    33332-0113-10broader141
    33332-0114-10broader141
    33332-0115-10broader141
    33332-0116-10broader141
    33332-0117-10broader141
    33332-0118-10broader141
    33332-0316-01broader150
    33332-0317-01broader150
    33332-0318-01broader150
    33332-0416-10broader158
    33332-0417-10broader158
    33332-0418-10broader158
    33332-0519-01broader126
    33332-0519-25broader126
    33332-0629-10broader127
    42515-0001-01broader134
    42515-0001-01broader134
    42515-0001-01broader134
    42515-0001-01broader134
    42515-0002-01broader134
    42874-0012-10broader155
    42874-0013-10broader155
    42874-0014-10broader155
    42874-0015-10broader155
    42874-0016-10broader155
    42874-0017-10broader155
    42874-0117-10broader185
    43528-0002-05broader189
    43528-0003-05broader189
    46028-0114-01broader163
    46028-0114-02broader163
    46028-0208-01broader136
    46028-0208-01broader136
    49281-0010-10broader140
    49281-0010-25broader140
    49281-0010-50broader140
    49281-0011-10broader140
    49281-0011-50broader140
    49281-0012-10broader140
    49281-0012-50broader140
    49281-0013-10broader140
    49281-0013-50broader140
    49281-0014-50broader140
    49281-0111-25broader140
    49281-0112-25broader140
    49281-0113-25broader140
    49281-0215-10broader113
    49281-0215-15broader113
    49281-0225-10broader28
    49281-0250-51broader175
    49281-0278-10broader28
    49281-0286-01broader106
    49281-0286-05broader106
    49281-0286-10broader106
    49281-0291-10broader113
    49281-0291-83broader113
    49281-0298-10broader20
    49281-0386-15broader141
    49281-0387-65broader135
    49281-0388-15broader141
    49281-0389-65broader135
    49281-0390-15broader141
    49281-0391-65broader135
    49281-0392-15broader141
    49281-0393-65broader135
    49281-0394-15broader141
    49281-0395-65broader135
    49281-0396-15broader141
    49281-0397-65broader135
    49281-0399-65broader135
    49281-0400-05broader115
    49281-0400-10broader115
    49281-0400-15broader115
    49281-0400-20broader115
    49281-0401-65broader135
    49281-0403-65broader135
    49281-0413-10broader150
    49281-0413-50broader150
    49281-0414-10broader150
    49281-0414-50broader150
    49281-0415-10broader150
    49281-0416-10broader150
    49281-0416-50broader150
    49281-0417-10broader150
    49281-0417-50broader150
    49281-0418-10broader150
    49281-0418-50broader150
    49281-0489-01broader32
    49281-0489-91broader32
    49281-0510-05broader120
    49281-0510-05broader120
    49281-0513-25broader161
    49281-0514-25broader161
    49281-0516-25broader161
    49281-0517-25broader161
    49281-0518-25broader161
    49281-0545-03broader48
    49281-0545-05broader48
    49281-0562-10broader130
    49281-0589-05broader114
    49281-0621-15broader158
    49281-0625-15broader158
    49281-0627-15broader158
    49281-0629-15broader158
    49281-0640-15broader127
    49281-0650-10broader126
    49281-0650-25broader126
    49281-0650-50broader126
    49281-0650-70broader126
    49281-0650-90broader126
    49281-0703-55broader144
    49281-0705-55broader144
    49281-0707-55broader144
    49281-0708-40broader166
    49281-0709-55broader144
    49281-0710-40broader166
    49281-0712-40broader166
    49281-0718-10broader185
    49281-0790-20broader101
    49281-0790-51broader101
    49281-0800-83broader35
    49281-0820-10broader35
    49281-0860-10broader10
    49281-0860-10broader10
    49281-0860-55broader10
    49281-0913-01broader183
    49281-0915-01broader37
    49281-0915-05broader37
    50090-1693-09broader10
    50090-2883-00broader20
    50090-3096-00broader176
    50090-3469-00broader189
    51285-0138-50broader143
    51285-0138-50broader143
    54868-0734-00broader43
    54868-0980-00broader03
    54868-2219-00broader43
    54868-2219-01broader43
    54868-3339-01broader33
    54868-4320-00broader33
    54868-6177-00broader141
    54868-6180-00broader140
    55045-3841-01broader52
    58160-0801-11broader148
    58160-0806-05broader48
    58160-0808-15broader160
    58160-0808-15broader160
    58160-0809-05broader148
    58160-0810-11broader20
    58160-0810-52broader20
    58160-0811-51broader110
    58160-0811-52broader110
    58160-0812-11broader130
    58160-0812-52broader130
    58160-0815-11broader104
    58160-0815-34broader104
    58160-0815-46broader104
    58160-0815-48broader104
    58160-0815-52broader104
    58160-0816-05broader48
    58160-0818-11broader48
    58160-0819-12broader187
    58160-0820-11broader08
    58160-0820-52broader08
    58160-0821-11broader43
    58160-0821-34broader43
    58160-0821-52broader43
    58160-0823-11broader187
    58160-0825-11broader83
    58160-0825-52broader83
    58160-0826-11broader52
    58160-0826-34broader52
    58160-0826-52broader52
    58160-0830-34broader118
    58160-0830-52broader118
    58160-0842-11broader115
    58160-0842-34broader115
    58160-0842-51broader115
    58160-0842-52broader115
    58160-0854-52broader119
    58160-0879-52broader140
    58160-0880-52broader140
    58160-0881-52broader140
    58160-0883-52broader140
    58160-0898-52broader150
    58160-0900-52broader150
    58160-0901-52broader150
    58160-0903-52broader150
    58160-0905-52broader150
    58160-0907-52broader150
    58160-0955-09broader136
    58160-0955-09broader136
    58160-0964-12broader176
    58160-0964-12broader176
    58160-0976-06broader163
    58160-0976-20broader163
    62195-0051-10broader134
    62577-0613-01broader153
    62577-0614-01broader153
    63851-0501-01broader176
    63851-0501-02broader176
    63851-0612-01broader153
    63851-0613-01broader153
    64678-0211-01broader24
    66019-0107-01broader111
    66019-0108-10broader111
    66019-0109-10broader111
    66019-0110-10broader111
    66019-0200-10broader125
    66019-0300-10broader149
    66019-0301-10broader149
    66019-0302-10broader149
    66019-0303-10broader149
    66019-0304-10broader149
    66019-0305-10broader149
    66521-0000-01broader168
    66521-0112-02broader140
    66521-0112-10broader141
    66521-0113-02broader140
    66521-0113-10broader141
    66521-0114-02broader140
    66521-0114-10broader141
    66521-0115-02broader140
    66521-0115-10broader141
    66521-0116-02broader140
    66521-0116-10broader141
    66521-0117-02broader140
    66521-0117-10broader141
    66521-0118-02broader140
    66521-0118-10broader141
    66521-0200-02broader127
    66521-0200-10broader126
    69401-0000-01broader25
    69401-0000-02broader25
    70460-0001-01broader174
    70461-0001-01broader168
    70461-0002-01broader168
    70461-0018-03broader168
    70461-0119-02broader140
    70461-0119-10broader141
    70461-0120-02broader140
    70461-0120-10broader141
    70461-0200-01broader171
    70461-0201-01broader171
    70461-0301-10broader186
    70461-0318-03broader171
    70461-0418-10broader186
    76420-0482-01broader150
    76420-0483-01broader150
    63361-0245-10broader146
    "},"url":"http://hl7.org/fhir/us/core/ConceptMap/ndc-cvx","version":"3.1.0","name":"USCoreNDCtoCVXCodeMapping","title":"US Core NDC to CVX Code Mapping","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","description":"Unit of Use [NDC code] (https://www2a.cdc.gov/vaccines/iis/iisstandards/ndc_crosswalk.asp) mapping to the [CVX Vaccine codes](https://www2a.cdc.gov/vaccines/iis/iisstandards/vaccines.asp?rpt=cvx). Note: source = NDC and target = CVX","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"purpose":"Based upon the 2015 Edition Certification Requirements, the NDC vaccine codes SHOULD be supported as translations to the CVX vaccine codes.","sourceCanonical":"http://hl7.org/fhir/us/core/ValueSet/us-core-ndc-vaccine-codes","targetCanonical":"http://hl7.org/fhir/us/core/ValueSet/us-core-vaccines-cvx","group":[{"element":[{"code":"00005-0100-02","target":[{"code":"162","equivalence":"wider"}]},{"code":"00005-0100-05","target":[{"code":"162","equivalence":"wider"}]},{"code":"00005-0100-10","target":[{"code":"162","equivalence":"wider"}]},{"code":"00005-1970-50","target":[{"code":"100","equivalence":"wider"}]},{"code":"00005-1971-02","target":[{"code":"133","equivalence":"wider"}]},{"code":"00005-1971-04","target":[{"code":"133","equivalence":"wider"}]},{"code":"00005-1971-05","target":[{"code":"133","equivalence":"wider"}]},{"code":"00006-4045-00","target":[{"code":"62","equivalence":"wider"}]},{"code":"00006-4045-41","target":[{"code":"62","equivalence":"wider"}]},{"code":"00006-4047-20","target":[{"code":"116","equivalence":"wider"}]},{"code":"00006-4047-41","target":[{"code":"116","equivalence":"wider"}]},{"code":"00006-4093-02","target":[{"code":"08","equivalence":"wider"}]},{"code":"00006-4093-09","target":[{"code":"08","equivalence":"wider"}]},{"code":"00006-4094-02","target":[{"code":"43","equivalence":"wider"}]},{"code":"00006-4094-09","target":[{"code":"43","equivalence":"wider"}]},{"code":"00006-4095-02","target":[{"code":"83","equivalence":"wider"}]},{"code":"00006-4095-09","target":[{"code":"83","equivalence":"wider"}]},{"code":"00006-4096-02","target":[{"code":"52","equivalence":"wider"}]},{"code":"00006-4096-09","target":[{"code":"52","equivalence":"wider"}]},{"code":"00006-4109-02","target":[{"code":"62","equivalence":"wider"}]},{"code":"00006-4109-09","target":[{"code":"62","equivalence":"wider"}]},{"code":"00006-4119-02","target":[{"code":"165","equivalence":"wider"}]},{"code":"00006-4119-03","target":[{"code":"165","equivalence":"wider"}]},{"code":"00006-4121-02","target":[{"code":"165","equivalence":"wider"}]},{"code":"00006-4133-41","target":[{"code":"09","equivalence":"wider"}]},{"code":"00006-4171-00","target":[{"code":"94","equivalence":"wider"}]},{"code":"00006-4681-00","target":[{"code":"03","equivalence":"wider"}]},{"code":"00006-4739-00","target":[{"code":"33","equivalence":"wider"}]},{"code":"00006-4826-00","target":[{"code":"21","equivalence":"wider"}]},{"code":"00006-4827-00","target":[{"code":"21","equivalence":"wider"}]},{"code":"00006-4831-41","target":[{"code":"83","equivalence":"wider"}]},{"code":"00006-4837-02","target":[{"code":"33","equivalence":"wider"}]},{"code":"00006-4837-03","target":[{"code":"33","equivalence":"wider"}]},{"code":"00006-4841-00","target":[{"code":"52","equivalence":"wider"}]},{"code":"00006-4841-41","target":[{"code":"52","equivalence":"wider"}]},{"code":"00006-4897-00","target":[{"code":"49","equivalence":"wider"}]},{"code":"00006-4898-00","target":[{"code":"51","equivalence":"wider"}]},{"code":"00006-4943-00","target":[{"code":"33","equivalence":"wider"}]},{"code":"00006-4963-00","target":[{"code":"121","equivalence":"wider"}]},{"code":"00006-4963-41","target":[{"code":"121","equivalence":"wider"}]},{"code":"00006-4980-00","target":[{"code":"08","equivalence":"wider"}]},{"code":"00006-4981-00","target":[{"code":"08","equivalence":"wider"}]},{"code":"00006-4992-00","target":[{"code":"44","equivalence":"wider"}]},{"code":"00006-4995-00","target":[{"code":"43","equivalence":"wider"}]},{"code":"00006-4995-41","target":[{"code":"43","equivalence":"wider"}]},{"code":"00006-4999-00","target":[{"code":"94","equivalence":"wider"}]},{"code":"00052-0603-02","target":[{"code":"19","equivalence":"wider"}]},{"code":"13533-0131-01","target":[{"code":"09","equivalence":"wider"}]},{"code":"14362-0111-04","target":[{"code":"09","equivalence":"wider"}]},{"code":"17478-0131-01","target":[{"code":"09","equivalence":"wider"}]},{"code":"19515-0845-11","target":[{"code":"141","equivalence":"wider"}]},{"code":"19515-0850-52","target":[{"code":"140","equivalence":"wider"}]},{"code":"19515-0889-07","target":[{"code":"141","equivalence":"wider"}]},{"code":"19515-0890-07","target":[{"code":"141","equivalence":"wider"}]},{"code":"19515-0891-11","target":[{"code":"158","equivalence":"wider"}]},{"code":"19515-0893-07","target":[{"code":"141","equivalence":"wider"}]},{"code":"19515-0894-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"19515-0895-11","target":[{"code":"158","equivalence":"wider"}]},{"code":"19515-0896-11","target":[{"code":"158","equivalence":"wider"}]},{"code":"19515-0898-11","target":[{"code":"158","equivalence":"wider"}]},{"code":"19515-0900-11","target":[{"code":"158","equivalence":"wider"}]},{"code":"19515-0901-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"19515-0903-11","target":[{"code":"158","equivalence":"wider"}]},{"code":"19515-0908-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"19515-0909-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"19515-0912-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"21695-0413-01","target":[{"code":"09","equivalence":"wider"}]},{"code":"33332-0010-01","target":[{"code":"140","equivalence":"wider"}]},{"code":"33332-0013-01","target":[{"code":"140","equivalence":"wider"}]},{"code":"33332-0014-01","target":[{"code":"140","equivalence":"wider"}]},{"code":"33332-0015-01","target":[{"code":"140","equivalence":"wider"}]},{"code":"33332-0016-01","target":[{"code":"140","equivalence":"wider"}]},{"code":"33332-0017-01","target":[{"code":"140","equivalence":"wider"}]},{"code":"33332-0018-01","target":[{"code":"140","equivalence":"wider"}]},{"code":"33332-0110-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"33332-0113-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"33332-0114-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"33332-0115-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"33332-0116-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"33332-0117-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"33332-0118-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"33332-0316-01","target":[{"code":"150","equivalence":"wider"}]},{"code":"33332-0317-01","target":[{"code":"150","equivalence":"wider"}]},{"code":"33332-0318-01","target":[{"code":"150","equivalence":"wider"}]},{"code":"33332-0416-10","target":[{"code":"158","equivalence":"wider"}]},{"code":"33332-0417-10","target":[{"code":"158","equivalence":"wider"}]},{"code":"33332-0418-10","target":[{"code":"158","equivalence":"wider"}]},{"code":"33332-0519-01","target":[{"code":"126","equivalence":"wider"}]},{"code":"33332-0519-25","target":[{"code":"126","equivalence":"wider"}]},{"code":"33332-0629-10","target":[{"code":"127","equivalence":"wider"}]},{"code":"42515-0001-01","target":[{"code":"134","equivalence":"wider"}]},{"code":"42515-0001-01","target":[{"code":"134","equivalence":"wider"}]},{"code":"42515-0001-01","target":[{"code":"134","equivalence":"wider"}]},{"code":"42515-0001-01","target":[{"code":"134","equivalence":"wider"}]},{"code":"42515-0002-01","target":[{"code":"134","equivalence":"wider"}]},{"code":"42874-0012-10","target":[{"code":"155","equivalence":"wider"}]},{"code":"42874-0013-10","target":[{"code":"155","equivalence":"wider"}]},{"code":"42874-0014-10","target":[{"code":"155","equivalence":"wider"}]},{"code":"42874-0015-10","target":[{"code":"155","equivalence":"wider"}]},{"code":"42874-0016-10","target":[{"code":"155","equivalence":"wider"}]},{"code":"42874-0017-10","target":[{"code":"155","equivalence":"wider"}]},{"code":"42874-0117-10","target":[{"code":"185","equivalence":"wider"}]},{"code":"43528-0002-05","target":[{"code":"189","equivalence":"wider"}]},{"code":"43528-0003-05","target":[{"code":"189","equivalence":"wider"}]},{"code":"46028-0114-01","target":[{"code":"163","equivalence":"wider"}]},{"code":"46028-0114-02","target":[{"code":"163","equivalence":"wider"}]},{"code":"46028-0208-01","target":[{"code":"136","equivalence":"wider"}]},{"code":"46028-0208-01","target":[{"code":"136","equivalence":"wider"}]},{"code":"49281-0010-10","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0010-25","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0010-50","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0011-10","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0011-50","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0012-10","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0012-50","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0013-10","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0013-50","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0014-50","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0111-25","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0112-25","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0113-25","target":[{"code":"140","equivalence":"wider"}]},{"code":"49281-0215-10","target":[{"code":"113","equivalence":"wider"}]},{"code":"49281-0215-15","target":[{"code":"113","equivalence":"wider"}]},{"code":"49281-0225-10","target":[{"code":"28","equivalence":"wider"}]},{"code":"49281-0250-51","target":[{"code":"175","equivalence":"wider"}]},{"code":"49281-0278-10","target":[{"code":"28","equivalence":"wider"}]},{"code":"49281-0286-01","target":[{"code":"106","equivalence":"wider"}]},{"code":"49281-0286-05","target":[{"code":"106","equivalence":"wider"}]},{"code":"49281-0286-10","target":[{"code":"106","equivalence":"wider"}]},{"code":"49281-0291-10","target":[{"code":"113","equivalence":"wider"}]},{"code":"49281-0291-83","target":[{"code":"113","equivalence":"wider"}]},{"code":"49281-0298-10","target":[{"code":"20","equivalence":"wider"}]},{"code":"49281-0386-15","target":[{"code":"141","equivalence":"wider"}]},{"code":"49281-0387-65","target":[{"code":"135","equivalence":"wider"}]},{"code":"49281-0388-15","target":[{"code":"141","equivalence":"wider"}]},{"code":"49281-0389-65","target":[{"code":"135","equivalence":"wider"}]},{"code":"49281-0390-15","target":[{"code":"141","equivalence":"wider"}]},{"code":"49281-0391-65","target":[{"code":"135","equivalence":"wider"}]},{"code":"49281-0392-15","target":[{"code":"141","equivalence":"wider"}]},{"code":"49281-0393-65","target":[{"code":"135","equivalence":"wider"}]},{"code":"49281-0394-15","target":[{"code":"141","equivalence":"wider"}]},{"code":"49281-0395-65","target":[{"code":"135","equivalence":"wider"}]},{"code":"49281-0396-15","target":[{"code":"141","equivalence":"wider"}]},{"code":"49281-0397-65","target":[{"code":"135","equivalence":"wider"}]},{"code":"49281-0399-65","target":[{"code":"135","equivalence":"wider"}]},{"code":"49281-0400-05","target":[{"code":"115","equivalence":"wider"}]},{"code":"49281-0400-10","target":[{"code":"115","equivalence":"wider"}]},{"code":"49281-0400-15","target":[{"code":"115","equivalence":"wider"}]},{"code":"49281-0400-20","target":[{"code":"115","equivalence":"wider"}]},{"code":"49281-0401-65","target":[{"code":"135","equivalence":"wider"}]},{"code":"49281-0403-65","target":[{"code":"135","equivalence":"wider"}]},{"code":"49281-0413-10","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0413-50","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0414-10","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0414-50","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0415-10","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0416-10","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0416-50","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0417-10","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0417-50","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0418-10","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0418-50","target":[{"code":"150","equivalence":"wider"}]},{"code":"49281-0489-01","target":[{"code":"32","equivalence":"wider"}]},{"code":"49281-0489-91","target":[{"code":"32","equivalence":"wider"}]},{"code":"49281-0510-05","target":[{"code":"120","equivalence":"wider"}]},{"code":"49281-0510-05","target":[{"code":"120","equivalence":"wider"}]},{"code":"49281-0513-25","target":[{"code":"161","equivalence":"wider"}]},{"code":"49281-0514-25","target":[{"code":"161","equivalence":"wider"}]},{"code":"49281-0516-25","target":[{"code":"161","equivalence":"wider"}]},{"code":"49281-0517-25","target":[{"code":"161","equivalence":"wider"}]},{"code":"49281-0518-25","target":[{"code":"161","equivalence":"wider"}]},{"code":"49281-0545-03","target":[{"code":"48","equivalence":"wider"}]},{"code":"49281-0545-05","target":[{"code":"48","equivalence":"wider"}]},{"code":"49281-0562-10","target":[{"code":"130","equivalence":"wider"}]},{"code":"49281-0589-05","target":[{"code":"114","equivalence":"wider"}]},{"code":"49281-0621-15","target":[{"code":"158","equivalence":"wider"}]},{"code":"49281-0625-15","target":[{"code":"158","equivalence":"wider"}]},{"code":"49281-0627-15","target":[{"code":"158","equivalence":"wider"}]},{"code":"49281-0629-15","target":[{"code":"158","equivalence":"wider"}]},{"code":"49281-0640-15","target":[{"code":"127","equivalence":"wider"}]},{"code":"49281-0650-10","target":[{"code":"126","equivalence":"wider"}]},{"code":"49281-0650-25","target":[{"code":"126","equivalence":"wider"}]},{"code":"49281-0650-50","target":[{"code":"126","equivalence":"wider"}]},{"code":"49281-0650-70","target":[{"code":"126","equivalence":"wider"}]},{"code":"49281-0650-90","target":[{"code":"126","equivalence":"wider"}]},{"code":"49281-0703-55","target":[{"code":"144","equivalence":"wider"}]},{"code":"49281-0705-55","target":[{"code":"144","equivalence":"wider"}]},{"code":"49281-0707-55","target":[{"code":"144","equivalence":"wider"}]},{"code":"49281-0708-40","target":[{"code":"166","equivalence":"wider"}]},{"code":"49281-0709-55","target":[{"code":"144","equivalence":"wider"}]},{"code":"49281-0710-40","target":[{"code":"166","equivalence":"wider"}]},{"code":"49281-0712-40","target":[{"code":"166","equivalence":"wider"}]},{"code":"49281-0718-10","target":[{"code":"185","equivalence":"wider"}]},{"code":"49281-0790-20","target":[{"code":"101","equivalence":"wider"}]},{"code":"49281-0790-51","target":[{"code":"101","equivalence":"wider"}]},{"code":"49281-0800-83","target":[{"code":"35","equivalence":"wider"}]},{"code":"49281-0820-10","target":[{"code":"35","equivalence":"wider"}]},{"code":"49281-0860-10","target":[{"code":"10","equivalence":"wider"}]},{"code":"49281-0860-10","target":[{"code":"10","equivalence":"wider"}]},{"code":"49281-0860-55","target":[{"code":"10","equivalence":"wider"}]},{"code":"49281-0913-01","target":[{"code":"183","equivalence":"wider"}]},{"code":"49281-0915-01","target":[{"code":"37","equivalence":"wider"}]},{"code":"49281-0915-05","target":[{"code":"37","equivalence":"wider"}]},{"code":"50090-1693-09","target":[{"code":"10","equivalence":"wider"}]},{"code":"50090-2883-00","target":[{"code":"20","equivalence":"wider"}]},{"code":"50090-3096-00","target":[{"code":"176","equivalence":"wider"}]},{"code":"50090-3469-00","target":[{"code":"189","equivalence":"wider"}]},{"code":"51285-0138-50","target":[{"code":"143","equivalence":"wider"}]},{"code":"51285-0138-50","target":[{"code":"143","equivalence":"wider"}]},{"code":"54868-0734-00","target":[{"code":"43","equivalence":"wider"}]},{"code":"54868-0980-00","target":[{"code":"03","equivalence":"wider"}]},{"code":"54868-2219-00","target":[{"code":"43","equivalence":"wider"}]},{"code":"54868-2219-01","target":[{"code":"43","equivalence":"wider"}]},{"code":"54868-3339-01","target":[{"code":"33","equivalence":"wider"}]},{"code":"54868-4320-00","target":[{"code":"33","equivalence":"wider"}]},{"code":"54868-6177-00","target":[{"code":"141","equivalence":"wider"}]},{"code":"54868-6180-00","target":[{"code":"140","equivalence":"wider"}]},{"code":"55045-3841-01","target":[{"code":"52","equivalence":"wider"}]},{"code":"58160-0801-11","target":[{"code":"148","equivalence":"wider"}]},{"code":"58160-0806-05","target":[{"code":"48","equivalence":"wider"}]},{"code":"58160-0808-15","target":[{"code":"160","equivalence":"wider"}]},{"code":"58160-0808-15","target":[{"code":"160","equivalence":"wider"}]},{"code":"58160-0809-05","target":[{"code":"148","equivalence":"wider"}]},{"code":"58160-0810-11","target":[{"code":"20","equivalence":"wider"}]},{"code":"58160-0810-52","target":[{"code":"20","equivalence":"wider"}]},{"code":"58160-0811-51","target":[{"code":"110","equivalence":"wider"}]},{"code":"58160-0811-52","target":[{"code":"110","equivalence":"wider"}]},{"code":"58160-0812-11","target":[{"code":"130","equivalence":"wider"}]},{"code":"58160-0812-52","target":[{"code":"130","equivalence":"wider"}]},{"code":"58160-0815-11","target":[{"code":"104","equivalence":"wider"}]},{"code":"58160-0815-34","target":[{"code":"104","equivalence":"wider"}]},{"code":"58160-0815-46","target":[{"code":"104","equivalence":"wider"}]},{"code":"58160-0815-48","target":[{"code":"104","equivalence":"wider"}]},{"code":"58160-0815-52","target":[{"code":"104","equivalence":"wider"}]},{"code":"58160-0816-05","target":[{"code":"48","equivalence":"wider"}]},{"code":"58160-0818-11","target":[{"code":"48","equivalence":"wider"}]},{"code":"58160-0819-12","target":[{"code":"187","equivalence":"wider"}]},{"code":"58160-0820-11","target":[{"code":"08","equivalence":"wider"}]},{"code":"58160-0820-52","target":[{"code":"08","equivalence":"wider"}]},{"code":"58160-0821-11","target":[{"code":"43","equivalence":"wider"}]},{"code":"58160-0821-34","target":[{"code":"43","equivalence":"wider"}]},{"code":"58160-0821-52","target":[{"code":"43","equivalence":"wider"}]},{"code":"58160-0823-11","target":[{"code":"187","equivalence":"wider"}]},{"code":"58160-0825-11","target":[{"code":"83","equivalence":"wider"}]},{"code":"58160-0825-52","target":[{"code":"83","equivalence":"wider"}]},{"code":"58160-0826-11","target":[{"code":"52","equivalence":"wider"}]},{"code":"58160-0826-34","target":[{"code":"52","equivalence":"wider"}]},{"code":"58160-0826-52","target":[{"code":"52","equivalence":"wider"}]},{"code":"58160-0830-34","target":[{"code":"118","equivalence":"wider"}]},{"code":"58160-0830-52","target":[{"code":"118","equivalence":"wider"}]},{"code":"58160-0842-11","target":[{"code":"115","equivalence":"wider"}]},{"code":"58160-0842-34","target":[{"code":"115","equivalence":"wider"}]},{"code":"58160-0842-51","target":[{"code":"115","equivalence":"wider"}]},{"code":"58160-0842-52","target":[{"code":"115","equivalence":"wider"}]},{"code":"58160-0854-52","target":[{"code":"119","equivalence":"wider"}]},{"code":"58160-0879-52","target":[{"code":"140","equivalence":"wider"}]},{"code":"58160-0880-52","target":[{"code":"140","equivalence":"wider"}]},{"code":"58160-0881-52","target":[{"code":"140","equivalence":"wider"}]},{"code":"58160-0883-52","target":[{"code":"140","equivalence":"wider"}]},{"code":"58160-0898-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"58160-0900-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"58160-0901-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"58160-0903-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"58160-0905-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"58160-0907-52","target":[{"code":"150","equivalence":"wider"}]},{"code":"58160-0955-09","target":[{"code":"136","equivalence":"wider"}]},{"code":"58160-0955-09","target":[{"code":"136","equivalence":"wider"}]},{"code":"58160-0964-12","target":[{"code":"176","equivalence":"wider"}]},{"code":"58160-0964-12","target":[{"code":"176","equivalence":"wider"}]},{"code":"58160-0976-06","target":[{"code":"163","equivalence":"wider"}]},{"code":"58160-0976-20","target":[{"code":"163","equivalence":"wider"}]},{"code":"62195-0051-10","target":[{"code":"134","equivalence":"wider"}]},{"code":"62577-0613-01","target":[{"code":"153","equivalence":"wider"}]},{"code":"62577-0614-01","target":[{"code":"153","equivalence":"wider"}]},{"code":"63851-0501-01","target":[{"code":"176","equivalence":"wider"}]},{"code":"63851-0501-02","target":[{"code":"176","equivalence":"wider"}]},{"code":"63851-0612-01","target":[{"code":"153","equivalence":"wider"}]},{"code":"63851-0613-01","target":[{"code":"153","equivalence":"wider"}]},{"code":"64678-0211-01","target":[{"code":"24","equivalence":"wider"}]},{"code":"66019-0107-01","target":[{"code":"111","equivalence":"wider"}]},{"code":"66019-0108-10","target":[{"code":"111","equivalence":"wider"}]},{"code":"66019-0109-10","target":[{"code":"111","equivalence":"wider"}]},{"code":"66019-0110-10","target":[{"code":"111","equivalence":"wider"}]},{"code":"66019-0200-10","target":[{"code":"125","equivalence":"wider"}]},{"code":"66019-0300-10","target":[{"code":"149","equivalence":"wider"}]},{"code":"66019-0301-10","target":[{"code":"149","equivalence":"wider"}]},{"code":"66019-0302-10","target":[{"code":"149","equivalence":"wider"}]},{"code":"66019-0303-10","target":[{"code":"149","equivalence":"wider"}]},{"code":"66019-0304-10","target":[{"code":"149","equivalence":"wider"}]},{"code":"66019-0305-10","target":[{"code":"149","equivalence":"wider"}]},{"code":"66521-0000-01","target":[{"code":"168","equivalence":"wider"}]},{"code":"66521-0112-02","target":[{"code":"140","equivalence":"wider"}]},{"code":"66521-0112-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"66521-0113-02","target":[{"code":"140","equivalence":"wider"}]},{"code":"66521-0113-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"66521-0114-02","target":[{"code":"140","equivalence":"wider"}]},{"code":"66521-0114-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"66521-0115-02","target":[{"code":"140","equivalence":"wider"}]},{"code":"66521-0115-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"66521-0116-02","target":[{"code":"140","equivalence":"wider"}]},{"code":"66521-0116-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"66521-0117-02","target":[{"code":"140","equivalence":"wider"}]},{"code":"66521-0117-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"66521-0118-02","target":[{"code":"140","equivalence":"wider"}]},{"code":"66521-0118-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"66521-0200-02","target":[{"code":"127","equivalence":"wider"}]},{"code":"66521-0200-10","target":[{"code":"126","equivalence":"wider"}]},{"code":"69401-0000-01","target":[{"code":"25","equivalence":"wider"}]},{"code":"69401-0000-02","target":[{"code":"25","equivalence":"wider"}]},{"code":"70460-0001-01","target":[{"code":"174","equivalence":"wider"}]},{"code":"70461-0001-01","target":[{"code":"168","equivalence":"wider"}]},{"code":"70461-0002-01","target":[{"code":"168","equivalence":"wider"}]},{"code":"70461-0018-03","target":[{"code":"168","equivalence":"wider"}]},{"code":"70461-0119-02","target":[{"code":"140","equivalence":"wider"}]},{"code":"70461-0119-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"70461-0120-02","target":[{"code":"140","equivalence":"wider"}]},{"code":"70461-0120-10","target":[{"code":"141","equivalence":"wider"}]},{"code":"70461-0200-01","target":[{"code":"171","equivalence":"wider"}]},{"code":"70461-0201-01","target":[{"code":"171","equivalence":"wider"}]},{"code":"70461-0301-10","target":[{"code":"186","equivalence":"wider"}]},{"code":"70461-0318-03","target":[{"code":"171","equivalence":"wider"}]},{"code":"70461-0418-10","target":[{"code":"186","equivalence":"wider"}]},{"code":"76420-0482-01","target":[{"code":"150","equivalence":"wider"}]},{"code":"76420-0483-01","target":[{"code":"150","equivalence":"wider"}]},{"code":"63361-0245-10","target":[{"code":"146","equivalence":"wider"}]}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ImplementationGuide-hl7.fhir.us.core.json b/resources/uscore_v3.1.0/ImplementationGuide-hl7.fhir.us.core.json new file mode 100755 index 000000000..fcadb0a4f --- /dev/null +++ b/resources/uscore_v3.1.0/ImplementationGuide-hl7.fhir.us.core.json @@ -0,0 +1 @@ +{"resourceType":"ImplementationGuide","id":"hl7.fhir.us.core","text":{"status":"generated","div":"

    USCore

    The official URL for this implementation guide is:

    http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core
    "},"url":"http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core","version":"3.1.0","name":"USCore","title":"US Core","status":"active","date":"2019-11-06T13:08:22+11:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"Used by permission of HL7 International, all rights reserved Creative Commons License","packageId":"hl7.fhir.us.core","license":"CC0-1.0","fhirVersion":["4.0.1"],"definition":{"grouping":[{"name":"base"}],"resource":[{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-glucose.html"}],"reference":{"reference":"Observation/urine-glucose"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Procedure"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Procedure-rehab.html"}],"reference":{"reference":"Procedure/rehab"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CareTeam"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CareTeam-example.html"}],"reference":{"reference":"CareTeam/example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-leukocyte-esterase.html"}],"reference":{"reference":"Observation/urine-leukocyte-esterase"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Bundle"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Bundle-66c8856b-ba11-4876-8aa8-467aad8c11a2.html"}],"reference":{"reference":"Bundle/66c8856b-ba11-4876-8aa8-467aad8c11a2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-bilirubin.html"}],"reference":{"reference":"Observation/urine-bilirubin"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Condition"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Condition-hc1.html"}],"reference":{"reference":"Condition/hc1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-sediment.html"}],"reference":{"reference":"Observation/urine-sediment"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Immunization"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Immunization-imm-1.html"}],"reference":{"reference":"Immunization/imm-1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-pediatric-wt-example.html"}],"reference":{"reference":"Observation/pediatric-wt-example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Organization"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Organization-saint-luke-w-endpoint.html"}],"reference":{"reference":"Organization/saint-luke-w-endpoint"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-ph.html"}],"reference":{"reference":"Observation/urine-ph"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Encounter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Encounter-example-1.html"}],"reference":{"reference":"Encounter/example-1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DiagnosticReport"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DiagnosticReport-chest-xray-report.html"}],"reference":{"reference":"DiagnosticReport/chest-xray-report"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-sodium.html"}],"reference":{"reference":"Observation/serum-sodium"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DiagnosticReport"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DiagnosticReport-cbc.html"}],"reference":{"reference":"DiagnosticReport/cbc"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-potassium.html"}],"reference":{"reference":"Observation/serum-potassium"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Encounter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Encounter-1036.html"}],"reference":{"reference":"Encounter/1036"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-some-day-smoker.html"}],"reference":{"reference":"Observation/some-day-smoker"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Location"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Location-hl7east.html"}],"reference":{"reference":"Location/hl7east"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-co2.html"}],"reference":{"reference":"Observation/serum-co2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-protein.html"}],"reference":{"reference":"Observation/urine-protein"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Procedure"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Procedure-defib-implant.html"}],"reference":{"reference":"Procedure/defib-implant"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-usg.html"}],"reference":{"reference":"Observation/usg"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-chloride.html"}],"reference":{"reference":"Observation/serum-chloride"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-calcium.html"}],"reference":{"reference":"Observation/serum-calcium"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-color.html"}],"reference":{"reference":"Observation/urine-color"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-bp-data-absent.html"}],"reference":{"reference":"Observation/bp-data-absent"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Patient"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Patient-example.html"}],"reference":{"reference":"Patient/example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-temperature.html"}],"reference":{"reference":"Observation/temperature"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-bmi.html"}],"reference":{"reference":"Observation/bmi"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Medication"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Medication-uscore-med2.html"}],"reference":{"reference":"Medication/uscore-med2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-cells.html"}],"reference":{"reference":"Observation/urine-cells"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-length.html"}],"reference":{"reference":"Observation/length"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Device"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Device-udi-2.html"}],"reference":{"reference":"Device/udi-2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"MedicationRequest"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"MedicationRequest-uscore-mo1.html"}],"reference":{"reference":"MedicationRequest/uscore-mo1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Practitioner"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Practitioner-practitioner-2.html"}],"reference":{"reference":"Practitioner/practitioner-2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Goal"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Goal-goal-1.html"}],"reference":{"reference":"Goal/goal-1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-rbcs.html"}],"reference":{"reference":"Observation/urine-rbcs"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urobilinogen.html"}],"reference":{"reference":"Observation/urobilinogen"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Medication"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Medication-uscore-med1.html"}],"reference":{"reference":"Medication/uscore-med1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-bacteria.html"}],"reference":{"reference":"Observation/urine-bacteria"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Bundle"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Bundle-uscore-mo3.html"}],"reference":{"reference":"Bundle/uscore-mo3"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-head-circumference.html"}],"reference":{"reference":"Observation/head-circumference"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"MedicationRequest"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"MedicationRequest-self-tylenol.html"}],"reference":{"reference":"MedicationRequest/self-tylenol"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DiagnosticReport"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DiagnosticReport-metabolic-panel.html"}],"reference":{"reference":"DiagnosticReport/metabolic-panel"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Device"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Device-udi-3.html"}],"reference":{"reference":"Device/udi-3"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"MedicationRequest"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"MedicationRequest-uscore-mo2.html"}],"reference":{"reference":"MedicationRequest/uscore-mo2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Bundle"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Bundle-c887e62f-6166-419f-8268-b5ecd6c7b901.html"}],"reference":{"reference":"Bundle/c887e62f-6166-419f-8268-b5ecd6c7b901"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-bun.html"}],"reference":{"reference":"Observation/bun"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Practitioner"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Practitioner-practitioner-1.html"}],"reference":{"reference":"Practitioner/practitioner-1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-neutrophils.html"}],"reference":{"reference":"Observation/neutrophils"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-nitrite.html"}],"reference":{"reference":"Observation/urine-nitrite"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-oxygen-saturation.html"}],"reference":{"reference":"Observation/oxygen-saturation"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DiagnosticReport"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DiagnosticReport-cardiology-report.html"}],"reference":{"reference":"DiagnosticReport/cardiology-report"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-vitals-panel.html"}],"reference":{"reference":"Observation/vitals-panel"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-blood-pressure.html"}],"reference":{"reference":"Observation/blood-pressure"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-wbcs.html"}],"reference":{"reference":"Observation/urine-wbcs"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-height.html"}],"reference":{"reference":"Observation/height"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Organization"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Organization-acme-lab.html"}],"reference":{"reference":"Organization/acme-lab"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Device"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Device-udi-1.html"}],"reference":{"reference":"Device/udi-1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-hemoglobin.html"}],"reference":{"reference":"Observation/hemoglobin"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DocumentReference"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DocumentReference-episode-summary.html"}],"reference":{"reference":"DocumentReference/episode-summary"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-hemoglobin.html"}],"reference":{"reference":"Observation/urine-hemoglobin"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-heart-rate.html"}],"reference":{"reference":"Observation/heart-rate"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-epi-cells.html"}],"reference":{"reference":"Observation/urine-epi-cells"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"AllergyIntolerance"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"AllergyIntolerance-example.html"}],"reference":{"reference":"AllergyIntolerance/example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-blood-glucose.html"}],"reference":{"reference":"Observation/blood-glucose"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DiagnosticReport"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DiagnosticReport-urinalysis.html"}],"reference":{"reference":"DiagnosticReport/urinalysis"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Condition"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Condition-example.html"}],"reference":{"reference":"Condition/example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-creatinine.html"}],"reference":{"reference":"Observation/serum-creatinine"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-satO2-fiO2.html"}],"reference":{"reference":"Observation/satO2-fiO2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-total-bilirubin.html"}],"reference":{"reference":"Observation/serum-total-bilirubin"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-pediatric-bmi-example.html"}],"reference":{"reference":"Observation/pediatric-bmi-example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Organization"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Organization-example-organization-2.html"}],"reference":{"reference":"Organization/example-organization-2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-weight.html"}],"reference":{"reference":"Observation/weight"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-mchc.html"}],"reference":{"reference":"Observation/mchc"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-clarity.html"}],"reference":{"reference":"Observation/urine-clarity"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CarePlan"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CarePlan-colonoscopy.html"}],"reference":{"reference":"CarePlan/colonoscopy"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-erythrocytes.html"}],"reference":{"reference":"Observation/erythrocytes"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-ketone.html"}],"reference":{"reference":"Observation/urine-ketone"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-respiratory-rate.html"}],"reference":{"reference":"Observation/respiratory-rate"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-medication-codes.html"}],"reference":{"reference":"ValueSet/us-core-medication-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-immunization.html"}],"reference":{"reference":"StructureDefinition/us-core-immunization"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-location-address-state.html"}],"reference":{"reference":"SearchParameter/us-core-location-address-state"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-practitionerrole-practitioner.html"}],"reference":{"reference":"SearchParameter/us-core-practitionerrole-practitioner"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-observation-smokingstatus.html"}],"reference":{"reference":"ValueSet/us-core-observation-smokingstatus"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-omb-race-category.html"}],"reference":{"reference":"ValueSet/omb-race-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-practitionerrole.html"}],"reference":{"reference":"StructureDefinition/us-core-practitionerrole"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-allergy-substance.html"}],"reference":{"reference":"ValueSet/us-core-allergy-substance"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-narrative-status.html"}],"reference":{"reference":"ValueSet/us-core-narrative-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CodeSystem-cdcrec.html"}],"reference":{"reference":"CodeSystem/cdcrec"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-organization-name.html"}],"reference":{"reference":"SearchParameter/us-core-organization-name"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-observation-lab.html"}],"reference":{"reference":"StructureDefinition/us-core-observation-lab"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-diagnosticreport-code.html"}],"reference":{"reference":"SearchParameter/us-core-diagnosticreport-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-pediatric-bmi-for-age.html"}],"reference":{"reference":"StructureDefinition/pediatric-bmi-for-age"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-allergyintolerance.html"}],"reference":{"reference":"StructureDefinition/us-core-allergyintolerance"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-goal-lifecycle-status.html"}],"reference":{"reference":"SearchParameter/us-core-goal-lifecycle-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-procedure-code.html"}],"reference":{"reference":"SearchParameter/us-core-procedure-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-documentreference-type.html"}],"reference":{"reference":"ValueSet/us-core-documentreference-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-provenance-participant-type.html"}],"reference":{"reference":"ValueSet/us-core-provenance-participant-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-gender.html"}],"reference":{"reference":"SearchParameter/us-core-patient-gender"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-practitioner.html"}],"reference":{"reference":"StructureDefinition/us-core-practitioner"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-diagnosticreport-note.html"}],"reference":{"reference":"StructureDefinition/us-core-diagnosticreport-note"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-omb-ethnicity-category.html"}],"reference":{"reference":"ValueSet/omb-ethnicity-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-provenance.html"}],"reference":{"reference":"StructureDefinition/us-core-provenance"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"OperationDefinition"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"OperationDefinition-docref.html"}],"reference":{"reference":"OperationDefinition/docref"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-condition-clinical-status.html"}],"reference":{"reference":"SearchParameter/us-core-condition-clinical-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:extension"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-birthsex.html"}],"reference":{"reference":"StructureDefinition/us-core-birthsex"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-id.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-id"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careplan-category.html"}],"reference":{"reference":"SearchParameter/us-core-careplan-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-class.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-class"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-medicationrequest-patient.html"}],"reference":{"reference":"SearchParameter/us-core-medicationrequest-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CapabilityStatement"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CapabilityStatement-us-core-server.html"}],"reference":{"reference":"CapabilityStatement/us-core-server"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-condition-category.html"}],"reference":{"reference":"ValueSet/us-core-condition-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-detailed-ethnicity.html"}],"reference":{"reference":"ValueSet/detailed-ethnicity"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-patient.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-encounter.html"}],"reference":{"reference":"StructureDefinition/us-core-encounter"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-ndc-vaccine-codes.html"}],"reference":{"reference":"ValueSet/us-core-ndc-vaccine-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-patient.html"}],"reference":{"reference":"StructureDefinition/us-core-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-diagnosticreport-date.html"}],"reference":{"reference":"SearchParameter/us-core-diagnosticreport-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-procedure-icd10pcs.html"}],"reference":{"reference":"ValueSet/us-core-procedure-icd10pcs"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-provider-specialty.html"}],"reference":{"reference":"ValueSet/us-core-provider-specialty"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-procedure-date.html"}],"reference":{"reference":"SearchParameter/us-core-procedure-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-vaccines-cvx.html"}],"reference":{"reference":"ValueSet/us-core-vaccines-cvx"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-pulse-oximetry.html"}],"reference":{"reference":"StructureDefinition/us-core-pulse-oximetry"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-allergyintolerance-clinical-status.html"}],"reference":{"reference":"SearchParameter/us-core-allergyintolerance-clinical-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-date.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-medicationrequest-intent.html"}],"reference":{"reference":"SearchParameter/us-core-medicationrequest-intent"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-location.html"}],"reference":{"reference":"StructureDefinition/us-core-location"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-location-address.html"}],"reference":{"reference":"SearchParameter/us-core-location-address"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-observation-smoking-status-status.html"}],"reference":{"reference":"ValueSet/us-core-observation-smoking-status-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-usps-state.html"}],"reference":{"reference":"ValueSet/us-core-usps-state"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-practitioner-name.html"}],"reference":{"reference":"SearchParameter/us-core-practitioner-name"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-encounter-type.html"}],"reference":{"reference":"ValueSet/us-core-encounter-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-period.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-period"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-observation-code.html"}],"reference":{"reference":"SearchParameter/us-core-observation-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-location-name.html"}],"reference":{"reference":"SearchParameter/us-core-location-name"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-condition-onset-date.html"}],"reference":{"reference":"SearchParameter/us-core-condition-onset-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-given.html"}],"reference":{"reference":"SearchParameter/us-core-patient-given"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-procedure.html"}],"reference":{"reference":"StructureDefinition/us-core-procedure"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-type.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-condition-code.html"}],"reference":{"reference":"ValueSet/us-core-condition-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CodeSystem-condition-category.html"}],"reference":{"reference":"CodeSystem/condition-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-medicationrequest-encounter.html"}],"reference":{"reference":"SearchParameter/us-core-medicationrequest-encounter"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-patient.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-organization-address.html"}],"reference":{"reference":"SearchParameter/us-core-organization-address"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-observation-category.html"}],"reference":{"reference":"SearchParameter/us-core-observation-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-medication.html"}],"reference":{"reference":"StructureDefinition/us-core-medication"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-diagnosticreport-status.html"}],"reference":{"reference":"SearchParameter/us-core-diagnosticreport-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-observation-date.html"}],"reference":{"reference":"SearchParameter/us-core-observation-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-birthsex.html"}],"reference":{"reference":"ValueSet/birthsex"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-diagnosticreport-category.html"}],"reference":{"reference":"SearchParameter/us-core-diagnosticreport-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-observation-status.html"}],"reference":{"reference":"SearchParameter/us-core-observation-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-diagnosticreport-report-and-note-codes.html"}],"reference":{"reference":"ValueSet/us-core-diagnosticreport-report-and-note-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-provider-role.html"}],"reference":{"reference":"ValueSet/us-core-provider-role"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-ethnicity.html"}],"reference":{"reference":"SearchParameter/us-core-ethnicity"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-documentreference.html"}],"reference":{"reference":"StructureDefinition/us-core-documentreference"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:extension"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-direct.html"}],"reference":{"reference":"StructureDefinition/us-core-direct"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-smoking-status-observation-codes.html"}],"reference":{"reference":"ValueSet/us-core-smoking-status-observation-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-careteam-provider-roles.html"}],"reference":{"reference":"ValueSet/us-core-careteam-provider-roles"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-type.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-date.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-diagnosticreport-category.html"}],"reference":{"reference":"ValueSet/us-core-diagnosticreport-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-birthdate.html"}],"reference":{"reference":"SearchParameter/us-core-patient-birthdate"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-careteam.html"}],"reference":{"reference":"StructureDefinition/us-core-careteam"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-procedure-status.html"}],"reference":{"reference":"SearchParameter/us-core-procedure-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-clinical-note-type.html"}],"reference":{"reference":"ValueSet/us-core-clinical-note-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-status.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ConceptMap"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ConceptMap-ndc-cvx.html"}],"reference":{"reference":"ConceptMap/ndc-cvx"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:extension"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-ethnicity.html"}],"reference":{"reference":"StructureDefinition/us-core-ethnicity"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careplan-status.html"}],"reference":{"reference":"SearchParameter/us-core-careplan-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-careplan.html"}],"reference":{"reference":"StructureDefinition/us-core-careplan"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-condition-patient.html"}],"reference":{"reference":"SearchParameter/us-core-condition-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-allergyintolerance-patient.html"}],"reference":{"reference":"SearchParameter/us-core-allergyintolerance-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-device-patient.html"}],"reference":{"reference":"SearchParameter/us-core-device-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-condition-code.html"}],"reference":{"reference":"SearchParameter/us-core-condition-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-observation-patient.html"}],"reference":{"reference":"SearchParameter/us-core-observation-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-race.html"}],"reference":{"reference":"SearchParameter/us-core-race"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careplan-patient.html"}],"reference":{"reference":"SearchParameter/us-core-careplan-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-family.html"}],"reference":{"reference":"SearchParameter/us-core-patient-family"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-smokingstatus.html"}],"reference":{"reference":"StructureDefinition/us-core-smokingstatus"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-medicationrequest-status.html"}],"reference":{"reference":"SearchParameter/us-core-medicationrequest-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:extension"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-race.html"}],"reference":{"reference":"StructureDefinition/us-core-race"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-location-address-postalcode.html"}],"reference":{"reference":"SearchParameter/us-core-location-address-postalcode"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-id.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-id"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-medicationrequest-authoredon.html"}],"reference":{"reference":"SearchParameter/us-core-medicationrequest-authoredon"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-status.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-documentreference-category.html"}],"reference":{"reference":"ValueSet/us-core-documentreference-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-procedure-patient.html"}],"reference":{"reference":"SearchParameter/us-core-procedure-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-goal-target-date.html"}],"reference":{"reference":"SearchParameter/us-core-goal-target-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-diagnosticreport-patient.html"}],"reference":{"reference":"SearchParameter/us-core-diagnosticreport-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careplan-date.html"}],"reference":{"reference":"SearchParameter/us-core-careplan-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careteam-patient.html"}],"reference":{"reference":"SearchParameter/us-core-careteam-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-organization.html"}],"reference":{"reference":"StructureDefinition/us-core-organization"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-immunization-date.html"}],"reference":{"reference":"SearchParameter/us-core-immunization-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-identifier.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-identifier"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-practitionerrole-specialty.html"}],"reference":{"reference":"SearchParameter/us-core-practitionerrole-specialty"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-name.html"}],"reference":{"reference":"SearchParameter/us-core-patient-name"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-device-type.html"}],"reference":{"reference":"SearchParameter/us-core-device-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-procedure-code.html"}],"reference":{"reference":"ValueSet/us-core-procedure-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-diagnosticreport-lab.html"}],"reference":{"reference":"StructureDefinition/us-core-diagnosticreport-lab"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-goal-patient.html"}],"reference":{"reference":"SearchParameter/us-core-goal-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-simple-language.html"}],"reference":{"reference":"ValueSet/simple-language"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-immunization-patient.html"}],"reference":{"reference":"SearchParameter/us-core-immunization-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-condition.html"}],"reference":{"reference":"StructureDefinition/us-core-condition"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-pediatric-weight-for-height.html"}],"reference":{"reference":"StructureDefinition/pediatric-weight-for-height"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-observation-value-codes.html"}],"reference":{"reference":"ValueSet/us-core-observation-value-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-id.html"}],"reference":{"reference":"SearchParameter/us-core-patient-id"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-location-address-city.html"}],"reference":{"reference":"SearchParameter/us-core-location-address-city"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-goal.html"}],"reference":{"reference":"StructureDefinition/us-core-goal"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careteam-status.html"}],"reference":{"reference":"SearchParameter/us-core-careteam-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CodeSystem-us-core-documentreference-category.html"}],"reference":{"reference":"CodeSystem/us-core-documentreference-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CodeSystem-us-core-provenance-participant-type.html"}],"reference":{"reference":"CodeSystem/us-core-provenance-participant-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-diagnosticreport-lab-codes.html"}],"reference":{"reference":"ValueSet/us-core-diagnosticreport-lab-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CodeSystem-careplan-category.html"}],"reference":{"reference":"CodeSystem/careplan-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-category.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CapabilityStatement"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CapabilityStatement-us-core-client.html"}],"reference":{"reference":"CapabilityStatement/us-core-client"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-practitioner-identifier.html"}],"reference":{"reference":"SearchParameter/us-core-practitioner-identifier"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-identifier.html"}],"reference":{"reference":"SearchParameter/us-core-patient-identifier"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-condition-category.html"}],"reference":{"reference":"SearchParameter/us-core-condition-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-immunization-status.html"}],"reference":{"reference":"SearchParameter/us-core-immunization-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-medicationrequest.html"}],"reference":{"reference":"StructureDefinition/us-core-medicationrequest"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-implantable-device.html"}],"reference":{"reference":"StructureDefinition/us-core-implantable-device"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-detailed-race.html"}],"reference":{"reference":"ValueSet/detailed-race"},"exampleBoolean":false}],"page":{"nameUrl":"index.html","title":"Home","generation":"markdown","page":[{"nameUrl":"guidance.html","title":"Guidance","generation":"markdown","page":[{"nameUrl":"general-guidance.html","title":"General Guidance","generation":"markdown"},{"nameUrl":"clinical-notes-guidance.html","title":"Clinical Notes Guidance","generation":"markdown"},{"nameUrl":"all-meds.html","title":"Medication List Guidance","generation":"markdown"},{"nameUrl":"basic-provenance.html","title":"Basic Provenance","generation":"markdown"},{"nameUrl":"r2-r4-guidance.html","title":"DSTU2 to R4 Conversion","generation":"markdown"},{"nameUrl":"future-of-us-core.html","title":"Future of US Core","generation":"markdown"}]},{"nameUrl":"profiles.html","title":"Profiles and Extensions","generation":"markdown","page":[{"nameUrl":"StructureDefinition-us-core-immunization.html","title":"StructureDefinition US Core Immunization","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-practitionerrole.html","title":"StructureDefinition US Core PractitionerRole","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-observation-lab.html","title":"StructureDefinition US Core Observation Lab","generation":"generated"},{"nameUrl":"StructureDefinition-pediatric-bmi-for-age.html","title":"StructureDefinition Pediatric Bmi For Age","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-allergyintolerance.html","title":"StructureDefinition US Core AllergyIntolerance","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-practitioner.html","title":"StructureDefinition US Core Practitioner","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-diagnosticreport-note.html","title":"StructureDefinition US Core DiagnosticReport Note","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-provenance.html","title":"StructureDefinition US Core Provenance","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-birthsex.html","title":"StructureDefinition US Core Birthsex","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-encounter.html","title":"StructureDefinition US Core Encounter","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-patient.html","title":"StructureDefinition US Core Patient","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-pulse-oximetry.html","title":"StructureDefinition US Core Pulse Oximetry","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-location.html","title":"StructureDefinition US Core Location","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-procedure.html","title":"StructureDefinition US Core Procedure","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-medication.html","title":"StructureDefinition US Core Medication","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-documentreference.html","title":"StructureDefinition US Core DocumentReference","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-direct.html","title":"StructureDefinition US Core Direct","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-careteam.html","title":"StructureDefinition US Core CareTeam","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-ethnicity.html","title":"StructureDefinition US Core Ethnicity","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-careplan.html","title":"StructureDefinition US Core CarePlan","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-smokingstatus.html","title":"StructureDefinition US Core Smokingstatus","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-race.html","title":"StructureDefinition US Core Race","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-organization.html","title":"StructureDefinition US Core Organization","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-diagnosticreport-lab.html","title":"StructureDefinition US Core DiagnosticReport Lab","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-condition.html","title":"StructureDefinition US Core Condition","generation":"generated"},{"nameUrl":"StructureDefinition-pediatric-weight-for-height.html","title":"StructureDefinition Pediatric Weight For Height","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-goal.html","title":"StructureDefinition US Core Goal","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-medicationrequest.html","title":"StructureDefinition US Core MedicationRequest","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-implantable-device.html","title":"StructureDefinition US Core Implantable Device","generation":"generated"}]},{"nameUrl":"operations.html","title":"Operations","generation":"markdown","page":[{"nameUrl":"OperationDefinition-docref.html","title":"OperationDefinition Docref","generation":"generated"}]},{"nameUrl":"terminology.html","title":"Terminology","generation":"markdown","page":[{"nameUrl":"ValueSet-us-core-medication-codes.html","title":"ValueSet US Core Medication Codes","generation":"generated"},{"nameUrl":"ValueSet-us-core-observation-smokingstatus.html","title":"ValueSet US Core Observation Smokingstatus","generation":"generated"},{"nameUrl":"ValueSet-omb-race-category.html","title":"ValueSet Omb Race Category","generation":"generated"},{"nameUrl":"ValueSet-us-core-allergy-substance.html","title":"ValueSet US Core Allergy Substance","generation":"generated"},{"nameUrl":"ValueSet-us-core-narrative-status.html","title":"ValueSet US Core Narrative Status","generation":"generated"},{"nameUrl":"ValueSet-us-core-documentreference-type.html","title":"ValueSet US Core DocumentReference Type","generation":"generated"},{"nameUrl":"ValueSet-omb-ethnicity-category.html","title":"ValueSet Omb Ethnicity Category","generation":"generated"},{"nameUrl":"ValueSet-us-core-condition-category.html","title":"ValueSet US Core Condition Category","generation":"generated"},{"nameUrl":"ValueSet-detailed-ethnicity.html","title":"ValueSet Detailed Ethnicity","generation":"generated"},{"nameUrl":"ValueSet-us-core-ndc-vaccine-codes.html","title":"ValueSet US Core Ndc Vaccine Codes","generation":"generated"},{"nameUrl":"ValueSet-us-core-procedure-icd10pcs.html","title":"ValueSet US Core Procedure Icd10pcs","generation":"generated"},{"nameUrl":"ValueSet-us-core-provider-specialty.html","title":"ValueSet US Core Provider Specialty","generation":"generated"},{"nameUrl":"ValueSet-us-core-vaccines-cvx.html","title":"ValueSet US Core Vaccines Cvx","generation":"generated"},{"nameUrl":"ValueSet-us-core-observation-smoking-status-status.html","title":"ValueSet US Core Observation Smoking Status Status","generation":"generated"},{"nameUrl":"ValueSet-us-core-usps-state.html","title":"ValueSet US Core Usps State","generation":"generated"},{"nameUrl":"ValueSet-us-core-encounter-type.html","title":"ValueSet US Core Encounter Type","generation":"generated"},{"nameUrl":"ValueSet-us-core-condition-code.html","title":"ValueSet US Core Condition Code","generation":"generated"},{"nameUrl":"ValueSet-birthsex.html","title":"ValueSet Birthsex","generation":"generated"},{"nameUrl":"ValueSet-us-core-diagnosticreport-report-and-note-codes.html","title":"ValueSet US Core DiagnosticReport Report And Note Codes","generation":"generated"},{"nameUrl":"ValueSet-us-core-provider-role.html","title":"ValueSet US Core Provider Role","generation":"generated"},{"nameUrl":"ValueSet-us-core-smoking-status-observation-codes.html","title":"ValueSet US Core Smoking Status Observation Codes","generation":"generated"},{"nameUrl":"ValueSet-us-core-careteam-provider-roles.html","title":"ValueSet US Core CareTeam Provider Roles","generation":"generated"},{"nameUrl":"ValueSet-us-core-diagnosticreport-category.html","title":"ValueSet US Core DiagnosticReport Category","generation":"generated"},{"nameUrl":"ValueSet-us-core-clinical-note-type.html","title":"ValueSet US Core Clinical Note Type","generation":"generated"},{"nameUrl":"ValueSet-us-core-documentreference-category.html","title":"ValueSet US Core DocumentReference Category","generation":"generated"},{"nameUrl":"ValueSet-us-core-procedure-code.html","title":"ValueSet US Core Procedure Code","generation":"generated"},{"nameUrl":"ValueSet-simple-language.html","title":"ValueSet Simple Language","generation":"generated"},{"nameUrl":"ValueSet-us-core-observation-value-codes.html","title":"ValueSet US Core Observation Value Codes","generation":"generated"},{"nameUrl":"ValueSet-us-core-diagnosticreport-lab-codes.html","title":"ValueSet US Core DiagnosticReport Lab Codes","generation":"generated"},{"nameUrl":"ValueSet-detailed-race.html","title":"ValueSet Detailed Race","generation":"generated"},{"nameUrl":"CodeSystem-cdcrec.html","title":"CodeSystem Cdcrec","generation":"generated"},{"nameUrl":"CodeSystem-condition-category.html","title":"CodeSystem Condition Category","generation":"generated"},{"nameUrl":"CodeSystem-us-core-documentreference-category.html","title":"CodeSystem US Core DocumentReference Category","generation":"generated"},{"nameUrl":"CodeSystem-careplan-category.html","title":"CodeSystem CarePlan Category","generation":"generated"},{"nameUrl":"ConceptMap-ndc-cvx.html","title":"ConceptMap Ndc Cvx","generation":"generated"}]},{"nameUrl":"searchparameters.html","title":"Search Parameters","generation":"markdown","page":[{"nameUrl":"SearchParameter-us-core-location-address-state.html","title":"SearchParameter US Core Location Address State","generation":"generated"},{"nameUrl":"SearchParameter-us-core-practitionerrole-practitioner.html","title":"SearchParameter US Core PractitionerRole Practitioner","generation":"generated"},{"nameUrl":"SearchParameter-us-core-organization-name.html","title":"SearchParameter US Core Organization Name","generation":"generated"},{"nameUrl":"SearchParameter-us-core-diagnosticreport-code.html","title":"SearchParameter US Core DiagnosticReport Code","generation":"generated"},{"nameUrl":"SearchParameter-us-core-goal-lifecycle-status.html","title":"SearchParameter US Core Goal Lifecycle Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-procedure-code.html","title":"SearchParameter US Core Procedure Code","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-gender.html","title":"SearchParameter US Core Patient Gender","generation":"generated"},{"nameUrl":"SearchParameter-us-core-condition-clinical-status.html","title":"SearchParameter US Core Condition Clinical Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-id.html","title":"SearchParameter US Core DocumentReference Id","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careplan-category.html","title":"SearchParameter US Core CarePlan Category","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-class.html","title":"SearchParameter US Core Encounter Class","generation":"generated"},{"nameUrl":"SearchParameter-us-core-medicationrequest-patient.html","title":"SearchParameter US Core MedicationRequest Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-patient.html","title":"SearchParameter US Core DocumentReference Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-diagnosticreport-date.html","title":"SearchParameter US Core DiagnosticReport Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-procedure-date.html","title":"SearchParameter US Core Procedure Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-allergyintolerance-clinical-status.html","title":"SearchParameter US Core AllergyIntolerance Clinical Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-date.html","title":"SearchParameter US Core DocumentReference Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-medicationrequest-intent.html","title":"SearchParameter US Core MedicationRequest Intent","generation":"generated"},{"nameUrl":"SearchParameter-us-core-location-address.html","title":"SearchParameter US Core Location Address","generation":"generated"},{"nameUrl":"SearchParameter-us-core-practitioner-name.html","title":"SearchParameter US Core Practitioner Name","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-period.html","title":"SearchParameter US Core DocumentReference Period","generation":"generated"},{"nameUrl":"SearchParameter-us-core-observation-code.html","title":"SearchParameter US Core Observation Code","generation":"generated"},{"nameUrl":"SearchParameter-us-core-location-name.html","title":"SearchParameter US Core Location Name","generation":"generated"},{"nameUrl":"SearchParameter-us-core-condition-onset-date.html","title":"SearchParameter US Core Condition Onset Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-given.html","title":"SearchParameter US Core Patient Given","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-type.html","title":"SearchParameter US Core Encounter Type","generation":"generated"},{"nameUrl":"SearchParameter-us-core-medicationrequest-encounter.html","title":"SearchParameter US Core MedicationRequest Encounter","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-patient.html","title":"SearchParameter US Core Encounter Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-organization-address.html","title":"SearchParameter US Core Organization Address","generation":"generated"},{"nameUrl":"SearchParameter-us-core-observation-category.html","title":"SearchParameter US Core Observation Category","generation":"generated"},{"nameUrl":"SearchParameter-us-core-diagnosticreport-status.html","title":"SearchParameter US Core DiagnosticReport Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-observation-date.html","title":"SearchParameter US Core Observation Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-diagnosticreport-category.html","title":"SearchParameter US Core DiagnosticReport Category","generation":"generated"},{"nameUrl":"SearchParameter-us-core-observation-status.html","title":"SearchParameter US Core Observation Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-ethnicity.html","title":"SearchParameter US Core Ethnicity","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-type.html","title":"SearchParameter US Core DocumentReference Type","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-date.html","title":"SearchParameter US Core Encounter Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-birthdate.html","title":"SearchParameter US Core Patient Birthdate","generation":"generated"},{"nameUrl":"SearchParameter-us-core-procedure-status.html","title":"SearchParameter US Core Procedure Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-status.html","title":"SearchParameter US Core Encounter Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careplan-status.html","title":"SearchParameter US Core CarePlan Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-condition-patient.html","title":"SearchParameter US Core Condition Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-allergyintolerance-patient.html","title":"SearchParameter US Core AllergyIntolerance Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-device-patient.html","title":"SearchParameter US Core Device Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-condition-code.html","title":"SearchParameter US Core Condition Code","generation":"generated"},{"nameUrl":"SearchParameter-us-core-observation-patient.html","title":"SearchParameter US Core Observation Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-race.html","title":"SearchParameter US Core Race","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careplan-patient.html","title":"SearchParameter US Core CarePlan Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-family.html","title":"SearchParameter US Core Patient Family","generation":"generated"},{"nameUrl":"SearchParameter-us-core-medicationrequest-status.html","title":"SearchParameter US Core MedicationRequest Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-location-address-postalcode.html","title":"SearchParameter US Core Location Address Postalcode","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-id.html","title":"SearchParameter US Core Encounter Id","generation":"generated"},{"nameUrl":"SearchParameter-us-core-medicationrequest-authoredon.html","title":"SearchParameter US Core MedicationRequest Authoredon","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-status.html","title":"SearchParameter US Core DocumentReference Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-procedure-patient.html","title":"SearchParameter US Core Procedure Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-goal-target-date.html","title":"SearchParameter US Core Goal Target Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-diagnosticreport-patient.html","title":"SearchParameter US Core DiagnosticReport Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careplan-date.html","title":"SearchParameter US Core CarePlan Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careteam-patient.html","title":"SearchParameter US Core CareTeam Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-immunization-date.html","title":"SearchParameter US Core Immunization Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-identifier.html","title":"SearchParameter US Core Encounter Identifier","generation":"generated"},{"nameUrl":"SearchParameter-us-core-practitionerrole-specialty.html","title":"SearchParameter US Core PractitionerRole Specialty","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-name.html","title":"SearchParameter US Core Patient Name","generation":"generated"},{"nameUrl":"SearchParameter-us-core-device-type.html","title":"SearchParameter US Core Device Type","generation":"generated"},{"nameUrl":"SearchParameter-us-core-goal-patient.html","title":"SearchParameter US Core Goal Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-immunization-patient.html","title":"SearchParameter US Core Immunization Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-id.html","title":"SearchParameter US Core Patient Id","generation":"generated"},{"nameUrl":"SearchParameter-us-core-location-address-city.html","title":"SearchParameter US Core Location Address City","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careteam-status.html","title":"SearchParameter US Core CareTeam Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-category.html","title":"SearchParameter US Core DocumentReference Category","generation":"generated"},{"nameUrl":"SearchParameter-us-core-practitioner-identifier.html","title":"SearchParameter US Core Practitioner Identifier","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-identifier.html","title":"SearchParameter US Core Patient Identifier","generation":"generated"},{"nameUrl":"SearchParameter-us-core-condition-category.html","title":"SearchParameter US Core Condition Category","generation":"generated"},{"nameUrl":"SearchParameter-us-core-immunization-status.html","title":"SearchParameter US Core Immunization Status","generation":"generated"}]},{"nameUrl":"capstatements.html","title":"Capability Statements","generation":"markdown","page":[{"nameUrl":"CapabilityStatement-us-core-server.html","title":"CapabilityStatement US Core Server","generation":"generated"},{"nameUrl":"CapabilityStatement-us-core-client.html","title":"CapabilityStatement US Core Client","generation":"generated"}]},{"nameUrl":"security.html","title":"Security","generation":"markdown"},{"nameUrl":"downloads.html","title":"Downloads","generation":"markdown"},{"nameUrl":"all-examples.html","title":"All Examples","generation":"markdown"},{"nameUrl":"toc.html","title":"Table of Contents","generation":"html"}]}}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/OperationDefinition-docref.json b/resources/uscore_v3.1.0/OperationDefinition-docref.json new file mode 100755 index 000000000..1b23ac270 --- /dev/null +++ b/resources/uscore_v3.1.0/OperationDefinition-docref.json @@ -0,0 +1 @@ +{"resourceType":"OperationDefinition","id":"docref","text":{"status":"generated","div":"

    USCoreFetchDocumentReferences

    OPERATION: USCoreFetchDocumentReferences

    The official URL for this operation definition is:

    http://hl7.org/fhir/us/core/OperationDefinition/docref

    This operation is used to return all the references to documents related to a patient.

    \n

    The operation takes the optional input parameters:

    \n
      \n
    • patient id
    • \n
    • start date
    • \n
    • end date
    • \n
    • document type
    • \n
    \n

    and returns a Bundle of type "searchset" containing US Core DocumentReference Profiles for the patient. If the server has or can create documents that are related to the patient, and that are available for the given user, the server returns the DocumentReference profiles needed to support the records. The principle intended use for this operation is to provide a provider or patient with access to their available document information.

    \n

    This operation is different from a search by patient and type and date range because:

    \n
      \n
    1. \n

      It is used to request a server generate a document based on the specified parameters.

      \n
    2. \n
    3. \n

      If no parameters are specified, the server SHALL return a DocumentReference to the patient's most current CCD

      \n
    4. \n
    5. \n

      If the server cannot generate a document based on the specified parameters, the operation will return an empty search bundle.

      \n
    6. \n
    \n

    This operation is the same as a FHIR RESTful search by patient,type and date range because:

    \n
      \n
    1. References for existing documents that meet the requirements of the request SHOULD also be returned unless the client indicates they are only interested in 'on-demand' documents using the on-demand parameter.
    2. \n
    \n

    Parameters

    UseNameCardinalityTypeBindingDocumentation
    INpatient1..1id

    The id of the patient resource located on the server on which this operation is executed. If there is no match, an empty Bundle is returned

    \n
    INstart0..1date

    The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no start date is provided, all documents prior to the end date are in scope. If neither a start date nor an end date is provided, the most recent or current document is in scope.

    \n
    INend0..1date

    The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no end date is provided, all documents subsequent to the start date are in scope. If neither a start date nor an end date is provided, the most recent or current document is in scope

    \n
    INtype0..1CodeableConcepthttp://hl7.org/fhir/ValueSet/c80-doc-typecodes (Required)

    The type relates to document type e.g. for the LOINC code for a C-CDA Clinical Summary of Care (CCD) is 34133-9 (Summary of episode note). If no type is provided, the CCD document, if available, SHALL be in scope and all other document types MAY be in scope

    \n
    INon-demand0..1boolean

    This on-demand parameter allows client to dictate whether they are requesting only ‘on-demand’ or both ‘on-demand’ and 'stable' documents (or delayed/deferred assembly) that meet the query parameters

    \n
    OUTreturn1..1Bundle

    The bundle type is "searchset"containing US Core DocumentReference Profiles

    \n
      \n
    • \n

      The server is responsible for determining what resources, if any, to return as included resources rather than the client specifying which ones. This frees the client from needing to determine what it could or should ask for. For example, the server may return the referenced document as an included FHIR Binary resource within the return bundle. The server's CapabilityStatement should document this behavior.

      \n
    • \n
    • \n

      The document itself can be subsequently retrieved using the link provided in the DocumentReference.content.attachment.url element. The link could be a FHIR endpoint to a Binary Resource or some other document repository.

      \n
    • \n
    • \n

      It is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single patient, or determine whether the context has the rights to the nominated patient, if there is one. If there is no nominated patient (e.g. the operation is invoked at the system level) and the context is not associated with a single patient record, then the server should return an error. Specifying the relationship between the context, a user and patient records is outside the scope of this specification

      \n
    • \n
    \n
    "},"url":"http://hl7.org/fhir/us/core/OperationDefinition/docref","version":"3.1.0","name":"USCoreFetchDocumentReferences","title":"US Core Fetch DocumentReferences","status":"active","kind":"operation","date":"2019-05-21T00:00:00+10:00","publisher":"US Core Project","description":"This operation is used to return all the references to documents related to a patient. \n\n The operation takes the optional input parameters: \n - patient id\n - start date\n - end date\n - document type \n\n and returns a [Bundle](http://hl7.org/fhir/bundle.html) of type \"searchset\" containing [US Core DocumentReference Profiles](http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference) for the patient. If the server has or can create documents that are related to the patient, and that are available for the given user, the server returns the DocumentReference profiles needed to support the records. The principle intended use for this operation is to provide a provider or patient with access to their available document information. \n\n This operation is *different* from a search by patient and type and date range because: \n\n 1. It is used to request a server *generate* a document based on the specified parameters. \n\n 1. If no parameters are specified, the server SHALL return a DocumentReference to the patient's most current CCD \n\n 1. If the server cannot *generate* a document based on the specified parameters, the operation will return an empty search bundle. \n\n This operation is the *same* as a FHIR RESTful search by patient,type and date range because: \n\n 1. References for *existing* documents that meet the requirements of the request SHOULD also be returned unless the client indicates they are only interested in 'on-demand' documents using the *on-demand* parameter.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"docref","comment":" - The server is responsible for determining what resources, if any, to return as [included](http://hl7.org/fhir/R4/search.html#revinclude) resources rather than the client specifying which ones. This frees the client from needing to determine what it could or should ask for. For example, the server may return the referenced document as an included FHIR Binary resource within the return bundle. The server's CapabilityStatement should document this behavior. \n\n - The document itself can be subsequently retrieved using the link provided in the `DocumentReference.content.attachment.url element`. The link could be a FHIR endpoint to a [Binary](http://hl7.org/fhir/R4/binary.html) Resource or some other document repository. \n\n - It is assumed that the server has identified and secured the context appropriately, and can either associate the authorization context with a single patient, or determine whether the context has the rights to the nominated patient, if there is one. If there is no nominated patient (e.g. the operation is invoked at the system level) and the context is not associated with a single patient record, then the server should return an error. Specifying the relationship between the context, a user and patient records is outside the scope of this specification","system":false,"type":true,"instance":false,"parameter":[{"name":"patient","use":"in","min":1,"max":"1","documentation":"The id of the patient resource located on the server on which this operation is executed. If there is no match, an empty Bundle is returned","type":"id"},{"name":"start","use":"in","min":0,"max":"1","documentation":"The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no start date is provided, all documents prior to the end date are in scope. If neither a start date nor an end date is provided, the most recent or current document is in scope.","type":"date"},{"name":"end","use":"in","min":0,"max":"1","documentation":"The date range relates to care dates, not record currency dates - e.g. all records relating to care provided in a certain date range. If no end date is provided, all documents subsequent to the start date are in scope. If neither a start date nor an end date is provided, the most recent or current document is in scope","type":"date"},{"name":"type","use":"in","min":0,"max":"1","documentation":"The type relates to document type e.g. for the LOINC code for a C-CDA Clinical Summary of Care (CCD) is 34133-9 (Summary of episode note). If no type is provided, the CCD document, if available, SHALL be in scope and all other document types MAY be in scope","type":"CodeableConcept","binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/c80-doc-typecodes"}},{"name":"on-demand","use":"in","min":0,"max":"1","documentation":"This on-demand parameter allows client to dictate whether they are requesting only ‘on-demand’ or both ‘on-demand’ and 'stable' documents (or delayed/deferred assembly) that meet the query parameters","type":"boolean"},{"name":"return","use":"out","min":1,"max":"1","documentation":"The bundle type is \"searchset\"containing [US Core DocumentReference Profiles](http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference)","type":"Bundle"}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-allergyintolerance-clinical-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-allergyintolerance-clinical-status.json new file mode 100755 index 000000000..a4deebed5 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-allergyintolerance-clinical-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-allergyintolerance-clinical-status","text":{"status":"generated","div":"

    SearchParameter: USCoreAllergyintoleranceClinicalStatus

    description : active | inactive | resolved
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-allergyintolerance-clinical-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-clinical-status\n\t\t\t

    version : 4.1.0

    name : USCoreAllergyintoleranceClinicalStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/AllergyIntolerance-clinical-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : clinical-status\n\t\t\t

    base :AllergyIntolerance

    type : token

    expression : AllergyIntolerance.clinicalStatus\n\t\t\t

    xpath : f:AllergyIntolerance/f:clinicalStatus\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-clinical-status","version":"3.1.0","name":"USCoreAllergyintoleranceClinicalStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/AllergyIntolerance-clinical-status","status":"active","experimental":false,"date":"2019-09-23T19:48:44+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"active | inactive | resolved
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"clinical-status","base":["AllergyIntolerance"],"type":"token","expression":"AllergyIntolerance.clinicalStatus","xpath":"f:AllergyIntolerance/f:clinicalStatus","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-allergyintolerance-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-allergyintolerance-patient.json new file mode 100755 index 000000000..055a83cf7 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-allergyintolerance-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-allergyintolerance-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreAllergyintolerancePatient

    description : Who the sensitivity is for
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-allergyintolerance-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient\n\t\t\t

    version : 4.1.0

    name : USCoreAllergyintolerancePatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :AllergyIntolerance

    type : reference

    expression : AllergyIntolerance.patient\n\t\t\t

    xpath : f:AllergyIntolerance/f:patient\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-allergyintolerance-patient","version":"3.1.0","name":"USCoreAllergyintolerancePatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:44+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Who the sensitivity is for
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["AllergyIntolerance"],"type":"reference","expression":"AllergyIntolerance.patient","xpath":"f:AllergyIntolerance/f:patient","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-category.json b/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-category.json new file mode 100755 index 000000000..e4690cc35 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-category.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-careplan-category","text":{"status":"generated","div":"

    SearchParameter: USCoreCareplanCategory

    description : Type of plan
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-careplan-category

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-category\n\t\t\t

    version : 4.1.0

    name : USCoreCareplanCategory

    derivedFrom : http://hl7.org/fhir/SearchParameter/CarePlan-category\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : category\n\t\t\t

    base :CarePlan

    type : token

    expression : CarePlan.category\n\t\t\t

    xpath : f:CarePlan/f:category\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-category","version":"3.1.0","name":"USCoreCareplanCategory","derivedFrom":"http://hl7.org/fhir/SearchParameter/CarePlan-category","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Type of plan
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"category","base":["CarePlan"],"type":"token","expression":"CarePlan.category","xpath":"f:CarePlan/f:category","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-date.json b/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-date.json new file mode 100755 index 000000000..5c479bdd1 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-date.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-careplan-date","text":{"status":"generated","div":"

    SearchParameter: USCoreCareplanDate

    description : Time period plan covers
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-careplan-date

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-date\n\t\t\t

    version : 4.1.0

    name : USCoreCareplanDate

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-date\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : date\n\t\t\t

    base :CarePlan

    type : date

    expression : CarePlan.period\n\t\t\t

    xpath : f:CarePlan/f:period\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-date","version":"3.1.0","name":"USCoreCareplanDate","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-date","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Time period plan covers
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"date","base":["CarePlan"],"type":"date","expression":"CarePlan.period","xpath":"f:CarePlan/f:period","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-patient.json new file mode 100755 index 000000000..108907161 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-careplan-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreCareplanPatient

    description : Who the care plan is for
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-careplan-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-patient\n\t\t\t

    version : 4.1.0

    name : USCoreCareplanPatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :CarePlan

    type : reference

    expression : CarePlan.subject.where(resolve() is Patient)\n\t\t\t

    xpath : f:CarePlan/f:subject\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-patient","version":"3.1.0","name":"USCoreCareplanPatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Who the care plan is for
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["CarePlan"],"type":"reference","expression":"CarePlan.subject.where(resolve() is Patient)","xpath":"f:CarePlan/f:subject","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-status.json new file mode 100755 index 000000000..30b36f2ce --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-careplan-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-careplan-status","text":{"status":"generated","div":"

    SearchParameter: USCoreCareplanStatus

    description : draft | active | suspended | completed | entered-in-error | cancelled | unknown
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-careplan-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-status\n\t\t\t

    version : 4.1.0

    name : USCoreCareplanStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/CarePlan-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : status\n\t\t\t

    base :CarePlan

    type : token

    expression : CarePlan.status\n\t\t\t

    xpath : f:CarePlan/f:status\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = SHALL)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careplan-status","version":"3.1.0","name":"USCoreCareplanStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/CarePlan-status","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"draft | active | suspended | completed | entered-in-error | cancelled | unknown
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"status","base":["CarePlan"],"type":"token","expression":"CarePlan.status","xpath":"f:CarePlan/f:status","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-careteam-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-careteam-patient.json new file mode 100755 index 000000000..7a5bbf125 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-careteam-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-careteam-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreCareteamPatient

    description : Who care team is for
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-careteam-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-patient\n\t\t\t

    version : 4.1.0

    name : USCoreCareteamPatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :CareTeam

    type : reference

    expression : CareTeam.subject.where(resolve() is Patient)\n\t\t\t

    xpath : f:CareTeam/f:subject\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-patient","version":"3.1.0","name":"USCoreCareteamPatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Who care team is for
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["CareTeam"],"type":"reference","expression":"CareTeam.subject.where(resolve() is Patient)","xpath":"f:CareTeam/f:subject","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-careteam-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-careteam-status.json new file mode 100755 index 000000000..c93555dbc --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-careteam-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-careteam-status","text":{"status":"generated","div":"

    SearchParameter: USCoreCareteamStatus

    description : proposed | active | suspended | inactive | entered-in-error
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-careteam-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-status\n\t\t\t

    version : 4.1.0

    name : USCoreCareteamStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/CareTeam-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : status\n\t\t\t

    base :CareTeam

    type : token

    expression : CareTeam.status\n\t\t\t

    xpath : f:CareTeam/f:status\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = SHALL)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-careteam-status","version":"3.1.0","name":"USCoreCareteamStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/CareTeam-status","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"proposed | active | suspended | inactive | entered-in-error
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"status","base":["CareTeam"],"type":"token","expression":"CareTeam.status","xpath":"f:CareTeam/f:status","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-condition-category.json b/resources/uscore_v3.1.0/SearchParameter-us-core-condition-category.json new file mode 100755 index 000000000..7aff33322 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-condition-category.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-condition-category","text":{"status":"generated","div":"

    SearchParameter: USCoreConditionCategory

    description : The category of the condition
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-condition-category

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-category\n\t\t\t

    version : 4.1.0

    name : USCoreConditionCategory

    derivedFrom : http://hl7.org/fhir/SearchParameter/Condition-category\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : category\n\t\t\t

    base :Condition

    type : token

    expression : Condition.category\n\t\t\t

    xpath : f:Condition/f:category\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-category","version":"3.1.0","name":"USCoreConditionCategory","derivedFrom":"http://hl7.org/fhir/SearchParameter/Condition-category","status":"active","experimental":false,"date":"2019-09-23T19:48:44+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The category of the condition
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"category","base":["Condition"],"type":"token","expression":"Condition.category","xpath":"f:Condition/f:category","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-condition-clinical-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-condition-clinical-status.json new file mode 100755 index 000000000..75baf7846 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-condition-clinical-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-condition-clinical-status","text":{"status":"generated","div":"

    SearchParameter: USCoreConditionClinicalStatus

    description : The clinical status of the condition
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-condition-clinical-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-clinical-status\n\t\t\t

    version : 4.1.0

    name : USCoreConditionClinicalStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/Condition-clinical-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : clinical-status\n\t\t\t

    base :Condition

    type : token

    expression : Condition.clinicalStatus\n\t\t\t

    xpath : f:Condition/f:clinicalStatus\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-clinical-status","version":"3.1.0","name":"USCoreConditionClinicalStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/Condition-clinical-status","status":"active","experimental":false,"date":"2019-09-23T19:48:44+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The clinical status of the condition
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"clinical-status","base":["Condition"],"type":"token","expression":"Condition.clinicalStatus","xpath":"f:Condition/f:clinicalStatus","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-condition-code.json b/resources/uscore_v3.1.0/SearchParameter-us-core-condition-code.json new file mode 100755 index 000000000..2a4513a11 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-condition-code.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-condition-code","text":{"status":"generated","div":"

    SearchParameter: USCoreConditionCode

    description : Code for the condition
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-condition-code

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-code\n\t\t\t

    version : 4.1.0

    name : USCoreConditionCode

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-code\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : code\n\t\t\t

    base :Condition

    type : token

    expression : Condition.code\n\t\t\t

    xpath : f:Condition/f:code\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-code","version":"3.1.0","name":"USCoreConditionCode","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-code","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Code for the condition
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"code","base":["Condition"],"type":"token","expression":"Condition.code","xpath":"f:Condition/f:code","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-condition-onset-date.json b/resources/uscore_v3.1.0/SearchParameter-us-core-condition-onset-date.json new file mode 100755 index 000000000..da9bd2838 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-condition-onset-date.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-condition-onset-date","text":{"status":"generated","div":"

    SearchParameter: USCoreConditionOnsetDate

    description : Date related onsets (dateTime and Period)
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-condition-onset-date

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-onset-date\n\t\t\t

    version : 4.1.0

    name : USCoreConditionOnsetDate

    derivedFrom : http://hl7.org/fhir/SearchParameter/Condition-onset-date\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : onset-date\n\t\t\t

    base :Condition

    type : date

    expression : Condition.onset.as(dateTime)\n\t\t\t

    xpath : f:Condition/f:onsetDateTime\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-onset-date","version":"3.1.0","name":"USCoreConditionOnsetDate","derivedFrom":"http://hl7.org/fhir/SearchParameter/Condition-onset-date","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Date related onsets (dateTime and Period)
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"onset-date","base":["Condition"],"type":"date","expression":"Condition.onset.as(dateTime)","xpath":"f:Condition/f:onsetDateTime","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-condition-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-condition-patient.json new file mode 100755 index 000000000..b5538f6a3 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-condition-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-condition-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreConditionPatient

    description : Who has the condition?
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-condition-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-patient\n\t\t\t

    version : 4.1.0

    name : USCoreConditionPatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :Condition

    type : reference

    expression : Condition.subject.where(resolve() is Patient)\n\t\t\t

    xpath : f:Condition/f:subject\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-condition-patient","version":"3.1.0","name":"USCoreConditionPatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:44+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Who has the condition?
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["Condition"],"type":"reference","expression":"Condition.subject.where(resolve() is Patient)","xpath":"f:Condition/f:subject","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-device-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-device-patient.json new file mode 100755 index 000000000..efc55b0d6 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-device-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-device-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreDevicePatient

    description : Patient information, if the resource is affixed to a person
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-device-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-device-patient\n\t\t\t

    version : 4.1.0

    name : USCoreDevicePatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/Device-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :Device

    type : reference

    expression : Device.patient\n\t\t\t

    xpath : f:Device/f:patient\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-patient","version":"3.1.0","name":"USCoreDevicePatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/Device-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Patient information, if the resource is affixed to a person
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["Device"],"type":"reference","expression":"Device.patient","xpath":"f:Device/f:patient","xpathUsage":"normal","target":["Patient"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-device-type.json b/resources/uscore_v3.1.0/SearchParameter-us-core-device-type.json new file mode 100755 index 000000000..735d27241 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-device-type.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-device-type","text":{"status":"generated","div":"

    SearchParameter: USCoreDeviceType

    description : The type of the device
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-device-type

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-device-type\n\t\t\t

    version : 4.1.0

    name : USCoreDeviceType

    derivedFrom : http://hl7.org/fhir/SearchParameter/Device-type\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : type\n\t\t\t

    base :Device

    type : token

    expression : Device.type\n\t\t\t

    xpath : f:Device/f:type\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-device-type","version":"3.1.0","name":"USCoreDeviceType","derivedFrom":"http://hl7.org/fhir/SearchParameter/Device-type","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The type of the device
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"type","base":["Device"],"type":"token","expression":"Device.type","xpath":"f:Device/f:type","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-category.json b/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-category.json new file mode 100755 index 000000000..1e95dbb4a --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-category.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-diagnosticreport-category","text":{"status":"generated","div":"

    SearchParameter: USCoreDiagnosticreportCategory

    description : Which diagnostic discipline/department created the report
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-diagnosticreport-category

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-category\n\t\t\t

    version : 4.1.0

    name : USCoreDiagnosticreportCategory

    derivedFrom : http://hl7.org/fhir/SearchParameter/DiagnosticReport-category\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : category\n\t\t\t

    base :DiagnosticReport

    type : token

    expression : DiagnosticReport.category\n\t\t\t

    xpath : f:DiagnosticReport/f:category\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-category","version":"3.1.0","name":"USCoreDiagnosticreportCategory","derivedFrom":"http://hl7.org/fhir/SearchParameter/DiagnosticReport-category","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Which diagnostic discipline/department created the report
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"category","base":["DiagnosticReport"],"type":"token","expression":"DiagnosticReport.category","xpath":"f:DiagnosticReport/f:category","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-code.json b/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-code.json new file mode 100755 index 000000000..ede5f9a60 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-code.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-diagnosticreport-code","text":{"status":"generated","div":"

    SearchParameter: USCoreDiagnosticreportCode

    description : The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-diagnosticreport-code

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-code\n\t\t\t

    version : 4.1.0

    name : USCoreDiagnosticreportCode

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-code\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : code\n\t\t\t

    base :DiagnosticReport

    type : token

    expression : DiagnosticReport.code\n\t\t\t

    xpath : f:DiagnosticReport/f:code\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = SHOULD)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-code","version":"3.1.0","name":"USCoreDiagnosticreportCode","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-code","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The code for the report, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"code","base":["DiagnosticReport"],"type":"token","expression":"DiagnosticReport.code","xpath":"f:DiagnosticReport/f:code","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-date.json b/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-date.json new file mode 100755 index 000000000..dddfb35e4 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-date.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-diagnosticreport-date","text":{"status":"generated","div":"

    SearchParameter: USCoreDiagnosticreportDate

    description : The clinically relevant time of the report
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-diagnosticreport-date

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-date\n\t\t\t

    version : 4.1.0

    name : USCoreDiagnosticreportDate

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-date\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : date\n\t\t\t

    base :DiagnosticReport

    type : date

    expression : DiagnosticReport.effective\n\t\t\t

    xpath : f:DiagnosticReport/f:effectiveDateTime\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-date","version":"3.1.0","name":"USCoreDiagnosticreportDate","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-date","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The clinically relevant time of the report
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"date","base":["DiagnosticReport"],"type":"date","expression":"DiagnosticReport.effective","xpath":"f:DiagnosticReport/f:effectiveDateTime","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-patient.json new file mode 100755 index 000000000..8c378f2a7 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-diagnosticreport-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreDiagnosticreportPatient

    description : The subject of the report if a patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-diagnosticreport-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-patient\n\t\t\t

    version : 4.1.0

    name : USCoreDiagnosticreportPatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :DiagnosticReport

    type : reference

    expression : DiagnosticReport.subject.where(resolve() is Patient)\n\t\t\t

    xpath : f:DiagnosticReport/f:subject\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-patient","version":"3.1.0","name":"USCoreDiagnosticreportPatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The subject of the report if a patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["DiagnosticReport"],"type":"reference","expression":"DiagnosticReport.subject.where(resolve() is Patient)","xpath":"f:DiagnosticReport/f:subject","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-status.json new file mode 100755 index 000000000..d7e5d2dbc --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-diagnosticreport-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-diagnosticreport-status","text":{"status":"generated","div":"

    SearchParameter: USCoreDiagnosticreportStatus

    description : The status of the report
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-diagnosticreport-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-status\n\t\t\t

    version : 4.1.0

    name : USCoreDiagnosticreportStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/DiagnosticReport-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : status\n\t\t\t

    base :DiagnosticReport

    type : token

    expression : DiagnosticReport.status\n\t\t\t

    xpath : f:DiagnosticReport/f:status\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = SHALL)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-diagnosticreport-status","version":"3.1.0","name":"USCoreDiagnosticreportStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/DiagnosticReport-status","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The status of the report
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"status","base":["DiagnosticReport"],"type":"token","expression":"DiagnosticReport.status","xpath":"f:DiagnosticReport/f:status","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-category.json b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-category.json new file mode 100755 index 000000000..c87564063 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-category.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-documentreference-category","text":{"status":"generated","div":"

    SearchParameter: USCoreDocumentreferenceCategory

    description : Categorization of document
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-documentreference-category

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-category\n\t\t\t

    version : 4.1.0

    name : USCoreDocumentreferenceCategory

    derivedFrom : http://hl7.org/fhir/SearchParameter/DocumentReference-category\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : category\n\t\t\t

    base :DocumentReference

    type : token

    expression : DocumentReference.category\n\t\t\t

    xpath : f:DocumentReference/f:category\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-category","version":"3.1.0","name":"USCoreDocumentreferenceCategory","derivedFrom":"http://hl7.org/fhir/SearchParameter/DocumentReference-category","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Categorization of document
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"category","base":["DocumentReference"],"type":"token","expression":"DocumentReference.category","xpath":"f:DocumentReference/f:category","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-date.json b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-date.json new file mode 100755 index 000000000..2f4fd408b --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-date.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-documentreference-date","text":{"status":"generated","div":"

    SearchParameter: USCoreDocumentreferenceDate

    description : When this document reference was created
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-documentreference-date

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-date\n\t\t\t

    version : 4.1.0

    name : USCoreDocumentreferenceDate

    derivedFrom : http://hl7.org/fhir/SearchParameter/DocumentReference-date\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : date\n\t\t\t

    base :DocumentReference

    type : date

    expression : DocumentReference.date\n\t\t\t

    xpath : f:DocumentReference/f:date\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-date","version":"3.1.0","name":"USCoreDocumentreferenceDate","derivedFrom":"http://hl7.org/fhir/SearchParameter/DocumentReference-date","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"When this document reference was created
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"date","base":["DocumentReference"],"type":"date","expression":"DocumentReference.date","xpath":"f:DocumentReference/f:date","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-id.json b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-id.json new file mode 100755 index 000000000..260a6ef06 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-id.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-documentreference-id","text":{"status":"generated","div":"

    SearchParameter: USCoreDocumentreferenceId

    description : Logical id of this artifact
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-documentreference-id

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-id\n\t\t\t

    version : 4.1.0

    name : USCoreDocumentreferenceId

    derivedFrom : http://hl7.org/fhir/SearchParameter/Resource-id\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : _id\n\t\t\t

    base :DocumentReference

    type : token

    expression : DocumentReference.id\n\t\t\t

    xpath : DocumentReference.id\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-id","version":"3.1.0","name":"USCoreDocumentreferenceId","derivedFrom":"http://hl7.org/fhir/SearchParameter/Resource-id","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Logical id of this artifact
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"_id","base":["DocumentReference"],"type":"token","expression":"DocumentReference.id","xpath":"DocumentReference.id","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-patient.json new file mode 100755 index 000000000..01753efd6 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-documentreference-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreDocumentreferencePatient

    description : Who/what is the subject of the document
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-documentreference-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-patient\n\t\t\t

    version : 4.1.0

    name : USCoreDocumentreferencePatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :DocumentReference

    type : reference

    expression : DocumentReference.subject.where(resolve() is Patient)\n\t\t\t

    xpath : f:DocumentReference/f:subject\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-patient","version":"3.1.0","name":"USCoreDocumentreferencePatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Who/what is the subject of the document
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["DocumentReference"],"type":"reference","expression":"DocumentReference.subject.where(resolve() is Patient)","xpath":"f:DocumentReference/f:subject","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-period.json b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-period.json new file mode 100755 index 000000000..f1b40c81e --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-period.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-documentreference-period","text":{"status":"generated","div":"

    SearchParameter: USCoreDocumentreferencePeriod

    description : Time of service that is being documented
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-documentreference-period

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-period\n\t\t\t

    version : 4.1.0

    name : USCoreDocumentreferencePeriod

    derivedFrom : http://hl7.org/fhir/SearchParameter/DocumentReference-period\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : period\n\t\t\t

    base :DocumentReference

    type : date

    expression : DocumentReference.context.period\n\t\t\t

    xpath : f:DocumentReference/f:context/f:period\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-period","version":"3.1.0","name":"USCoreDocumentreferencePeriod","derivedFrom":"http://hl7.org/fhir/SearchParameter/DocumentReference-period","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Time of service that is being documented
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"period","base":["DocumentReference"],"type":"date","expression":"DocumentReference.context.period","xpath":"f:DocumentReference/f:context/f:period","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-status.json new file mode 100755 index 000000000..e29aba137 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-documentreference-status","text":{"status":"generated","div":"

    SearchParameter: USCoreDocumentreferenceStatus

    description : current | superseded | entered-in-error
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-documentreference-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-status\n\t\t\t

    version : 4.1.0

    name : USCoreDocumentreferenceStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/DocumentReference-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : status\n\t\t\t

    base :DocumentReference

    type : token

    expression : DocumentReference.status\n\t\t\t

    xpath : f:DocumentReference/f:status\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = SHALL)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-status","version":"3.1.0","name":"USCoreDocumentreferenceStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/DocumentReference-status","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"current | superseded | entered-in-error
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"status","base":["DocumentReference"],"type":"token","expression":"DocumentReference.status","xpath":"f:DocumentReference/f:status","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-type.json b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-type.json new file mode 100755 index 000000000..52f684670 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-documentreference-type.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-documentreference-type","text":{"status":"generated","div":"

    SearchParameter: USCoreDocumentreferenceType

    description : Kind of document (LOINC if possible)
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-documentreference-type

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-type\n\t\t\t

    version : 4.1.0

    name : USCoreDocumentreferenceType

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-type\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : type\n\t\t\t

    base :DocumentReference

    type : token

    expression : DocumentReference.type\n\t\t\t

    xpath : f:DocumentReference/f:type\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-documentreference-type","version":"3.1.0","name":"USCoreDocumentreferenceType","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-type","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Kind of document (LOINC if possible)
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"type","base":["DocumentReference"],"type":"token","expression":"DocumentReference.type","xpath":"f:DocumentReference/f:type","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-class.json b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-class.json new file mode 100755 index 000000000..aeb87e2a0 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-class.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-encounter-class","text":{"status":"generated","div":"

    SearchParameter: USCoreEncounterClass

    description : Classification of patient encounter
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-encounter-class

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-class\n\t\t\t

    version : 4.1.0

    name : USCoreEncounterClass

    derivedFrom : http://hl7.org/fhir/SearchParameter/Encounter-class\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : class\n\t\t\t

    base :Encounter

    type : token

    expression : Encounter.class\n\t\t\t

    xpath : f:Encounter/f:class\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-class","version":"3.1.0","name":"USCoreEncounterClass","derivedFrom":"http://hl7.org/fhir/SearchParameter/Encounter-class","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Classification of patient encounter
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"class","base":["Encounter"],"type":"token","expression":"Encounter.class","xpath":"f:Encounter/f:class","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-date.json b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-date.json new file mode 100755 index 000000000..e8c15e04a --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-date.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-encounter-date","text":{"status":"generated","div":"

    SearchParameter: USCoreEncounterDate

    description : A date within the period the Encounter lasted
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-encounter-date

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-date\n\t\t\t

    version : 4.1.0

    name : USCoreEncounterDate

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-date\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : date\n\t\t\t

    base :Encounter

    type : date

    expression : Encounter.period\n\t\t\t

    xpath : f:Encounter/f:period\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-date","version":"3.1.0","name":"USCoreEncounterDate","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-date","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A date within the period the Encounter lasted
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"date","base":["Encounter"],"type":"date","expression":"Encounter.period","xpath":"f:Encounter/f:period","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-id.json b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-id.json new file mode 100755 index 000000000..9771fc5fe --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-id.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-encounter-id","text":{"status":"generated","div":"

    SearchParameter: USCoreEncounterId

    description : Logical id of this artifact
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-encounter-id

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-id\n\t\t\t

    version : 4.1.0

    name : USCoreEncounterId

    derivedFrom : http://hl7.org/fhir/SearchParameter/Resource-id\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : _id\n\t\t\t

    base :Encounter

    type : token

    expression : Encounter.id\n\t\t\t

    xpath : Encounter.id\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-id","version":"3.1.0","name":"USCoreEncounterId","derivedFrom":"http://hl7.org/fhir/SearchParameter/Resource-id","status":"active","experimental":false,"date":"2019-09-23T19:48:44+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Logical id of this artifact
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"_id","base":["Encounter"],"type":"token","expression":"Encounter.id","xpath":"Encounter.id","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-identifier.json b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-identifier.json new file mode 100755 index 000000000..7959b3a8e --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-identifier.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-encounter-identifier","text":{"status":"generated","div":"

    SearchParameter: USCoreEncounterIdentifier

    description : Identifier(s) by which this encounter is known
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-encounter-identifier

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-identifier\n\t\t\t

    version : 4.1.0

    name : USCoreEncounterIdentifier

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-identifier\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : identifier\n\t\t\t

    base :Encounter

    type : token

    expression : Encounter.identifier\n\t\t\t

    xpath : f:Encounter/f:identifier\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-identifier","version":"3.1.0","name":"USCoreEncounterIdentifier","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-identifier","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Identifier(s) by which this encounter is known
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"identifier","base":["Encounter"],"type":"token","expression":"Encounter.identifier","xpath":"f:Encounter/f:identifier","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-patient.json new file mode 100755 index 000000000..38f0d33f2 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-encounter-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreEncounterPatient

    description : The patient or group present at the encounter
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-encounter-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-patient\n\t\t\t

    version : 4.1.0

    name : USCoreEncounterPatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :Encounter

    type : reference

    expression : Encounter.subject.where(resolve() is Patient)\n\t\t\t

    xpath : f:Encounter/f:subject\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-patient","version":"3.1.0","name":"USCoreEncounterPatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The patient or group present at the encounter
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["Encounter"],"type":"reference","expression":"Encounter.subject.where(resolve() is Patient)","xpath":"f:Encounter/f:subject","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-status.json new file mode 100755 index 000000000..bb2e0839f --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-encounter-status","text":{"status":"generated","div":"

    SearchParameter: USCoreEncounterStatus

    description : planned | in-progress | onhold | completed | cancelled | entered-in-error | unknown
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-encounter-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-status\n\t\t\t

    version : 4.1.0

    name : USCoreEncounterStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/Encounter-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : status\n\t\t\t

    base :Encounter

    type : token

    expression : Encounter.status\n\t\t\t

    xpath : f:Encounter/f:status\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-status","version":"3.1.0","name":"USCoreEncounterStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/Encounter-status","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"planned | in-progress | onhold | completed | cancelled | entered-in-error | unknown
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"status","base":["Encounter"],"type":"token","expression":"Encounter.status","xpath":"f:Encounter/f:status","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-type.json b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-type.json new file mode 100755 index 000000000..1cd453707 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-encounter-type.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-encounter-type","text":{"status":"generated","div":"

    SearchParameter: USCoreEncounterType

    description : Specific type of encounter
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-encounter-type

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-type\n\t\t\t

    version : 4.1.0

    name : USCoreEncounterType

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-type\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : type\n\t\t\t

    base :Encounter

    type : token

    expression : Encounter.type\n\t\t\t

    xpath : f:Encounter/f:type\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-encounter-type","version":"3.1.0","name":"USCoreEncounterType","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-type","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Specific type of encounter
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"type","base":["Encounter"],"type":"token","expression":"Encounter.type","xpath":"f:Encounter/f:type","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-ethnicity.json b/resources/uscore_v3.1.0/SearchParameter-us-core-ethnicity.json new file mode 100755 index 000000000..385b5e048 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-ethnicity.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-ethnicity","text":{"status":"generated","div":"

    Generated Narrative with Details

    id: us-core-ethnicity

    url: http://hl7.org/fhir/us/core/SearchParameter/us-core-ethnicity

    version: 3.1.0

    name: USCoreEthnicity

    status: active

    date: 21/05/2019 12:00:00 AM

    publisher: US Realm Steering Committee

    contact:

    description: Returns patients with an ethnicity extension matching the specified code.

    jurisdiction: United States of America (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America'})

    code: ethnicity

    base: Patient

    type: token

    expression: Patient.extension.where(url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity').extension.value.code

    xpath: f:Patient/f:extension[@url='http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity']/f:extension/f:valueCoding/f:code/@value

    xpathUsage: normal

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-ethnicity","version":"3.1.0","name":"USCoreEthnicity","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://www.healthit.gov/"}]}],"description":"Returns patients with an ethnicity extension matching the specified code.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"ethnicity","base":["Patient"],"type":"token","expression":"Patient.extension.where(url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity').extension.value.code","xpath":"f:Patient/f:extension[@url='http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity']/f:extension/f:valueCoding/f:code/@value","xpathUsage":"normal"} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-goal-lifecycle-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-goal-lifecycle-status.json new file mode 100755 index 000000000..7f250d972 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-goal-lifecycle-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-goal-lifecycle-status","text":{"status":"generated","div":"

    SearchParameter: USCoreGoalLifecycleStatus

    description : proposed | planned | accepted | active | on-hold | completed | cancelled | entered-in-error | rejected
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-goal-lifecycle-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-lifecycle-status\n\t\t\t

    version : 4.1.0

    name : USCoreGoalLifecycleStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/Goal-lifecycle-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : lifecycle-status\n\t\t\t

    base :Goal

    type : token

    expression : Goal.lifecycleStatus\n\t\t\t

    xpath : f:Goal/f:lifecycleStatus\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-lifecycle-status","version":"3.1.0","name":"USCoreGoalLifecycleStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/Goal-lifecycle-status","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"proposed | planned | accepted | active | on-hold | completed | cancelled | entered-in-error | rejected
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"lifecycle-status","base":["Goal"],"type":"token","expression":"Goal.lifecycleStatus","xpath":"f:Goal/f:lifecycleStatus","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-goal-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-goal-patient.json new file mode 100755 index 000000000..dfcd1cbaf --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-goal-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-goal-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreGoalPatient

    description : Who this goal is intended for
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-goal-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-patient\n\t\t\t

    version : 4.1.0

    name : USCoreGoalPatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :Goal

    type : reference

    expression : Goal.subject.where(resolve() is Patient)\n\t\t\t

    xpath : f:Goal/f:subject\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-patient","version":"3.1.0","name":"USCoreGoalPatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Who this goal is intended for
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["Goal"],"type":"reference","expression":"Goal.subject.where(resolve() is Patient)","xpath":"f:Goal/f:subject","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-goal-target-date.json b/resources/uscore_v3.1.0/SearchParameter-us-core-goal-target-date.json new file mode 100755 index 000000000..cd7875427 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-goal-target-date.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-goal-target-date","text":{"status":"generated","div":"

    SearchParameter: USCoreGoalTargetDate

    description : Reach goal on or before
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-goal-target-date

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-target-date\n\t\t\t

    version : 4.1.0

    name : USCoreGoalTargetDate

    derivedFrom : http://hl7.org/fhir/SearchParameter/Goal-target-date\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : target-date\n\t\t\t

    base :Goal

    type : date

    expression : Goal.id\n\t\t\t

    xpath : f:Goal/f:target/f:dueDate\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-goal-target-date","version":"3.1.0","name":"USCoreGoalTargetDate","derivedFrom":"http://hl7.org/fhir/SearchParameter/Goal-target-date","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Reach goal on or before
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"target-date","base":["Goal"],"type":"date","expression":"Goal.id","xpath":"f:Goal/f:target/f:dueDate","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-immunization-date.json b/resources/uscore_v3.1.0/SearchParameter-us-core-immunization-date.json new file mode 100755 index 000000000..887ce847e --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-immunization-date.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-immunization-date","text":{"status":"generated","div":"

    SearchParameter: USCoreImmunizationDate

    description : Vaccination (non)-Administration Date
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-immunization-date

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-date\n\t\t\t

    version : 4.1.0

    name : USCoreImmunizationDate

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-date\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : date\n\t\t\t

    base :Immunization

    type : date

    expression : Immunization.occurrence\n\t\t\t

    xpath : f:Immunization/f:occurrenceDateTime\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-date","version":"3.1.0","name":"USCoreImmunizationDate","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-date","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Vaccination (non)-Administration Date
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"date","base":["Immunization"],"type":"date","expression":"Immunization.occurrence","xpath":"f:Immunization/f:occurrenceDateTime","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-immunization-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-immunization-patient.json new file mode 100755 index 000000000..d0514f2ea --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-immunization-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-immunization-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreImmunizationPatient

    description : The patient for the vaccination record
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-immunization-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient\n\t\t\t

    version : 4.1.0

    name : USCoreImmunizationPatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :Immunization

    type : reference

    expression : Immunization.patient\n\t\t\t

    xpath : f:Immunization/f:patient\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-patient","version":"3.1.0","name":"USCoreImmunizationPatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The patient for the vaccination record
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["Immunization"],"type":"reference","expression":"Immunization.patient","xpath":"f:Immunization/f:patient","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-immunization-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-immunization-status.json new file mode 100755 index 000000000..c225d85ec --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-immunization-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-immunization-status","text":{"status":"generated","div":"

    SearchParameter: USCoreImmunizationStatus

    description : Immunization event status
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-immunization-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-status\n\t\t\t

    version : 4.1.0

    name : USCoreImmunizationStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/Immunization-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : status\n\t\t\t

    base :Immunization

    type : token

    expression : Immunization.status\n\t\t\t

    xpath : f:Immunization/f:status\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-immunization-status","version":"3.1.0","name":"USCoreImmunizationStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/Immunization-status","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Immunization event status
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"status","base":["Immunization"],"type":"token","expression":"Immunization.status","xpath":"f:Immunization/f:status","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-location-address-city.json b/resources/uscore_v3.1.0/SearchParameter-us-core-location-address-city.json new file mode 100755 index 000000000..df5810af8 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-location-address-city.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-location-address-city","text":{"status":"generated","div":"

    SearchParameter: USCoreLocationAddressCity

    description : A city specified in an address
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-location-address-city

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-city\n\t\t\t

    version : 4.1.0

    name : USCoreLocationAddressCity

    derivedFrom : http://hl7.org/fhir/SearchParameter/Location-address-city\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : address-city\n\t\t\t

    base :Location

    type : string

    expression : Location.address.city\n\t\t\t

    xpath : f:Location/f:address/f:city\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-city","version":"3.1.0","name":"USCoreLocationAddressCity","derivedFrom":"http://hl7.org/fhir/SearchParameter/Location-address-city","status":"active","experimental":false,"date":"2019-09-23T19:48:47+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A city specified in an address
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"address-city","base":["Location"],"type":"string","expression":"Location.address.city","xpath":"f:Location/f:address/f:city","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-location-address-postalcode.json b/resources/uscore_v3.1.0/SearchParameter-us-core-location-address-postalcode.json new file mode 100755 index 000000000..5c6638371 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-location-address-postalcode.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-location-address-postalcode","text":{"status":"generated","div":"

    SearchParameter: USCoreLocationAddressPostalcode

    description : A postal code specified in an address
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-location-address-postalcode

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-postalcode\n\t\t\t

    version : 4.1.0

    name : USCoreLocationAddressPostalcode

    derivedFrom : http://hl7.org/fhir/SearchParameter/Location-address-postalcode\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : address-postalcode\n\t\t\t

    base :Location

    type : string

    expression : Location.address.postalCode\n\t\t\t

    xpath : f:Location/f:address/f:postalCode\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-postalcode","version":"3.1.0","name":"USCoreLocationAddressPostalcode","derivedFrom":"http://hl7.org/fhir/SearchParameter/Location-address-postalcode","status":"active","experimental":false,"date":"2019-09-23T19:48:47+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A postal code specified in an address
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"address-postalcode","base":["Location"],"type":"string","expression":"Location.address.postalCode","xpath":"f:Location/f:address/f:postalCode","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-location-address-state.json b/resources/uscore_v3.1.0/SearchParameter-us-core-location-address-state.json new file mode 100755 index 000000000..4bbf148e1 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-location-address-state.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-location-address-state","text":{"status":"generated","div":"

    SearchParameter: USCoreLocationAddressState

    description : A state specified in an address
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-location-address-state

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-state\n\t\t\t

    version : 4.1.0

    name : USCoreLocationAddressState

    derivedFrom : http://hl7.org/fhir/SearchParameter/Location-address-state\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : address-state\n\t\t\t

    base :Location

    type : string

    expression : Location.address.state\n\t\t\t

    xpath : f:Location/f:address/f:state\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address-state","version":"3.1.0","name":"USCoreLocationAddressState","derivedFrom":"http://hl7.org/fhir/SearchParameter/Location-address-state","status":"active","experimental":false,"date":"2019-09-23T19:48:47+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A state specified in an address
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"address-state","base":["Location"],"type":"string","expression":"Location.address.state","xpath":"f:Location/f:address/f:state","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-location-address.json b/resources/uscore_v3.1.0/SearchParameter-us-core-location-address.json new file mode 100755 index 000000000..ee439e1e2 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-location-address.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-location-address","text":{"status":"generated","div":"

    SearchParameter: USCoreLocationAddress

    description : A (part of the) address of the location
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-location-address

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address\n\t\t\t

    version : 4.1.0

    name : USCoreLocationAddress

    derivedFrom : http://hl7.org/fhir/SearchParameter/Location-address\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : address\n\t\t\t

    base :Location

    type : string

    expression : Location.address\n\t\t\t

    xpath : f:Location/f:address\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-address","version":"3.1.0","name":"USCoreLocationAddress","derivedFrom":"http://hl7.org/fhir/SearchParameter/Location-address","status":"active","experimental":false,"date":"2019-09-23T19:48:47+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A (part of the) address of the location
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"address","base":["Location"],"type":"string","expression":"Location.address","xpath":"f:Location/f:address","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-location-name.json b/resources/uscore_v3.1.0/SearchParameter-us-core-location-name.json new file mode 100755 index 000000000..47fe60730 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-location-name.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-location-name","text":{"status":"generated","div":"

    SearchParameter: USCoreLocationName

    description : A portion of the location's name or alias
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-location-name

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-location-name\n\t\t\t

    version : 4.1.0

    name : USCoreLocationName

    derivedFrom : http://hl7.org/fhir/SearchParameter/Location-name\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : name\n\t\t\t

    base :Location

    type : string

    expression : Location.name\n\t\t\t

    xpath : f:Location/f:name\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-location-name","version":"3.1.0","name":"USCoreLocationName","derivedFrom":"http://hl7.org/fhir/SearchParameter/Location-name","status":"active","experimental":false,"date":"2019-09-23T19:48:47+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A portion of the location's name or alias
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"name","base":["Location"],"type":"string","expression":"Location.name","xpath":"f:Location/f:name","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-authoredon.json b/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-authoredon.json new file mode 100755 index 000000000..39d331ed6 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-authoredon.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-medicationrequest-authoredon","text":{"status":"generated","div":"

    SearchParameter: USCoreMedicationrequestAuthoredon

    description : Return prescriptions written on this date
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-medicationrequest-authoredon

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-authoredon\n\t\t\t

    version : 4.1.0

    name : USCoreMedicationrequestAuthoredon

    derivedFrom : http://hl7.org/fhir/SearchParameter/MedicationRequest-authoredon\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : authoredon\n\t\t\t

    base :MedicationRequest

    type : date

    expression : MedicationRequest.authoredOn\n\t\t\t

    xpath : f:MedicationRequest/f:authoredOn\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-authoredon","version":"3.1.0","name":"USCoreMedicationrequestAuthoredon","derivedFrom":"http://hl7.org/fhir/SearchParameter/MedicationRequest-authoredon","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Return prescriptions written on this date
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"authoredon","base":["MedicationRequest"],"type":"date","expression":"MedicationRequest.authoredOn","xpath":"f:MedicationRequest/f:authoredOn","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-encounter.json b/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-encounter.json new file mode 100755 index 000000000..b07fc1b10 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-encounter.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-medicationrequest-encounter","text":{"status":"generated","div":"

    SearchParameter: USCoreMedicationrequestEncounter

    description : Return prescriptions with this encounter identifier
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-medicationrequest-encounter

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-encounter\n\t\t\t

    version : 4.1.0

    name : USCoreMedicationrequestEncounter

    derivedFrom : http://hl7.org/fhir/SearchParameter/medications-encounter\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : encounter\n\t\t\t

    base :MedicationRequest

    type : reference

    expression : MedicationRequest.encounter\n\t\t\t

    xpath : f:MedicationRequest/f:encounter\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-encounter","version":"3.1.0","name":"USCoreMedicationrequestEncounter","derivedFrom":"http://hl7.org/fhir/SearchParameter/medications-encounter","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Return prescriptions with this encounter identifier
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"encounter","base":["MedicationRequest"],"type":"reference","expression":"MedicationRequest.encounter","xpath":"f:MedicationRequest/f:encounter","xpathUsage":"normal","target":["Encounter"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-intent.json b/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-intent.json new file mode 100755 index 000000000..53308050b --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-intent.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-medicationrequest-intent","text":{"status":"generated","div":"

    SearchParameter: USCoreMedicationrequestIntent

    description : Returns prescriptions with different intents
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-medicationrequest-intent

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-intent\n\t\t\t

    version : 4.1.0

    name : USCoreMedicationrequestIntent

    derivedFrom : http://hl7.org/fhir/SearchParameter/MedicationRequest-intent\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : intent\n\t\t\t

    base :MedicationRequest

    type : token

    expression : MedicationRequest.intent\n\t\t\t

    xpath : f:MedicationRequest/f:intent\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-intent","version":"3.1.0","name":"USCoreMedicationrequestIntent","derivedFrom":"http://hl7.org/fhir/SearchParameter/MedicationRequest-intent","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Returns prescriptions with different intents
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"intent","base":["MedicationRequest"],"type":"token","expression":"MedicationRequest.intent","xpath":"f:MedicationRequest/f:intent","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-patient.json new file mode 100755 index 000000000..eaec7fd17 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-medicationrequest-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreMedicationrequestPatient

    description : Returns prescriptions for a specific patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-medicationrequest-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-patient\n\t\t\t

    version : 4.1.0

    name : USCoreMedicationrequestPatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :MedicationRequest

    type : reference

    expression : MedicationRequest.subject.where(resolve() is Patient)\n\t\t\t

    xpath : f:MedicationRequest/f:subject\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-patient","version":"3.1.0","name":"USCoreMedicationrequestPatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Returns prescriptions for a specific patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["MedicationRequest"],"type":"reference","expression":"MedicationRequest.subject.where(resolve() is Patient)","xpath":"f:MedicationRequest/f:subject","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-status.json new file mode 100755 index 000000000..c980a8e7f --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-medicationrequest-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-medicationrequest-status","text":{"status":"generated","div":"

    SearchParameter: USCoreMedicationrequestStatus

    description : Status of the prescription
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-medicationrequest-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-status\n\t\t\t

    version : 4.1.0

    name : USCoreMedicationrequestStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/medications-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : status\n\t\t\t

    base :MedicationRequest

    type : token

    expression : MedicationRequest.status\n\t\t\t

    xpath : f:MedicationRequest/f:status\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = SHALL)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-medicationrequest-status","version":"3.1.0","name":"USCoreMedicationrequestStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/medications-status","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Status of the prescription
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"status","base":["MedicationRequest"],"type":"token","expression":"MedicationRequest.status","xpath":"f:MedicationRequest/f:status","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-observation-category.json b/resources/uscore_v3.1.0/SearchParameter-us-core-observation-category.json new file mode 100755 index 000000000..cc764159c --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-observation-category.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-observation-category","text":{"status":"generated","div":"

    SearchParameter: USCoreObservationCategory

    description : The classification of the type of observation
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-observation-category

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-category\n\t\t\t

    version : 4.1.0

    name : USCoreObservationCategory

    derivedFrom : http://hl7.org/fhir/SearchParameter/Observation-category\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : category\n\t\t\t

    base :Observation

    type : token

    expression : Observation.category\n\t\t\t

    xpath : f:Observation/f:category\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-category","version":"3.1.0","name":"USCoreObservationCategory","derivedFrom":"http://hl7.org/fhir/SearchParameter/Observation-category","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The classification of the type of observation
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"category","base":["Observation"],"type":"token","expression":"Observation.category","xpath":"f:Observation/f:category","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-observation-code.json b/resources/uscore_v3.1.0/SearchParameter-us-core-observation-code.json new file mode 100755 index 000000000..7c40abc9b --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-observation-code.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-observation-code","text":{"status":"generated","div":"

    SearchParameter: USCoreObservationCode

    description : The code of the observation type
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-observation-code

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-code\n\t\t\t

    version : 4.1.0

    name : USCoreObservationCode

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-code\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : code\n\t\t\t

    base :Observation

    type : token

    expression : Observation.code\n\t\t\t

    xpath : f:Observation/f:code\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = SHOULD)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-code","version":"3.1.0","name":"USCoreObservationCode","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-code","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The code of the observation type
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"code","base":["Observation"],"type":"token","expression":"Observation.code","xpath":"f:Observation/f:code","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-observation-date.json b/resources/uscore_v3.1.0/SearchParameter-us-core-observation-date.json new file mode 100755 index 000000000..ee91f0104 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-observation-date.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-observation-date","text":{"status":"generated","div":"

    SearchParameter: USCoreObservationDate

    description : Obtained date/time. If the obtained element is a period, a date that falls in the period
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-observation-date

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-date\n\t\t\t

    version : 4.1.0

    name : USCoreObservationDate

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-date\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : date\n\t\t\t

    base :Observation

    type : date

    expression : Observation.effective\n\t\t\t

    xpath : f:Observation/f:effectiveDateTime\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-date","version":"3.1.0","name":"USCoreObservationDate","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-date","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Obtained date/time. If the obtained element is a period, a date that falls in the period
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"date","base":["Observation"],"type":"date","expression":"Observation.effective","xpath":"f:Observation/f:effectiveDateTime","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-observation-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-observation-patient.json new file mode 100755 index 000000000..e9b3a9410 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-observation-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-observation-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreObservationPatient

    description : The subject that the observation is about (if patient)
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-observation-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-patient\n\t\t\t

    version : 4.1.0

    name : USCoreObservationPatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :Observation

    type : reference

    expression : Observation.subject.where(resolve() is Patient)\n\t\t\t

    xpath : f:Observation/f:subject\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-patient","version":"3.1.0","name":"USCoreObservationPatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The subject that the observation is about (if patient)
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["Observation"],"type":"reference","expression":"Observation.subject.where(resolve() is Patient)","xpath":"f:Observation/f:subject","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-observation-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-observation-status.json new file mode 100755 index 000000000..0692ed3a0 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-observation-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-observation-status","text":{"status":"generated","div":"

    SearchParameter: USCoreObservationStatus

    description : The status of the observation
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-observation-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-status\n\t\t\t

    version : 4.1.0

    name : USCoreObservationStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/Observation-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : status\n\t\t\t

    base :Observation

    type : token

    expression : Observation.status\n\t\t\t

    xpath : f:Observation/f:status\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = SHALL)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-observation-status","version":"3.1.0","name":"USCoreObservationStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/Observation-status","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The status of the observation
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"status","base":["Observation"],"type":"token","expression":"Observation.status","xpath":"f:Observation/f:status","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-organization-address.json b/resources/uscore_v3.1.0/SearchParameter-us-core-organization-address.json new file mode 100755 index 000000000..1eccc9545 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-organization-address.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-organization-address","text":{"status":"generated","div":"

    SearchParameter: USCoreOrganizationAddress

    description : A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-organization-address

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address\n\t\t\t

    version : 4.1.0

    name : USCoreOrganizationAddress

    derivedFrom : http://hl7.org/fhir/SearchParameter/Organization-address\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : address\n\t\t\t

    base :Organization

    type : string

    expression : Organization.address\n\t\t\t

    xpath : f:Organization/f:address\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-address","version":"3.1.0","name":"USCoreOrganizationAddress","derivedFrom":"http://hl7.org/fhir/SearchParameter/Organization-address","status":"active","experimental":false,"date":"2019-09-23T19:48:47+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A server defined search that may match any of the string fields in the Address, including line, city, district, state, country, postalCode, and/or text
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"address","base":["Organization"],"type":"string","expression":"Organization.address","xpath":"f:Organization/f:address","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-organization-name.json b/resources/uscore_v3.1.0/SearchParameter-us-core-organization-name.json new file mode 100755 index 000000000..6b92630fb --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-organization-name.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-organization-name","text":{"status":"generated","div":"

    SearchParameter: USCoreOrganizationName

    description : A portion of the organization's name or alias
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-organization-name

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name\n\t\t\t

    version : 4.1.0

    name : USCoreOrganizationName

    derivedFrom : http://hl7.org/fhir/SearchParameter/Organization-name\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : name\n\t\t\t

    base :Organization

    type : string

    expression : Organization.name\n\t\t\t

    xpath : f:Organization/f:name\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-organization-name","version":"3.1.0","name":"USCoreOrganizationName","derivedFrom":"http://hl7.org/fhir/SearchParameter/Organization-name","status":"active","experimental":false,"date":"2019-09-23T19:48:47+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A portion of the organization's name or alias
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"name","base":["Organization"],"type":"string","expression":"Organization.name","xpath":"f:Organization/f:name","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-patient-birthdate.json b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-birthdate.json new file mode 100755 index 000000000..901c0df3a --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-birthdate.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-patient-birthdate","text":{"status":"generated","div":"

    SearchParameter: USCorePatientBirthdate

    description : The patient's date of birth
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-patient-birthdate

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-birthdate\n\t\t\t

    version : 4.1.0

    name : USCorePatientBirthdate

    derivedFrom : http://hl7.org/fhir/SearchParameter/individual-birthdate\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : birthdate\n\t\t\t

    base :Patient

    type : date

    expression : Patient.birthDate\n\t\t\t

    xpath : f:Patient/f:birthDate\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = MAY)

    comparator : lt ( Conformance Expectation = MAY)

    comparator : le ( Conformance Expectation = MAY)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-birthdate","version":"3.1.0","name":"USCorePatientBirthdate","derivedFrom":"http://hl7.org/fhir/SearchParameter/individual-birthdate","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The patient's date of birth
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"birthdate","base":["Patient"],"type":"date","expression":"Patient.birthDate","xpath":"f:Patient/f:birthDate","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-patient-family.json b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-family.json new file mode 100755 index 000000000..d6f50284b --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-family.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-patient-family","text":{"status":"generated","div":"

    SearchParameter: USCorePatientFamily

    description : A portion of the family name of the patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-patient-family

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-family\n\t\t\t

    version : 4.1.0

    name : USCorePatientFamily

    derivedFrom : http://hl7.org/fhir/SearchParameter/individual-family\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : family\n\t\t\t

    base :Patient

    type : string

    expression : Patient.name.family\n\t\t\t

    xpath : f:Patient/f:name/f:family\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-family","version":"3.1.0","name":"USCorePatientFamily","derivedFrom":"http://hl7.org/fhir/SearchParameter/individual-family","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A portion of the family name of the patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"family","base":["Patient"],"type":"string","expression":"Patient.name.family","xpath":"f:Patient/f:name/f:family","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-patient-gender.json b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-gender.json new file mode 100755 index 000000000..f36e2ed94 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-gender.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-patient-gender","text":{"status":"generated","div":"

    SearchParameter: USCorePatientGender

    description : Gender of the patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-patient-gender

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-gender\n\t\t\t

    version : 4.1.0

    name : USCorePatientGender

    derivedFrom : http://hl7.org/fhir/SearchParameter/individual-gender\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : gender\n\t\t\t

    base :Patient

    type : token

    expression : Patient.gender\n\t\t\t

    xpath : f:Patient/f:gender\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-gender","version":"3.1.0","name":"USCorePatientGender","derivedFrom":"http://hl7.org/fhir/SearchParameter/individual-gender","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Gender of the patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"gender","base":["Patient"],"type":"token","expression":"Patient.gender","xpath":"f:Patient/f:gender","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-patient-given.json b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-given.json new file mode 100755 index 000000000..ca06f0ac3 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-given.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-patient-given","text":{"status":"generated","div":"

    SearchParameter: USCorePatientGiven

    description : A portion of the given name of the patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-patient-given

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-given\n\t\t\t

    version : 4.1.0

    name : USCorePatientGiven

    derivedFrom : http://hl7.org/fhir/SearchParameter/individual-given\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : given\n\t\t\t

    base :Patient

    type : string

    expression : Patient.name.given\n\t\t\t

    xpath : f:Patient/f:name/f:given\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-given","version":"3.1.0","name":"USCorePatientGiven","derivedFrom":"http://hl7.org/fhir/SearchParameter/individual-given","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A portion of the given name of the patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"given","base":["Patient"],"type":"string","expression":"Patient.name.given","xpath":"f:Patient/f:name/f:given","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-patient-id.json b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-id.json new file mode 100755 index 000000000..5ada6a079 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-id.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-patient-id","text":{"status":"generated","div":"

    SearchParameter: USCorePatientId

    description : Logical id of this artifact
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-patient-id

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-id\n\t\t\t

    version : 4.1.0

    name : USCorePatientId

    derivedFrom : http://hl7.org/fhir/SearchParameter/Resource-id\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : _id\n\t\t\t

    base :Patient

    type : token

    expression : Patient.id\n\t\t\t

    xpath : Patient.id\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-id","version":"3.1.0","name":"USCorePatientId","derivedFrom":"http://hl7.org/fhir/SearchParameter/Resource-id","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Logical id of this artifact
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"_id","base":["Patient"],"type":"token","expression":"Patient.id","xpath":"Patient.id","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-patient-identifier.json b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-identifier.json new file mode 100755 index 000000000..9420d4c5e --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-identifier.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-patient-identifier","text":{"status":"generated","div":"

    SearchParameter: USCorePatientIdentifier

    description : A patient identifier
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-patient-identifier

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-identifier\n\t\t\t

    version : 4.1.0

    name : USCorePatientIdentifier

    derivedFrom : http://hl7.org/fhir/SearchParameter/Patient-identifier\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : identifier\n\t\t\t

    base :Patient

    type : token

    expression : Patient.identifier\n\t\t\t

    xpath : f:Patient/f:identifier\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-identifier","version":"3.1.0","name":"USCorePatientIdentifier","derivedFrom":"http://hl7.org/fhir/SearchParameter/Patient-identifier","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A patient identifier
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"identifier","base":["Patient"],"type":"token","expression":"Patient.identifier","xpath":"f:Patient/f:identifier","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-patient-name.json b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-name.json new file mode 100755 index 000000000..bd117e35b --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-patient-name.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-patient-name","text":{"status":"generated","div":"

    SearchParameter: USCorePatientName

    description : A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-patient-name

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-name\n\t\t\t

    version : 4.1.0

    name : USCorePatientName

    derivedFrom : http://hl7.org/fhir/SearchParameter/Patient-name\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : name\n\t\t\t

    base :Patient

    type : string

    expression : Patient.name\n\t\t\t

    xpath : f:Patient/f:name\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-patient-name","version":"3.1.0","name":"USCorePatientName","derivedFrom":"http://hl7.org/fhir/SearchParameter/Patient-name","status":"active","experimental":false,"date":"2019-09-23T19:48:45+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"name","base":["Patient"],"type":"string","expression":"Patient.name","xpath":"f:Patient/f:name","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-practitioner-identifier.json b/resources/uscore_v3.1.0/SearchParameter-us-core-practitioner-identifier.json new file mode 100755 index 000000000..39802131b --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-practitioner-identifier.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-practitioner-identifier","text":{"status":"generated","div":"

    SearchParameter: USCorePractitionerIdentifier

    description : A practitioner's Identifier
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-practitioner-identifier

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-identifier\n\t\t\t

    version : 4.1.0

    name : USCorePractitionerIdentifier

    derivedFrom : http://hl7.org/fhir/SearchParameter/Practitioner-identifier\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : identifier\n\t\t\t

    base :Practitioner

    type : token

    expression : Practitioner.identifier\n\t\t\t

    xpath : f:Practitioner/f:identifier\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-identifier","version":"3.1.0","name":"USCorePractitionerIdentifier","derivedFrom":"http://hl7.org/fhir/SearchParameter/Practitioner-identifier","status":"active","experimental":false,"date":"2019-09-23T19:48:47+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A practitioner's Identifier
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"identifier","base":["Practitioner"],"type":"token","expression":"Practitioner.identifier","xpath":"f:Practitioner/f:identifier","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-practitioner-name.json b/resources/uscore_v3.1.0/SearchParameter-us-core-practitioner-name.json new file mode 100755 index 000000000..f23afbdc1 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-practitioner-name.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-practitioner-name","text":{"status":"generated","div":"

    SearchParameter: USCorePractitionerName

    description : A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-practitioner-name

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-name\n\t\t\t

    version : 4.1.0

    name : USCorePractitionerName

    derivedFrom : http://hl7.org/fhir/SearchParameter/Practitioner-name\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : name\n\t\t\t

    base :Practitioner

    type : string

    expression : Practitioner.name\n\t\t\t

    xpath : f:Practitioner/f:name\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : exact (Conformance Expectation = MAY)

    modifier : contains (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitioner-name","version":"3.1.0","name":"USCorePractitionerName","derivedFrom":"http://hl7.org/fhir/SearchParameter/Practitioner-name","status":"active","experimental":false,"date":"2019-09-23T19:48:47+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A server defined search that may match any of the string fields in the HumanName, including family, give, prefix, suffix, suffix, and/or text
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"name","base":["Practitioner"],"type":"string","expression":"Practitioner.name","xpath":"f:Practitioner/f:name","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","exact","contains"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-practitionerrole-practitioner.json b/resources/uscore_v3.1.0/SearchParameter-us-core-practitionerrole-practitioner.json new file mode 100755 index 000000000..3948d9943 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-practitionerrole-practitioner.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-practitionerrole-practitioner","text":{"status":"generated","div":"

    SearchParameter: USCorePractitionerrolePractitioner

    description : Practitioner that is able to provide the defined services for the organization
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-practitionerrole-practitioner

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner\n\t\t\t

    version : 4.1.0

    name : USCorePractitionerrolePractitioner

    derivedFrom : http://hl7.org/fhir/SearchParameter/PractitionerRole-practitioner\n\t\t\t

    status : active

    experimental False

    date : 2019-08-26

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : practitioner\n\t\t\t

    base :PractitionerRole

    type : reference

    expression : PractitionerRole.practitioner\n\t\t\t

    xpath : f:PractitionerRole/f:practitioner\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    chain : identifier (Conformance Expectation = SHALL)

    chain : name (Conformance Expectation = SHALL)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-practitioner","version":"3.1.0","name":"USCorePractitionerrolePractitioner","derivedFrom":"http://hl7.org/fhir/SearchParameter/PractitionerRole-practitioner","status":"active","experimental":false,"date":"2019-08-27T06:15:54+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Practitioner that is able to provide the defined services for the organization
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"practitioner","base":["PractitionerRole"],"type":"reference","expression":"PractitionerRole.practitioner","xpath":"f:PractitionerRole/f:practitioner","xpathUsage":"normal","target":["Practitioner"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"chain":["identifier","name"],"_chain":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-practitionerrole-specialty.json b/resources/uscore_v3.1.0/SearchParameter-us-core-practitionerrole-specialty.json new file mode 100755 index 000000000..1e7f3a78b --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-practitionerrole-specialty.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-practitionerrole-specialty","text":{"status":"generated","div":"

    SearchParameter: USCorePractitionerroleSpecialty

    description : The practitioner has this specialty at an organization
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-practitionerrole-specialty

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty\n\t\t\t

    version : 4.1.0

    name : USCorePractitionerroleSpecialty

    derivedFrom : http://hl7.org/fhir/SearchParameter/PractitionerRole-specialty\n\t\t\t

    status : active

    experimental False

    date : 2019-08-26

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : specialty\n\t\t\t

    base :PractitionerRole

    type : token

    expression : PractitionerRole.specialty\n\t\t\t

    xpath : f:PractitionerRole/f:specialty\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-practitionerrole-specialty","version":"3.1.0","name":"USCorePractitionerroleSpecialty","derivedFrom":"http://hl7.org/fhir/SearchParameter/PractitionerRole-specialty","status":"active","experimental":false,"date":"2019-08-27T06:15:54+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"The practitioner has this specialty at an organization
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"specialty","base":["PractitionerRole"],"type":"token","expression":"PractitionerRole.specialty","xpath":"f:PractitionerRole/f:specialty","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-code.json b/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-code.json new file mode 100755 index 000000000..bef09c145 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-code.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-procedure-code","text":{"status":"generated","div":"

    SearchParameter: USCoreProcedureCode

    description : A code to identify a procedure
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-procedure-code

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-code\n\t\t\t

    version : 4.1.0

    name : USCoreProcedureCode

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-code\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : code\n\t\t\t

    base :Procedure

    type : token

    expression : Procedure.code\n\t\t\t

    xpath : f:Procedure/f:code\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = SHOULD)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-code","version":"3.1.0","name":"USCoreProcedureCode","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-code","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"A code to identify a procedure
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"code","base":["Procedure"],"type":"token","expression":"Procedure.code","xpath":"f:Procedure/f:code","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-date.json b/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-date.json new file mode 100755 index 000000000..60caeccb7 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-date.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-procedure-date","text":{"status":"generated","div":"

    SearchParameter: USCoreProcedureDate

    description : When the procedure occurred or is occurring
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-procedure-date

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-date\n\t\t\t

    version : 4.1.0

    name : USCoreProcedureDate

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-date\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : date\n\t\t\t

    base :Procedure

    type : date

    expression : Procedure.occurrence\n\t\t\t

    xpath : f:Procedure/f:occurrenceDateTime\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = SHOULD)

    comparator : eq ( Conformance Expectation = MAY)

    comparator : ne ( Conformance Expectation = MAY)

    comparator : gt ( Conformance Expectation = SHALL)

    comparator : lt ( Conformance Expectation = SHALL)

    comparator : le ( Conformance Expectation = SHALL)

    comparator : sa ( Conformance Expectation = MAY)

    comparator : eb ( Conformance Expectation = MAY)

    comparator : ap ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-date","version":"3.1.0","name":"USCoreProcedureDate","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-date","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"When the procedure occurred or is occurring
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"date","base":["Procedure"],"type":"date","expression":"Procedure.occurrence","xpath":"f:Procedure/f:occurrenceDateTime","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHOULD"}]},"comparator":["eq","ne","gt","lt","le","sa","eb","ap"],"_comparator":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}],"modifier":["missing"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-patient.json b/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-patient.json new file mode 100755 index 000000000..d8d662ec2 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-patient.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-procedure-patient","text":{"status":"generated","div":"

    SearchParameter: USCoreProcedurePatient

    description : Search by subject - a patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-procedure-patient

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-patient\n\t\t\t

    version : 4.1.0

    name : USCoreProcedurePatient

    derivedFrom : http://hl7.org/fhir/SearchParameter/clinical-patient\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : patient\n\t\t\t

    base :Procedure

    type : reference

    expression : Procedure.subject.where(resolve() is Patient)\n\t\t\t

    xpath : f:Procedure/f:subject\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = MAY)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : type (Conformance Expectation = MAY)

    modifier : identifier (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-patient","version":"3.1.0","name":"USCoreProcedurePatient","derivedFrom":"http://hl7.org/fhir/SearchParameter/clinical-patient","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Search by subject - a patient
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"patient","base":["Procedure"],"type":"reference","expression":"Procedure.subject.where(resolve() is Patient)","xpath":"f:Procedure/f:subject","xpathUsage":"normal","target":["Patient","Group"],"multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","type","identifier"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-status.json b/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-status.json new file mode 100755 index 000000000..b735d4084 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-procedure-status.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-procedure-status","text":{"status":"generated","div":"

    SearchParameter: USCoreProcedureStatus

    description : preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n


    id us-core-procedure-status

    url : http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-status\n\t\t\t

    version : 4.1.0

    name : USCoreProcedureStatus

    derivedFrom : http://hl7.org/fhir/SearchParameter/Procedure-status\n\t\t\t

    status : active

    experimental False

    date : 2019-09-23

    publisher : HL7 International - US Realm Steering Committee

    contact : http://www.hl7.org/Special/committees/usrealm/index.cfm

    useContext :

    jurisdiction : United States of America (the) (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United\n States of America (the)'})\n\t\t\t

    code : status\n\t\t\t

    base :Procedure

    type : token

    expression : Procedure.status\n\t\t\t

    xpath : f:Procedure/f:status\n\t\t\t

    xpathUsage : normal

    mulitpleOr : True (Conformance Expectation = SHALL)

    mulitpleAnd : True ( Conformance Expectation = MAY)

    modifier : missing (Conformance Expectation = MAY)

    modifier : text (Conformance Expectation = MAY)

    modifier : not (Conformance Expectation = MAY)

    modifier : in (Conformance Expectation = MAY)

    modifier : not-in (Conformance Expectation = MAY)

    modifier : below (Conformance Expectation = MAY)

    modifier : above (Conformance Expectation = MAY)

    modifier : ofType (Conformance Expectation = MAY)

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-procedure-status","version":"3.1.0","name":"USCoreProcedureStatus","derivedFrom":"http://hl7.org/fhir/SearchParameter/Procedure-status","status":"active","experimental":false,"date":"2019-09-23T19:48:46+10:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown
    \nNOTE: This US Core SearchParameter definition extends the usage context of\ncapabilitystatement-expectation\n extension to formally express implementer expectations for these elements:
    \n - multipleAnd
    \n - multipleOr
    \n - modifier
    \n - comparator
    \n - chain
    \n ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"status","base":["Procedure"],"type":"token","expression":"Procedure.status","xpath":"f:Procedure/f:status","xpathUsage":"normal","multipleOr":true,"_multipleOr":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"SHALL"}]},"multipleAnd":true,"_multipleAnd":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},"modifier":["missing","text","not","in","not-in","below","above","ofType"],"_modifier":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/capabilitystatement-expectation","valueCode":"MAY"}]}]} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/SearchParameter-us-core-race.json b/resources/uscore_v3.1.0/SearchParameter-us-core-race.json new file mode 100755 index 000000000..ef8c51064 --- /dev/null +++ b/resources/uscore_v3.1.0/SearchParameter-us-core-race.json @@ -0,0 +1 @@ +{"resourceType":"SearchParameter","id":"us-core-race","text":{"status":"generated","div":"

    Generated Narrative with Details

    id: us-core-race

    url: http://hl7.org/fhir/us/core/SearchParameter/us-core-race

    version: 3.1.0

    name: USCoreRace

    status: active

    date: 21/05/2019 12:00:00 AM

    publisher: US Realm Steering Committee

    contact:

    description: Returns patients with a race extension matching the specified code.

    jurisdiction: United States of America (Details : {urn:iso:std:iso:3166 code 'US' = 'United States of America', given as 'United States of America'})

    code: race

    base: Patient

    type: token

    expression: Patient.extension.where(url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race').extension.value.code

    xpath: f:Patient/f:extension[@url='http://hl7.org/fhir/us/core/StructureDefinition/us-core-race']/f:extension/f:valueCoding/f:code/@value

    xpathUsage: normal

    "},"url":"http://hl7.org/fhir/us/core/SearchParameter/us-core-race","version":"3.1.0","name":"USCoreRace","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://www.healthit.gov/"}]}],"description":"Returns patients with a race extension matching the specified code.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"code":"race","base":["Patient"],"type":"token","expression":"Patient.extension.where(url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race').extension.value.code","xpath":"f:Patient/f:extension[@url='http://hl7.org/fhir/us/core/StructureDefinition/us-core-race']/f:extension/f:valueCoding/f:code/@value","xpathUsage":"normal"} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-pediatric-bmi-for-age.json b/resources/uscore_v3.1.0/StructureDefinition-pediatric-bmi-for-age.json new file mode 100755 index 000000000..7f37527b3 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-pediatric-bmi-for-age.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"pediatric-bmi-for-age","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Observation 0..*
    \".\"\".\"\".\" code 1..1CodeableConceptBMI percentile per age and sex for youth 2-20
    Required Pattern: At least the following
    \".\"\".\"\".\"\".\" coding1..*CodingCode defined by a terminology system
    Fixed Value: (complex)
    \".\"\".\"\".\"\".\"\".\" system1..1uriIdentity of the terminology system
    Fixed Value: http://loinc.org
    \".\"\".\"\".\"\".\"\".\" code1..1codeSymbol in syntax defined by the system
    Fixed Value: 59576-9
    \".\"\".\"\".\" valueQuantity 1..1Quantity
    \".\"\".\"\".\"\".\" value S1..1decimal
    \".\"\".\"\".\"\".\" unit S1..1string
    \".\"\".\"\".\"\".\" system S1..1uriFixed Value: http://unitsofmeasure.org
    \".\"\".\"\".\"\".\" code S1..1codeCoded responses from the common UCUM units for vital signs value set.
    Fixed Value: %

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age","version":"3.1.0","name":"USCorePediatricBMIforAgeObservationProfile","title":"US Core Pediatric BMI for Age Observation Profile","status":"active","experimental":false,"date":"2019-08-31T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Observation resource for use in querying and retrieving pediatric BMI observations.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"sct-concept","uri":"http://snomed.info/conceptdomain","name":"SNOMED CT Concept Domain Binding"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"sct-attr","uri":"http://snomed.org/attributebinding","name":"SNOMED CT Attribute Binding"}],"kind":"resource","abstract":false,"type":"Observation","baseDefinition":"http://hl7.org/fhir/StructureDefinition/vitalsigns","derivation":"constraint","snapshot":{"element":[{"id":"Observation","path":"Observation","short":"FHIR Vital Signs Profile","definition":"This profile defines how to represent BMI percentile per age and sex for youth 2-20 observations in FHIR using a standard LOINC code and UCUM units of measure.","comment":"Used for simple observations such as device measurements, laboratory atomic results, vital signs, height, weight, smoking status, comments, etc. Other resources are used to provide context for observations such as laboratory reports, etc.","alias":["Vital Signs","Measurement","Results","Tests"],"min":0,"max":"*","base":{"path":"Observation","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"obs-6","severity":"error","human":"dataAbsentReason SHALL only be present if Observation.value[x] is not present","expression":"dataAbsentReason.empty() or value.empty()","xpath":"not(exists(f:dataAbsentReason)) or (not(exists(*[starts-with(local-name(.), 'value')])))","source":"http://hl7.org/fhir/StructureDefinition/Observation"},{"key":"obs-7","severity":"error","human":"If Observation.code is the same as an Observation.component.code then the value element associated with the code SHALL NOT be present","expression":"value.empty() or component.code.where(coding.intersect(%resource.code.coding).exists()).empty()","xpath":"not(f:*[starts-with(local-name(.), 'value')] and (for $coding in f:code/f:coding return f:component/f:code/f:coding[f:code/@value=$coding/f:code/@value] [f:system/@value=$coding/f:system/@value]))","source":"http://hl7.org/fhir/StructureDefinition/Observation"},{"key":"vs-2","severity":"error","human":"If there is no component or hasMember element then either a value[x] or a data absent reason must be present.","expression":"(component.empty() and hasMember.empty()) implies (dataAbsentReason.exists() or value.exists())","xpath":"f:component or f:memberOF or f:*[starts-with(local-name(.), 'value')] or f:dataAbsentReason","source":"http://hl7.org/fhir/StructureDefinition/vitalsigns"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"sct-concept","map":"< 363787002 |Observable entity|"},{"identity":"v2","map":"OBX"},{"identity":"rim","map":"Observation[classCode=OBS, moodCode=EVN]"}]},{"id":"Observation.id","path":"Observation.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Observation.meta","path":"Observation.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Observation.implicitRules","path":"Observation.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Observation.language","path":"Observation.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Observation.text","path":"Observation.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Observation.contained","path":"Observation.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.extension","path":"Observation.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.modifierExtension","path":"Observation.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.identifier","path":"Observation.identifier","short":"Business Identifier for observation","definition":"A unique identifier assigned to this observation.","requirements":"Allows observations to be distinguished and referenced.","min":0,"max":"*","base":{"path":"Observation.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"OBX.21 For OBX segments from systems without OBX-21 support a combination of ORC/OBR and OBX must be negotiated between trading partners to uniquely identify the OBX segment. Depending on how V2 has been implemented each of these may be an option: 1) OBR-3 + OBX-3 + OBX-4 or 2) OBR-3 + OBR-4 + OBX-3 + OBX-4 or 2) some other way to uniquely ID the OBR/ORC + OBX-3 + OBX-4."},{"identity":"rim","map":"id"}]},{"id":"Observation.basedOn","path":"Observation.basedOn","short":"Fulfills plan, proposal or order","definition":"A plan, proposal or order that is fulfilled in whole or in part by this event. For example, a MedicationRequest may require a patient to have laboratory test performed before it is dispensed.","requirements":"Allows tracing of authorization for the event and tracking whether proposals/recommendations were acted upon.","alias":["Fulfills"],"min":0,"max":"*","base":{"path":"Observation.basedOn","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan","http://hl7.org/fhir/StructureDefinition/DeviceRequest","http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation","http://hl7.org/fhir/StructureDefinition/MedicationRequest","http://hl7.org/fhir/StructureDefinition/NutritionOrder","http://hl7.org/fhir/StructureDefinition/ServiceRequest"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.basedOn"},{"identity":"v2","map":"ORC"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[moodCode=EVN]"}]},{"id":"Observation.partOf","path":"Observation.partOf","short":"Part of referenced event","definition":"A larger event of which this particular Observation is a component or step. For example, an observation as part of a procedure.","comment":"To link an Observation to an Encounter use `encounter`. See the [Notes](http://hl7.org/fhir/observation.html#obsgrouping) below for guidance on referencing another Observation.","alias":["Container"],"min":0,"max":"*","base":{"path":"Observation.partOf","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/MedicationAdministration","http://hl7.org/fhir/StructureDefinition/MedicationDispense","http://hl7.org/fhir/StructureDefinition/MedicationStatement","http://hl7.org/fhir/StructureDefinition/Procedure","http://hl7.org/fhir/StructureDefinition/Immunization","http://hl7.org/fhir/StructureDefinition/ImagingStudy"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.partOf"},{"identity":"v2","map":"Varies by domain"},{"identity":"rim","map":".outboundRelationship[typeCode=FLFS].target"}]},{"id":"Observation.status","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint","valueString":"default: final"}],"path":"Observation.status","short":"registered | preliminary | final | amended +","definition":"The status of the result value.","comment":"This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.","requirements":"Need to track the status of individual results. Some results are finalized before the whole report is finalized.","min":1,"max":"1","base":{"path":"Observation.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Status"}],"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/observation-status|4.0.1"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"sct-concept","map":"< 445584004 |Report by finality status|"},{"identity":"v2","map":"OBX-11"},{"identity":"rim","map":"status Amended & Final are differentiated by whether it is the subject of a ControlAct event with a type of \"revise\""}]},{"id":"Observation.category","path":"Observation.category","slicing":{"discriminator":[{"type":"value","path":"coding.code"},{"type":"value","path":"coding.system"}],"ordered":false,"rules":"open"},"short":"Classification of type of observation","definition":"A code that classifies the general type of observation being made.","comment":"In addition to the required category valueset, this element allows various categorization schemes based on the owner’s definition of the category and effectively multiple categories can be used at once. The level of granularity is defined by the category concepts in the value set.","requirements":"Used for filtering what observations are retrieved and displayed.","min":1,"max":"*","base":{"path":"Observation.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCategory"}],"strength":"preferred","description":"Codes for high level observation categories.","valueSet":"http://hl7.org/fhir/ValueSet/observation-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"}]},{"id":"Observation.category:VSCat","path":"Observation.category","sliceName":"VSCat","short":"Classification of type of observation","definition":"A code that classifies the general type of observation being made.","comment":"In addition to the required category valueset, this element allows various categorization schemes based on the owner’s definition of the category and effectively multiple categories can be used at once. The level of granularity is defined by the category concepts in the value set.","requirements":"Used for filtering what observations are retrieved and displayed.","min":1,"max":"1","base":{"path":"Observation.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCategory"}],"strength":"preferred","description":"Codes for high level observation categories.","valueSet":"http://hl7.org/fhir/ValueSet/observation-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"}]},{"id":"Observation.category:VSCat.id","path":"Observation.category.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.extension","path":"Observation.category.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.coding","path":"Observation.category.coding","short":"Code defined by a terminology system","definition":"A reference to a code defined by a terminology system.","comment":"Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.","requirements":"Allows for alternative encodings within a code system, and translations to other code systems.","min":1,"max":"*","base":{"path":"CodeableConcept.coding","min":0,"max":"*"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1-8, C*E.10-22"},{"identity":"rim","map":"union(., ./translation)"},{"identity":"orim","map":"fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"}]},{"id":"Observation.category:VSCat.coding.id","path":"Observation.category.coding.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.coding.extension","path":"Observation.category.coding.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.coding.system","path":"Observation.category.coding.system","short":"Identity of the terminology system","definition":"The identification of the code system that defines the meaning of the symbol in the code.","comment":"The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...). OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should reference to some definition that establishes the system clearly and unambiguously.","requirements":"Need to be unambiguous about the source of the definition of the symbol.","min":1,"max":"1","base":{"path":"Coding.system","min":0,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"http://terminology.hl7.org/CodeSystem/observation-category","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.3"},{"identity":"rim","map":"./codeSystem"},{"identity":"orim","map":"fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"}]},{"id":"Observation.category:VSCat.coding.version","path":"Observation.category.coding.version","short":"Version of the system - if relevant","definition":"The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.","comment":"Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.","min":0,"max":"1","base":{"path":"Coding.version","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.7"},{"identity":"rim","map":"./codeSystemVersion"},{"identity":"orim","map":"fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"}]},{"id":"Observation.category:VSCat.coding.code","path":"Observation.category.coding.code","short":"Symbol in syntax defined by the system","definition":"A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).","requirements":"Need to refer to a particular code in the system.","min":1,"max":"1","base":{"path":"Coding.code","min":0,"max":"1"},"type":[{"code":"code"}],"fixedCode":"vital-signs","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1"},{"identity":"rim","map":"./code"},{"identity":"orim","map":"fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"}]},{"id":"Observation.category:VSCat.coding.display","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.category.coding.display","short":"Representation defined by the system","definition":"A representation of the meaning of the code in the system, following the rules of the system.","requirements":"Need to be able to carry a human-readable meaning of the code for readers that do not know the system.","min":0,"max":"1","base":{"path":"Coding.display","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.2 - but note this is not well followed"},{"identity":"rim","map":"CV.displayName"},{"identity":"orim","map":"fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"}]},{"id":"Observation.category:VSCat.coding.userSelected","path":"Observation.category.coding.userSelected","short":"If this coding was chosen directly by the user","definition":"Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).","comment":"Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.","requirements":"This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.","min":0,"max":"1","base":{"path":"Coding.userSelected","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Sometimes implied by being first"},{"identity":"rim","map":"CD.codingRationale"},{"identity":"orim","map":"fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map; fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\\#true a [ fhir:source \"true\"; fhir:target dt:CDCoding.codingRationale\\#O ]"}]},{"id":"Observation.category:VSCat.text","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.category.text","short":"Plain text representation of the concept","definition":"A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.","comment":"Very often the text is the same as a displayName of one of the codings.","requirements":"The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.","min":0,"max":"1","base":{"path":"CodeableConcept.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.9. But note many systems use C*E.2 for this"},{"identity":"rim","map":"./originalText[mediaType/code=\"text/plain\"]/data"},{"identity":"orim","map":"fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"}]},{"id":"Observation.code","path":"Observation.code","short":"BMI percentile per age and sex for youth 2-20","definition":"Coded Responses from C-CDA Vital Sign Results.","comment":"additional codes that translate or map to this code are allowed. For example a more granular LOINC code or code that is used locally in a system.","requirements":"5. SHALL contain exactly one [1..1] code, where the @code SHOULD be selected from ValueSet HITSP Vital Sign Result Type 2.16.840.1.113883.3.88.12.80.62 DYNAMIC (CONF:7301).","alias":["Name","Test"],"min":1,"max":"1","base":{"path":"Observation.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"59576-9"}]},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSigns"}],"strength":"extensible","description":"This identifies the vital sign result type.","valueSet":"http://hl7.org/fhir/ValueSet/observation-vitalsignresult"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR < 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"},{"identity":"sct-attr","map":"116680003 |Is a|"}]},{"id":"Observation.subject","path":"Observation.subject","short":"Who and/or what the observation is about","definition":"The patient, or group of patients, location, or device this observation is about and into whose record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation.","comment":"One would expect this element to be a cardinality of 1..1. The only circumstance in which the subject can be missing is when the observation is made by a device that does not know the patient. In this case, the observation SHALL be matched to a patient through some context/channel matching technique, and at this point, the observation should be updated.","requirements":"Observations have no value if you don't know who or what they're about.","min":1,"max":"1","base":{"path":"Observation.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":"participation[typeCode=RTGT] "},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"Observation.focus","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"path":"Observation.focus","short":"What the observation is about, when it is not about the subject of record","definition":"The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record. The focus of an observation could also be an existing condition, an intervention, the subject's diet, another observation of the subject, or a body structure such as tumor or implanted device. An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.","comment":"Typically, an observation is made about the subject - a patient, or group of patients, location, or device - and the distinction between the subject and what is directly measured for an observation is specified in the observation code itself ( e.g., \"Blood Glucose\") and does not need to be represented separately using this element. Use `specimen` if a reference to a specimen is required. If a code is required instead of a resource use either `bodysite` for bodysites or the standard extension [focusCode](http://hl7.org/fhir/extension-observation-focuscode.html).","min":0,"max":"*","base":{"path":"Observation.focus","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"participation[typeCode=SBJ]"},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"Observation.encounter","path":"Observation.encounter","short":"Healthcare event during which this observation is made","definition":"The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.","comment":"This will typically be the encounter the event occurred within, but some events may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter (e.g. pre-admission laboratory tests).","requirements":"For some observations it may be important to know the link between an observation and a particular encounter.","alias":["Context"],"min":0,"max":"1","base":{"path":"Observation.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1"},{"identity":"rim","map":"inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN]"}]},{"id":"Observation.effective[x]","path":"Observation.effective[x]","short":"Often just a dateTime for Vital Signs","definition":"Often just a dateTime for Vital Signs.","comment":"At least a date should be present unless this observation is a historical report. For recording imprecise or \"fuzzy\" times (For example, a blood glucose measurement taken \"after breakfast\") use the [Timing](http://hl7.org/fhir/datatypes.html#timing) datatype which allow the measurement to be tied to regular life events.","requirements":"Knowing when an observation was deemed true is important to its relevance as well as determining trends.","alias":["Occurrence"],"min":1,"max":"1","base":{"path":"Observation.effective[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Period"}],"condition":["vs-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"vs-1","severity":"error","human":"if Observation.effective[x] is dateTime and has a value then that value shall be precise to the day","expression":"($this as dateTime).toString().length() >= 8","xpath":"f:effectiveDateTime[matches(@value, '^\\d{4}-\\d{2}-\\d{2}')]"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"OBX-14, and/or OBX-19 after v2.4 (depends on who observation made)"},{"identity":"rim","map":"effectiveTime"}]},{"id":"Observation.issued","path":"Observation.issued","short":"Date/Time this version was made available","definition":"The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.","comment":"For Observations that don’t require review and verification, it may be the same as the [`lastUpdated` ](http://hl7.org/fhir/resource-definitions.html#Meta.lastUpdated) time of the resource itself. For Observations that do require review and verification for certain updates, it might not be the same as the `lastUpdated` time of the resource itself due to a non-clinically significant update that doesn’t require the new version to be reviewed and verified again.","min":0,"max":"1","base":{"path":"Observation.issued","min":0,"max":"1"},"type":[{"code":"instant"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"v2","map":"OBR.22 (or MSH.7), or perhaps OBX-19 (depends on who observation made)"},{"identity":"rim","map":"participation[typeCode=AUT].time"}]},{"id":"Observation.performer","path":"Observation.performer","short":"Who is responsible for the observation","definition":"Who was responsible for asserting the observed value as \"true\".","requirements":"May give a degree of confidence in the observation and also indicates where follow-up questions should be directed.","min":0,"max":"*","base":{"path":"Observation.performer","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/CareTeam","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"OBX.15 / (Practitioner) OBX-16, PRT-5:PRT-4='RO' / (Device) OBX-18 , PRT-10:PRT-4='EQUIP' / (Organization) OBX-23, PRT-8:PRT-4='PO'"},{"identity":"rim","map":"participation[typeCode=PRF]"}]},{"id":"Observation.value[x]","path":"Observation.value[x]","slicing":{"discriminator":[{"type":"type","path":"$this"}],"ordered":false,"rules":"closed"},"short":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","definition":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","comment":"An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":0,"max":"1","base":{"path":"Observation.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"}],"condition":["obs-7","vs-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"sct-concept","map":"< 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.value[x]:valueQuantity","path":"Observation.value[x]","sliceName":"valueQuantity","short":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","definition":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","comment":"An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":1,"max":"1","base":{"path":"Observation.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"}],"condition":["obs-7","vs-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"sct-concept","map":"< 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.value[x]:valueQuantity.id","path":"Observation.value[x].id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.value[x]:valueQuantity.extension","path":"Observation.value[x].extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.value[x]:valueQuantity.value","path":"Observation.value[x].value","short":"Numerical value (with implicit precision)","definition":"The value of the measured amount. The value includes an implicit precision in the presentation of the value.","comment":"The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books).","requirements":"Precision is handled implicitly in almost all cases of measurement.","min":1,"max":"1","base":{"path":"Quantity.value","min":0,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"SN.2 / CQ - N/A"},{"identity":"rim","map":"PQ.value, CO.value, MO.value, IVL.high or IVL.low depending on the value"}]},{"id":"Observation.value[x]:valueQuantity.comparator","path":"Observation.value[x].comparator","short":"< | <= | >= | > - how to understand the value","definition":"How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is \"<\" , then the real value is < stated value.","requirements":"Need a framework for handling measures where the value is <5ug/L or >400mg/L due to the limitations of measuring methodology.","min":0,"max":"1","base":{"path":"Quantity.comparator","min":0,"max":"1"},"type":[{"code":"code"}],"meaningWhenMissing":"If there is no comparator, then there is no modification of the value","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because the comparator modifies the interpretation of the value significantly. If there is no comparator, then there is no modification of the value","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"QuantityComparator"}],"strength":"required","description":"How the Quantity should be understood and represented.","valueSet":"http://hl7.org/fhir/ValueSet/quantity-comparator|4.0.1"},"mapping":[{"identity":"v2","map":"SN.1 / CQ.1"},{"identity":"rim","map":"IVL properties"}]},{"id":"Observation.value[x]:valueQuantity.unit","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.value[x].unit","short":"Unit representation","definition":"A human-readable form of the unit.","requirements":"There are many representations for units of measure and in many contexts, particular representations are fixed and required. I.e. mcg for micrograms.","min":1,"max":"1","base":{"path":"Quantity.unit","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"PQ.unit"}]},{"id":"Observation.value[x]:valueQuantity.system","path":"Observation.value[x].system","short":"System that defines coded unit form","definition":"The identification of the system that provides the coded form of the unit.","requirements":"Need to know the system that defines the coded form of the unit.","min":1,"max":"1","base":{"path":"Quantity.system","min":0,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"http://unitsofmeasure.org","condition":["qty-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"CO.codeSystem, PQ.translation.codeSystem"}]},{"id":"Observation.value[x]:valueQuantity.code","path":"Observation.value[x].code","short":"Coded responses from the common UCUM units for vital signs value set.","definition":"A computer processable form of the unit in some unit representation system.","comment":"The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency. The context of use may additionally require a code from a particular system.","requirements":"Need a computable form of the unit that is fixed across all forms. UCUM provides this for quantities, but SNOMED CT provides many units of interest.","min":1,"max":"1","base":{"path":"Quantity.code","min":0,"max":"1"},"type":[{"code":"code"}],"fixedCode":"%","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"PQ.code, MO.currency, PQ.translation.code"}]},{"id":"Observation.dataAbsentReason","path":"Observation.dataAbsentReason","short":"Why the result is missing","definition":"Provides a reason why the expected value in the element Observation.value[x] is missing.","comment":"Null or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"specimen unsatisfactory\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Note that an observation may only be reported if there are values to report. For example differential cell counts values may be reported only when > 0. Because of these options, use-case agreements are required to interpret general observations for null or exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6","vs-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.interpretation","path":"Observation.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.note","path":"Observation.note","short":"Comments about the observation","definition":"Comments about the observation or the results.","comment":"May include general statements about the observation, or statements about significant, unexpected or unreliable results values, or information about its source when relevant to its interpretation.","requirements":"Need to be able to provide free text additional information.","min":0,"max":"*","base":{"path":"Observation.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NTE.3 (partner NTE to OBX, or sometimes another (child?) OBX)"},{"identity":"rim","map":"subjectOf.observationEvent[code=\"annotation\"].value"}]},{"id":"Observation.bodySite","path":"Observation.bodySite","short":"Observed body part","definition":"Indicates the site on the subject's body where the observation was made (i.e. the target site).","comment":"Only used if not implicit in code found in Observation.code. In many systems, this may be represented as a related observation instead of an inline component. \n\nIf the use case requires BodySite to be handled as a separate resource (e.g. to identify and track separately) then use the standard extension[ bodySite](http://hl7.org/fhir/extension-bodysite.html).","min":0,"max":"1","base":{"path":"Observation.bodySite","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BodySite"}],"strength":"example","description":"Codes describing anatomical locations. May include laterality.","valueSet":"http://hl7.org/fhir/ValueSet/body-site"},"mapping":[{"identity":"sct-concept","map":"< 123037004 |Body structure|"},{"identity":"v2","map":"OBX-20"},{"identity":"rim","map":"targetSiteCode"},{"identity":"sct-attr","map":"718497002 |Inherent location|"}]},{"id":"Observation.method","path":"Observation.method","short":"How it was done","definition":"Indicates the mechanism used to perform the observation.","comment":"Only used if not implicit in code for Observation.code.","requirements":"In some cases, method can impact results and is thus used for determining whether results can be compared or determining significance of results.","min":0,"max":"1","base":{"path":"Observation.method","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationMethod"}],"strength":"example","description":"Methods for simple observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-methods"},"mapping":[{"identity":"v2","map":"OBX-17"},{"identity":"rim","map":"methodCode"}]},{"id":"Observation.specimen","path":"Observation.specimen","short":"Specimen used for this observation","definition":"The specimen that was used when this observation was made.","comment":"Should only be used if not implicit in code found in `Observation.code`. Observations are not made on specimens themselves; they are made on a subject, but in many cases by the means of a specimen. Note that although specimens are often involved, they are not always tracked and reported explicitly. Also note that observation resources may be used in contexts that track the specimen explicitly (e.g. Diagnostic Report).","min":0,"max":"1","base":{"path":"Observation.specimen","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Specimen"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"sct-concept","map":"< 123038009 |Specimen|"},{"identity":"v2","map":"SPM segment"},{"identity":"rim","map":"participation[typeCode=SPC].specimen"},{"identity":"sct-attr","map":"704319004 |Inherent in|"}]},{"id":"Observation.device","path":"Observation.device","short":"(Measurement) Device","definition":"The device used to generate the observation data.","comment":"Note that this is not meant to represent a device involved in the transmission of the result, e.g., a gateway. Such devices may be documented using the Provenance resource where relevant.","min":0,"max":"1","base":{"path":"Observation.device","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/DeviceMetric"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"sct-concept","map":"< 49062001 |Device|"},{"identity":"v2","map":"OBX-17 / PRT -10"},{"identity":"rim","map":"participation[typeCode=DEV]"},{"identity":"sct-attr","map":"424226004 |Using device|"}]},{"id":"Observation.referenceRange","path":"Observation.referenceRange","short":"Provides guide for interpretation","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an \"OR\". In other words, to represent two distinct target populations, two `referenceRange` elements would be used.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.referenceRange","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"obs-3","severity":"error","human":"Must have at least a low or a high or text","expression":"low.exists() or high.exists() or text.exists()","xpath":"(exists(f:low) or exists(f:high)or exists(f:text))"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]},{"id":"Observation.referenceRange.id","path":"Observation.referenceRange.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.referenceRange.extension","path":"Observation.referenceRange.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.referenceRange.modifierExtension","path":"Observation.referenceRange.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.referenceRange.low","path":"Observation.referenceRange.low","short":"Low Range, if relevant","definition":"The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).","min":0,"max":"1","base":{"path":"Observation.referenceRange.low","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"condition":["obs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:IVL_PQ.low"}]},{"id":"Observation.referenceRange.high","path":"Observation.referenceRange.high","short":"High Range, if relevant","definition":"The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).","min":0,"max":"1","base":{"path":"Observation.referenceRange.high","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"condition":["obs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:IVL_PQ.high"}]},{"id":"Observation.referenceRange.type","path":"Observation.referenceRange.type","short":"Reference range qualifier","definition":"Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.","comment":"This SHOULD be populated if there is more than one range. If this element is not present then the normal range is assumed.","requirements":"Need to be able to say what kind of reference range this is - normal, recommended, therapeutic, etc., - for proper interpretation.","min":0,"max":"1","base":{"path":"Observation.referenceRange.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationRangeMeaning"}],"strength":"preferred","description":"Code for the meaning of a reference range.","valueSet":"http://hl7.org/fhir/ValueSet/referencerange-meaning"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values| OR \r< 365860008 |General clinical state finding| \rOR \r< 250171008 |Clinical history or observation findings| OR \r< 415229000 |Racial group| OR \r< 365400002 |Finding of puberty stage| OR\r< 443938003 |Procedure carried out on subject|"},{"identity":"v2","map":"OBX-10"},{"identity":"rim","map":"interpretationCode"}]},{"id":"Observation.referenceRange.appliesTo","path":"Observation.referenceRange.appliesTo","short":"Reference range population","definition":"Codes to indicate the target population this reference range applies to. For example, a reference range may be based on the normal population or a particular sex or race. Multiple `appliesTo` are interpreted as an \"AND\" of the target populations. For example, to represent a target population of African American females, both a code of female and a code for African American would be used.","comment":"This SHOULD be populated if there is more than one range. If this element is not present then the normal population is assumed.","requirements":"Need to be able to identify the target population for proper interpretation.","min":0,"max":"*","base":{"path":"Observation.referenceRange.appliesTo","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationRangeType"}],"strength":"example","description":"Codes identifying the population the reference range applies to.","valueSet":"http://hl7.org/fhir/ValueSet/referencerange-appliesto"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values| OR \r< 365860008 |General clinical state finding| \rOR \r< 250171008 |Clinical history or observation findings| OR \r< 415229000 |Racial group| OR \r< 365400002 |Finding of puberty stage| OR\r< 443938003 |Procedure carried out on subject|"},{"identity":"v2","map":"OBX-10"},{"identity":"rim","map":"interpretationCode"}]},{"id":"Observation.referenceRange.age","path":"Observation.referenceRange.age","short":"Applicable age range, if relevant","definition":"The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.","requirements":"Some analytes vary greatly over age.","min":0,"max":"1","base":{"path":"Observation.referenceRange.age","min":0,"max":"1"},"type":[{"code":"Range"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"outboundRelationship[typeCode=PRCN].targetObservationCriterion[code=\"age\"].value"}]},{"id":"Observation.referenceRange.text","path":"Observation.referenceRange.text","short":"Text based reference range in an observation","definition":"Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of \"Negative\" or a list or table of \"normals\".","min":0,"max":"1","base":{"path":"Observation.referenceRange.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:ST"}]},{"id":"Observation.hasMember","path":"Observation.hasMember","short":"Used when reporting vital signs panel components","definition":"Used when reporting vital signs panel components.","comment":"When using this element, an observation will typically have either a value or a set of related resources, although both may be present in some cases. For a discussion on the ways Observations can assembled in groups together, see [Notes](http://hl7.org/fhir/observation.html#obsgrouping) below. Note that a system may calculate results from [QuestionnaireResponse](http://hl7.org/fhir/questionnaireresponse.html) into a final score and represent the score as an Observation.","min":0,"max":"*","base":{"path":"Observation.hasMember","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","http://hl7.org/fhir/StructureDefinition/MolecularSequence","http://hl7.org/fhir/StructureDefinition/vitalsigns"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Relationships established by OBX-4 usage"},{"identity":"rim","map":"outBoundRelationship"}]},{"id":"Observation.derivedFrom","path":"Observation.derivedFrom","short":"Related measurements the observation is made from","definition":"The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.","comment":"All the reference choices that are listed in this element can represent clinical observations and other measurements that may be the source for a derived value. The most common reference will be another Observation. For a discussion on the ways Observations can assembled in groups together, see [Notes](http://hl7.org/fhir/observation.html#obsgrouping) below.","min":0,"max":"*","base":{"path":"Observation.derivedFrom","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/DocumentReference","http://hl7.org/fhir/StructureDefinition/ImagingStudy","http://hl7.org/fhir/StructureDefinition/Media","http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","http://hl7.org/fhir/StructureDefinition/MolecularSequence","http://hl7.org/fhir/StructureDefinition/vitalsigns"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Relationships established by OBX-4 usage"},{"identity":"rim","map":".targetObservation"}]},{"id":"Observation.component","path":"Observation.component","short":"Used when reporting systolic and diastolic blood pressure.","definition":"Used when reporting systolic and diastolic blood pressure.","comment":"For a discussion on the ways Observations can be assembled in groups together see [Notes](http://hl7.org/fhir/observation.html#notes) below.","requirements":"Component observations share the same attributes in the Observation resource as the primary observation and are always treated a part of a single observation (they are not separable). However, the reference range for the primary observation value is not inherited by the component values and is required when appropriate for each component observation.","min":0,"max":"*","base":{"path":"Observation.component","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"vs-3","severity":"error","human":"If there is no a value a data absent reason must be present","expression":"value.exists() or dataAbsentReason.exists()","xpath":"f:*[starts-with(local-name(.), 'value')] or f:dataAbsentReason"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"containment by OBX-4?"},{"identity":"rim","map":"outBoundRelationship[typeCode=COMP]"}]},{"id":"Observation.component.id","path":"Observation.component.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component.extension","path":"Observation.component.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component.modifierExtension","path":"Observation.component.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.component.code","path":"Observation.component.code","short":"Type of component observation (code / type)","definition":"Describes what was observed. Sometimes this is called the observation \"code\".","comment":"*All* code-value and component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation.","requirements":"Knowing what kind of observation is being made is essential to understanding the observation.","min":1,"max":"1","base":{"path":"Observation.component.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSigns"}],"strength":"extensible","description":"This identifies the vital sign result type.","valueSet":"http://hl7.org/fhir/ValueSet/observation-vitalsignresult"},"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR \r< 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"}]},{"id":"Observation.component.value[x]","path":"Observation.component.value[x]","short":"Vital Sign Value recorded with UCUM","definition":"Vital Sign Value recorded with UCUM.","comment":"Used when observation has a set of component observations. An observation may have both a value (e.g. an Apgar score) and component observations (the observations from which the Apgar score was derived). If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":0,"max":"1","base":{"path":"Observation.component.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"},{"code":"CodeableConcept"},{"code":"string"},{"code":"boolean"},{"code":"integer"},{"code":"Range"},{"code":"Ratio"},{"code":"SampledData"},{"code":"time"},{"code":"dateTime"},{"code":"Period"}],"condition":["vs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSignsUnits"}],"strength":"required","description":"Common UCUM units for recording Vital Signs.","valueSet":"http://hl7.org/fhir/ValueSet/ucum-vitals-common|4.0.1"},"mapping":[{"identity":"sct-concept","map":"363714003 |Interprets| < 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.component.dataAbsentReason","path":"Observation.component.dataAbsentReason","short":"Why the component result is missing","definition":"Provides a reason why the expected value in the element Observation.component.value[x] is missing.","comment":"\"Null\" or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"test not done\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Because of these options, use-case agreements are required to interpret general observations for exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.component.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6","vs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.component.interpretation","path":"Observation.component.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.component.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.component.referenceRange","path":"Observation.component.referenceRange","short":"Provides guide for interpretation of component result","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.component.referenceRange","min":0,"max":"*"},"contentReference":"#Observation.referenceRange","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]}]},"differential":{"element":[{"id":"Observation","path":"Observation","definition":"This profile defines how to represent BMI percentile per age and sex for youth 2-20 observations in FHIR using a standard LOINC code and UCUM units of measure.","mustSupport":false},{"id":"Observation.code","path":"Observation.code","short":"BMI percentile per age and sex for youth 2-20","comment":"additional codes that translate or map to this code are allowed. For example a more granular LOINC code or code that is used locally in a system.","alias":["Test","Name"],"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"59576-9"}]},"mustSupport":false},{"id":"Observation.valueQuantity","path":"Observation.valueQuantity","min":1,"max":"1","mustSupport":false},{"id":"Observation.valueQuantity.value","path":"Observation.valueQuantity.value","min":1,"max":"1","type":[{"code":"decimal"}],"mustSupport":true},{"id":"Observation.valueQuantity.unit","path":"Observation.valueQuantity.unit","min":1,"max":"1","type":[{"code":"string"}],"mustSupport":true},{"id":"Observation.valueQuantity.system","path":"Observation.valueQuantity.system","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"http://unitsofmeasure.org","mustSupport":true},{"id":"Observation.valueQuantity.code","path":"Observation.valueQuantity.code","short":"Coded responses from the common UCUM units for vital signs value set.","min":1,"max":"1","type":[{"code":"code"}],"fixedCode":"%","mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-pediatric-weight-for-height.json b/resources/uscore_v3.1.0/StructureDefinition-pediatric-weight-for-height.json new file mode 100755 index 000000000..9b4d4df84 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-pediatric-weight-for-height.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"pediatric-weight-for-height","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Observation 0..*
    \".\"\".\"\".\" code 1..1CodeableConceptWeight-for-length per age and gender
    Required Pattern: At least the following
    \".\"\".\"\".\"\".\" coding1..*CodingCode defined by a terminology system
    Fixed Value: (complex)
    \".\"\".\"\".\"\".\"\".\" system1..1uriIdentity of the terminology system
    Fixed Value: http://loinc.org
    \".\"\".\"\".\"\".\"\".\" code1..1codeSymbol in syntax defined by the system
    Fixed Value: 77606-2
    \".\"\".\"\".\" valueQuantity 1..1Quantity
    \".\"\".\"\".\"\".\" value S1..1decimal
    \".\"\".\"\".\"\".\" unit S1..1string
    \".\"\".\"\".\"\".\" system S1..1uriFixed Value: http://unitsofmeasure.org
    \".\"\".\"\".\"\".\" code S1..1codeCoded responses from the common UCUM units for vital signs value set.
    Fixed Value: %

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height","version":"3.1.0","name":"USCorePediatricWeightForHeightObservationProfile","title":"US Core Pediatric Weight for Height Observation Profile","status":"active","experimental":false,"date":"2019-08-31T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Observation resource for use in querying and retrieving pediatric Weight-for-length per age and gender observations.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"sct-concept","uri":"http://snomed.info/conceptdomain","name":"SNOMED CT Concept Domain Binding"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"sct-attr","uri":"http://snomed.org/attributebinding","name":"SNOMED CT Attribute Binding"}],"kind":"resource","abstract":false,"type":"Observation","baseDefinition":"http://hl7.org/fhir/StructureDefinition/vitalsigns","derivation":"constraint","snapshot":{"element":[{"id":"Observation","path":"Observation","short":"FHIR Vital Signs Profile","definition":"This profile defines how to represent Weight-for-length per age and gender observations in FHIR using a standard LOINC code and UCUM units of measure.","comment":"Used for simple observations such as device measurements, laboratory atomic results, vital signs, height, weight, smoking status, comments, etc. Other resources are used to provide context for observations such as laboratory reports, etc.","alias":["Vital Signs","Measurement","Results","Tests"],"min":0,"max":"*","base":{"path":"Observation","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"obs-6","severity":"error","human":"dataAbsentReason SHALL only be present if Observation.value[x] is not present","expression":"dataAbsentReason.empty() or value.empty()","xpath":"not(exists(f:dataAbsentReason)) or (not(exists(*[starts-with(local-name(.), 'value')])))","source":"http://hl7.org/fhir/StructureDefinition/Observation"},{"key":"obs-7","severity":"error","human":"If Observation.code is the same as an Observation.component.code then the value element associated with the code SHALL NOT be present","expression":"value.empty() or component.code.where(coding.intersect(%resource.code.coding).exists()).empty()","xpath":"not(f:*[starts-with(local-name(.), 'value')] and (for $coding in f:code/f:coding return f:component/f:code/f:coding[f:code/@value=$coding/f:code/@value] [f:system/@value=$coding/f:system/@value]))","source":"http://hl7.org/fhir/StructureDefinition/Observation"},{"key":"vs-2","severity":"error","human":"If there is no component or hasMember element then either a value[x] or a data absent reason must be present.","expression":"(component.empty() and hasMember.empty()) implies (dataAbsentReason.exists() or value.exists())","xpath":"f:component or f:memberOF or f:*[starts-with(local-name(.), 'value')] or f:dataAbsentReason","source":"http://hl7.org/fhir/StructureDefinition/vitalsigns"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"sct-concept","map":"< 363787002 |Observable entity|"},{"identity":"v2","map":"OBX"},{"identity":"rim","map":"Observation[classCode=OBS, moodCode=EVN]"}]},{"id":"Observation.id","path":"Observation.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Observation.meta","path":"Observation.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Observation.implicitRules","path":"Observation.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Observation.language","path":"Observation.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Observation.text","path":"Observation.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Observation.contained","path":"Observation.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.extension","path":"Observation.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.modifierExtension","path":"Observation.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.identifier","path":"Observation.identifier","short":"Business Identifier for observation","definition":"A unique identifier assigned to this observation.","requirements":"Allows observations to be distinguished and referenced.","min":0,"max":"*","base":{"path":"Observation.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"OBX.21 For OBX segments from systems without OBX-21 support a combination of ORC/OBR and OBX must be negotiated between trading partners to uniquely identify the OBX segment. Depending on how V2 has been implemented each of these may be an option: 1) OBR-3 + OBX-3 + OBX-4 or 2) OBR-3 + OBR-4 + OBX-3 + OBX-4 or 2) some other way to uniquely ID the OBR/ORC + OBX-3 + OBX-4."},{"identity":"rim","map":"id"}]},{"id":"Observation.basedOn","path":"Observation.basedOn","short":"Fulfills plan, proposal or order","definition":"A plan, proposal or order that is fulfilled in whole or in part by this event. For example, a MedicationRequest may require a patient to have laboratory test performed before it is dispensed.","requirements":"Allows tracing of authorization for the event and tracking whether proposals/recommendations were acted upon.","alias":["Fulfills"],"min":0,"max":"*","base":{"path":"Observation.basedOn","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan","http://hl7.org/fhir/StructureDefinition/DeviceRequest","http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation","http://hl7.org/fhir/StructureDefinition/MedicationRequest","http://hl7.org/fhir/StructureDefinition/NutritionOrder","http://hl7.org/fhir/StructureDefinition/ServiceRequest"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.basedOn"},{"identity":"v2","map":"ORC"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[moodCode=EVN]"}]},{"id":"Observation.partOf","path":"Observation.partOf","short":"Part of referenced event","definition":"A larger event of which this particular Observation is a component or step. For example, an observation as part of a procedure.","comment":"To link an Observation to an Encounter use `encounter`. See the [Notes](http://hl7.org/fhir/observation.html#obsgrouping) below for guidance on referencing another Observation.","alias":["Container"],"min":0,"max":"*","base":{"path":"Observation.partOf","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/MedicationAdministration","http://hl7.org/fhir/StructureDefinition/MedicationDispense","http://hl7.org/fhir/StructureDefinition/MedicationStatement","http://hl7.org/fhir/StructureDefinition/Procedure","http://hl7.org/fhir/StructureDefinition/Immunization","http://hl7.org/fhir/StructureDefinition/ImagingStudy"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.partOf"},{"identity":"v2","map":"Varies by domain"},{"identity":"rim","map":".outboundRelationship[typeCode=FLFS].target"}]},{"id":"Observation.status","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint","valueString":"default: final"}],"path":"Observation.status","short":"registered | preliminary | final | amended +","definition":"The status of the result value.","comment":"This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.","requirements":"Need to track the status of individual results. Some results are finalized before the whole report is finalized.","min":1,"max":"1","base":{"path":"Observation.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Status"}],"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/observation-status|4.0.1"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"sct-concept","map":"< 445584004 |Report by finality status|"},{"identity":"v2","map":"OBX-11"},{"identity":"rim","map":"status Amended & Final are differentiated by whether it is the subject of a ControlAct event with a type of \"revise\""}]},{"id":"Observation.category","path":"Observation.category","slicing":{"discriminator":[{"type":"value","path":"coding.code"},{"type":"value","path":"coding.system"}],"ordered":false,"rules":"open"},"short":"Classification of type of observation","definition":"A code that classifies the general type of observation being made.","comment":"In addition to the required category valueset, this element allows various categorization schemes based on the owner’s definition of the category and effectively multiple categories can be used at once. The level of granularity is defined by the category concepts in the value set.","requirements":"Used for filtering what observations are retrieved and displayed.","min":1,"max":"*","base":{"path":"Observation.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCategory"}],"strength":"preferred","description":"Codes for high level observation categories.","valueSet":"http://hl7.org/fhir/ValueSet/observation-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"}]},{"id":"Observation.category:VSCat","path":"Observation.category","sliceName":"VSCat","short":"Classification of type of observation","definition":"A code that classifies the general type of observation being made.","comment":"In addition to the required category valueset, this element allows various categorization schemes based on the owner’s definition of the category and effectively multiple categories can be used at once. The level of granularity is defined by the category concepts in the value set.","requirements":"Used for filtering what observations are retrieved and displayed.","min":1,"max":"1","base":{"path":"Observation.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCategory"}],"strength":"preferred","description":"Codes for high level observation categories.","valueSet":"http://hl7.org/fhir/ValueSet/observation-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"}]},{"id":"Observation.category:VSCat.id","path":"Observation.category.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.extension","path":"Observation.category.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.coding","path":"Observation.category.coding","short":"Code defined by a terminology system","definition":"A reference to a code defined by a terminology system.","comment":"Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.","requirements":"Allows for alternative encodings within a code system, and translations to other code systems.","min":1,"max":"*","base":{"path":"CodeableConcept.coding","min":0,"max":"*"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1-8, C*E.10-22"},{"identity":"rim","map":"union(., ./translation)"},{"identity":"orim","map":"fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"}]},{"id":"Observation.category:VSCat.coding.id","path":"Observation.category.coding.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.coding.extension","path":"Observation.category.coding.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.coding.system","path":"Observation.category.coding.system","short":"Identity of the terminology system","definition":"The identification of the code system that defines the meaning of the symbol in the code.","comment":"The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...). OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should reference to some definition that establishes the system clearly and unambiguously.","requirements":"Need to be unambiguous about the source of the definition of the symbol.","min":1,"max":"1","base":{"path":"Coding.system","min":0,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"http://terminology.hl7.org/CodeSystem/observation-category","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.3"},{"identity":"rim","map":"./codeSystem"},{"identity":"orim","map":"fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"}]},{"id":"Observation.category:VSCat.coding.version","path":"Observation.category.coding.version","short":"Version of the system - if relevant","definition":"The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.","comment":"Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.","min":0,"max":"1","base":{"path":"Coding.version","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.7"},{"identity":"rim","map":"./codeSystemVersion"},{"identity":"orim","map":"fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"}]},{"id":"Observation.category:VSCat.coding.code","path":"Observation.category.coding.code","short":"Symbol in syntax defined by the system","definition":"A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).","requirements":"Need to refer to a particular code in the system.","min":1,"max":"1","base":{"path":"Coding.code","min":0,"max":"1"},"type":[{"code":"code"}],"fixedCode":"vital-signs","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1"},{"identity":"rim","map":"./code"},{"identity":"orim","map":"fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"}]},{"id":"Observation.category:VSCat.coding.display","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.category.coding.display","short":"Representation defined by the system","definition":"A representation of the meaning of the code in the system, following the rules of the system.","requirements":"Need to be able to carry a human-readable meaning of the code for readers that do not know the system.","min":0,"max":"1","base":{"path":"Coding.display","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.2 - but note this is not well followed"},{"identity":"rim","map":"CV.displayName"},{"identity":"orim","map":"fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"}]},{"id":"Observation.category:VSCat.coding.userSelected","path":"Observation.category.coding.userSelected","short":"If this coding was chosen directly by the user","definition":"Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).","comment":"Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.","requirements":"This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.","min":0,"max":"1","base":{"path":"Coding.userSelected","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Sometimes implied by being first"},{"identity":"rim","map":"CD.codingRationale"},{"identity":"orim","map":"fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map; fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\\#true a [ fhir:source \"true\"; fhir:target dt:CDCoding.codingRationale\\#O ]"}]},{"id":"Observation.category:VSCat.text","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.category.text","short":"Plain text representation of the concept","definition":"A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.","comment":"Very often the text is the same as a displayName of one of the codings.","requirements":"The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.","min":0,"max":"1","base":{"path":"CodeableConcept.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.9. But note many systems use C*E.2 for this"},{"identity":"rim","map":"./originalText[mediaType/code=\"text/plain\"]/data"},{"identity":"orim","map":"fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"}]},{"id":"Observation.code","path":"Observation.code","short":"Weight-for-length per age and gender","definition":"Coded Responses from C-CDA Vital Sign Results.","comment":"additional codes that translate or map to this code are allowed. For example a more granular LOINC code or code that is used locally in a system.","requirements":"5. SHALL contain exactly one [1..1] code, where the @code SHOULD be selected from ValueSet HITSP Vital Sign Result Type 2.16.840.1.113883.3.88.12.80.62 DYNAMIC (CONF:7301).","alias":["Name","Test"],"min":1,"max":"1","base":{"path":"Observation.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"77606-2"}]},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSigns"}],"strength":"extensible","description":"This identifies the vital sign result type.","valueSet":"http://hl7.org/fhir/ValueSet/observation-vitalsignresult"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR < 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"},{"identity":"sct-attr","map":"116680003 |Is a|"}]},{"id":"Observation.subject","path":"Observation.subject","short":"Who and/or what the observation is about","definition":"The patient, or group of patients, location, or device this observation is about and into whose record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation.","comment":"One would expect this element to be a cardinality of 1..1. The only circumstance in which the subject can be missing is when the observation is made by a device that does not know the patient. In this case, the observation SHALL be matched to a patient through some context/channel matching technique, and at this point, the observation should be updated.","requirements":"Observations have no value if you don't know who or what they're about.","min":1,"max":"1","base":{"path":"Observation.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":"participation[typeCode=RTGT] "},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"Observation.focus","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"path":"Observation.focus","short":"What the observation is about, when it is not about the subject of record","definition":"The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record. The focus of an observation could also be an existing condition, an intervention, the subject's diet, another observation of the subject, or a body structure such as tumor or implanted device. An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.","comment":"Typically, an observation is made about the subject - a patient, or group of patients, location, or device - and the distinction between the subject and what is directly measured for an observation is specified in the observation code itself ( e.g., \"Blood Glucose\") and does not need to be represented separately using this element. Use `specimen` if a reference to a specimen is required. If a code is required instead of a resource use either `bodysite` for bodysites or the standard extension [focusCode](http://hl7.org/fhir/extension-observation-focuscode.html).","min":0,"max":"*","base":{"path":"Observation.focus","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"participation[typeCode=SBJ]"},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"Observation.encounter","path":"Observation.encounter","short":"Healthcare event during which this observation is made","definition":"The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.","comment":"This will typically be the encounter the event occurred within, but some events may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter (e.g. pre-admission laboratory tests).","requirements":"For some observations it may be important to know the link between an observation and a particular encounter.","alias":["Context"],"min":0,"max":"1","base":{"path":"Observation.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1"},{"identity":"rim","map":"inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN]"}]},{"id":"Observation.effective[x]","path":"Observation.effective[x]","short":"Often just a dateTime for Vital Signs","definition":"Often just a dateTime for Vital Signs.","comment":"At least a date should be present unless this observation is a historical report. For recording imprecise or \"fuzzy\" times (For example, a blood glucose measurement taken \"after breakfast\") use the [Timing](http://hl7.org/fhir/datatypes.html#timing) datatype which allow the measurement to be tied to regular life events.","requirements":"Knowing when an observation was deemed true is important to its relevance as well as determining trends.","alias":["Occurrence"],"min":1,"max":"1","base":{"path":"Observation.effective[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Period"}],"condition":["vs-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"vs-1","severity":"error","human":"if Observation.effective[x] is dateTime and has a value then that value shall be precise to the day","expression":"($this as dateTime).toString().length() >= 8","xpath":"f:effectiveDateTime[matches(@value, '^\\d{4}-\\d{2}-\\d{2}')]"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"OBX-14, and/or OBX-19 after v2.4 (depends on who observation made)"},{"identity":"rim","map":"effectiveTime"}]},{"id":"Observation.issued","path":"Observation.issued","short":"Date/Time this version was made available","definition":"The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.","comment":"For Observations that don’t require review and verification, it may be the same as the [`lastUpdated` ](http://hl7.org/fhir/resource-definitions.html#Meta.lastUpdated) time of the resource itself. For Observations that do require review and verification for certain updates, it might not be the same as the `lastUpdated` time of the resource itself due to a non-clinically significant update that doesn’t require the new version to be reviewed and verified again.","min":0,"max":"1","base":{"path":"Observation.issued","min":0,"max":"1"},"type":[{"code":"instant"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"v2","map":"OBR.22 (or MSH.7), or perhaps OBX-19 (depends on who observation made)"},{"identity":"rim","map":"participation[typeCode=AUT].time"}]},{"id":"Observation.performer","path":"Observation.performer","short":"Who is responsible for the observation","definition":"Who was responsible for asserting the observed value as \"true\".","requirements":"May give a degree of confidence in the observation and also indicates where follow-up questions should be directed.","min":0,"max":"*","base":{"path":"Observation.performer","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/CareTeam","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"OBX.15 / (Practitioner) OBX-16, PRT-5:PRT-4='RO' / (Device) OBX-18 , PRT-10:PRT-4='EQUIP' / (Organization) OBX-23, PRT-8:PRT-4='PO'"},{"identity":"rim","map":"participation[typeCode=PRF]"}]},{"id":"Observation.value[x]","path":"Observation.value[x]","slicing":{"discriminator":[{"type":"type","path":"$this"}],"ordered":false,"rules":"closed"},"short":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","definition":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","comment":"An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":0,"max":"1","base":{"path":"Observation.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"}],"condition":["obs-7","vs-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"sct-concept","map":"< 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.value[x]:valueQuantity","path":"Observation.value[x]","sliceName":"valueQuantity","short":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","definition":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","comment":"An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":1,"max":"1","base":{"path":"Observation.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"}],"condition":["obs-7","vs-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":false,"isModifier":false,"isSummary":true,"mapping":[{"identity":"sct-concept","map":"< 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.value[x]:valueQuantity.id","path":"Observation.value[x].id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.value[x]:valueQuantity.extension","path":"Observation.value[x].extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.value[x]:valueQuantity.value","path":"Observation.value[x].value","short":"Numerical value (with implicit precision)","definition":"The value of the measured amount. The value includes an implicit precision in the presentation of the value.","comment":"The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books).","requirements":"Precision is handled implicitly in almost all cases of measurement.","min":1,"max":"1","base":{"path":"Quantity.value","min":0,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"SN.2 / CQ - N/A"},{"identity":"rim","map":"PQ.value, CO.value, MO.value, IVL.high or IVL.low depending on the value"}]},{"id":"Observation.value[x]:valueQuantity.comparator","path":"Observation.value[x].comparator","short":"< | <= | >= | > - how to understand the value","definition":"How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is \"<\" , then the real value is < stated value.","requirements":"Need a framework for handling measures where the value is <5ug/L or >400mg/L due to the limitations of measuring methodology.","min":0,"max":"1","base":{"path":"Quantity.comparator","min":0,"max":"1"},"type":[{"code":"code"}],"meaningWhenMissing":"If there is no comparator, then there is no modification of the value","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because the comparator modifies the interpretation of the value significantly. If there is no comparator, then there is no modification of the value","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"QuantityComparator"}],"strength":"required","description":"How the Quantity should be understood and represented.","valueSet":"http://hl7.org/fhir/ValueSet/quantity-comparator|4.0.1"},"mapping":[{"identity":"v2","map":"SN.1 / CQ.1"},{"identity":"rim","map":"IVL properties"}]},{"id":"Observation.value[x]:valueQuantity.unit","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.value[x].unit","short":"Unit representation","definition":"A human-readable form of the unit.","requirements":"There are many representations for units of measure and in many contexts, particular representations are fixed and required. I.e. mcg for micrograms.","min":1,"max":"1","base":{"path":"Quantity.unit","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"PQ.unit"}]},{"id":"Observation.value[x]:valueQuantity.system","path":"Observation.value[x].system","short":"System that defines coded unit form","definition":"The identification of the system that provides the coded form of the unit.","requirements":"Need to know the system that defines the coded form of the unit.","min":1,"max":"1","base":{"path":"Quantity.system","min":0,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"http://unitsofmeasure.org","condition":["qty-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"CO.codeSystem, PQ.translation.codeSystem"}]},{"id":"Observation.value[x]:valueQuantity.code","path":"Observation.value[x].code","short":"Coded responses from the common UCUM units for vital signs value set.","definition":"A computer processable form of the unit in some unit representation system.","comment":"The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency. The context of use may additionally require a code from a particular system.","requirements":"Need a computable form of the unit that is fixed across all forms. UCUM provides this for quantities, but SNOMED CT provides many units of interest.","min":1,"max":"1","base":{"path":"Quantity.code","min":0,"max":"1"},"type":[{"code":"code"}],"fixedCode":"%","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"PQ.code, MO.currency, PQ.translation.code"}]},{"id":"Observation.dataAbsentReason","path":"Observation.dataAbsentReason","short":"Why the result is missing","definition":"Provides a reason why the expected value in the element Observation.value[x] is missing.","comment":"Null or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"specimen unsatisfactory\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Note that an observation may only be reported if there are values to report. For example differential cell counts values may be reported only when > 0. Because of these options, use-case agreements are required to interpret general observations for null or exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6","vs-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.interpretation","path":"Observation.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.note","path":"Observation.note","short":"Comments about the observation","definition":"Comments about the observation or the results.","comment":"May include general statements about the observation, or statements about significant, unexpected or unreliable results values, or information about its source when relevant to its interpretation.","requirements":"Need to be able to provide free text additional information.","min":0,"max":"*","base":{"path":"Observation.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NTE.3 (partner NTE to OBX, or sometimes another (child?) OBX)"},{"identity":"rim","map":"subjectOf.observationEvent[code=\"annotation\"].value"}]},{"id":"Observation.bodySite","path":"Observation.bodySite","short":"Observed body part","definition":"Indicates the site on the subject's body where the observation was made (i.e. the target site).","comment":"Only used if not implicit in code found in Observation.code. In many systems, this may be represented as a related observation instead of an inline component. \n\nIf the use case requires BodySite to be handled as a separate resource (e.g. to identify and track separately) then use the standard extension[ bodySite](http://hl7.org/fhir/extension-bodysite.html).","min":0,"max":"1","base":{"path":"Observation.bodySite","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BodySite"}],"strength":"example","description":"Codes describing anatomical locations. May include laterality.","valueSet":"http://hl7.org/fhir/ValueSet/body-site"},"mapping":[{"identity":"sct-concept","map":"< 123037004 |Body structure|"},{"identity":"v2","map":"OBX-20"},{"identity":"rim","map":"targetSiteCode"},{"identity":"sct-attr","map":"718497002 |Inherent location|"}]},{"id":"Observation.method","path":"Observation.method","short":"How it was done","definition":"Indicates the mechanism used to perform the observation.","comment":"Only used if not implicit in code for Observation.code.","requirements":"In some cases, method can impact results and is thus used for determining whether results can be compared or determining significance of results.","min":0,"max":"1","base":{"path":"Observation.method","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationMethod"}],"strength":"example","description":"Methods for simple observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-methods"},"mapping":[{"identity":"v2","map":"OBX-17"},{"identity":"rim","map":"methodCode"}]},{"id":"Observation.specimen","path":"Observation.specimen","short":"Specimen used for this observation","definition":"The specimen that was used when this observation was made.","comment":"Should only be used if not implicit in code found in `Observation.code`. Observations are not made on specimens themselves; they are made on a subject, but in many cases by the means of a specimen. Note that although specimens are often involved, they are not always tracked and reported explicitly. Also note that observation resources may be used in contexts that track the specimen explicitly (e.g. Diagnostic Report).","min":0,"max":"1","base":{"path":"Observation.specimen","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Specimen"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"sct-concept","map":"< 123038009 |Specimen|"},{"identity":"v2","map":"SPM segment"},{"identity":"rim","map":"participation[typeCode=SPC].specimen"},{"identity":"sct-attr","map":"704319004 |Inherent in|"}]},{"id":"Observation.device","path":"Observation.device","short":"(Measurement) Device","definition":"The device used to generate the observation data.","comment":"Note that this is not meant to represent a device involved in the transmission of the result, e.g., a gateway. Such devices may be documented using the Provenance resource where relevant.","min":0,"max":"1","base":{"path":"Observation.device","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/DeviceMetric"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"sct-concept","map":"< 49062001 |Device|"},{"identity":"v2","map":"OBX-17 / PRT -10"},{"identity":"rim","map":"participation[typeCode=DEV]"},{"identity":"sct-attr","map":"424226004 |Using device|"}]},{"id":"Observation.referenceRange","path":"Observation.referenceRange","short":"Provides guide for interpretation","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an \"OR\". In other words, to represent two distinct target populations, two `referenceRange` elements would be used.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.referenceRange","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"obs-3","severity":"error","human":"Must have at least a low or a high or text","expression":"low.exists() or high.exists() or text.exists()","xpath":"(exists(f:low) or exists(f:high)or exists(f:text))"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]},{"id":"Observation.referenceRange.id","path":"Observation.referenceRange.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.referenceRange.extension","path":"Observation.referenceRange.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.referenceRange.modifierExtension","path":"Observation.referenceRange.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.referenceRange.low","path":"Observation.referenceRange.low","short":"Low Range, if relevant","definition":"The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).","min":0,"max":"1","base":{"path":"Observation.referenceRange.low","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"condition":["obs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:IVL_PQ.low"}]},{"id":"Observation.referenceRange.high","path":"Observation.referenceRange.high","short":"High Range, if relevant","definition":"The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).","min":0,"max":"1","base":{"path":"Observation.referenceRange.high","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"condition":["obs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:IVL_PQ.high"}]},{"id":"Observation.referenceRange.type","path":"Observation.referenceRange.type","short":"Reference range qualifier","definition":"Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.","comment":"This SHOULD be populated if there is more than one range. If this element is not present then the normal range is assumed.","requirements":"Need to be able to say what kind of reference range this is - normal, recommended, therapeutic, etc., - for proper interpretation.","min":0,"max":"1","base":{"path":"Observation.referenceRange.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationRangeMeaning"}],"strength":"preferred","description":"Code for the meaning of a reference range.","valueSet":"http://hl7.org/fhir/ValueSet/referencerange-meaning"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values| OR \r< 365860008 |General clinical state finding| \rOR \r< 250171008 |Clinical history or observation findings| OR \r< 415229000 |Racial group| OR \r< 365400002 |Finding of puberty stage| OR\r< 443938003 |Procedure carried out on subject|"},{"identity":"v2","map":"OBX-10"},{"identity":"rim","map":"interpretationCode"}]},{"id":"Observation.referenceRange.appliesTo","path":"Observation.referenceRange.appliesTo","short":"Reference range population","definition":"Codes to indicate the target population this reference range applies to. For example, a reference range may be based on the normal population or a particular sex or race. Multiple `appliesTo` are interpreted as an \"AND\" of the target populations. For example, to represent a target population of African American females, both a code of female and a code for African American would be used.","comment":"This SHOULD be populated if there is more than one range. If this element is not present then the normal population is assumed.","requirements":"Need to be able to identify the target population for proper interpretation.","min":0,"max":"*","base":{"path":"Observation.referenceRange.appliesTo","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationRangeType"}],"strength":"example","description":"Codes identifying the population the reference range applies to.","valueSet":"http://hl7.org/fhir/ValueSet/referencerange-appliesto"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values| OR \r< 365860008 |General clinical state finding| \rOR \r< 250171008 |Clinical history or observation findings| OR \r< 415229000 |Racial group| OR \r< 365400002 |Finding of puberty stage| OR\r< 443938003 |Procedure carried out on subject|"},{"identity":"v2","map":"OBX-10"},{"identity":"rim","map":"interpretationCode"}]},{"id":"Observation.referenceRange.age","path":"Observation.referenceRange.age","short":"Applicable age range, if relevant","definition":"The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.","requirements":"Some analytes vary greatly over age.","min":0,"max":"1","base":{"path":"Observation.referenceRange.age","min":0,"max":"1"},"type":[{"code":"Range"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"outboundRelationship[typeCode=PRCN].targetObservationCriterion[code=\"age\"].value"}]},{"id":"Observation.referenceRange.text","path":"Observation.referenceRange.text","short":"Text based reference range in an observation","definition":"Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of \"Negative\" or a list or table of \"normals\".","min":0,"max":"1","base":{"path":"Observation.referenceRange.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:ST"}]},{"id":"Observation.hasMember","path":"Observation.hasMember","short":"Used when reporting vital signs panel components","definition":"Used when reporting vital signs panel components.","comment":"When using this element, an observation will typically have either a value or a set of related resources, although both may be present in some cases. For a discussion on the ways Observations can assembled in groups together, see [Notes](http://hl7.org/fhir/observation.html#obsgrouping) below. Note that a system may calculate results from [QuestionnaireResponse](http://hl7.org/fhir/questionnaireresponse.html) into a final score and represent the score as an Observation.","min":0,"max":"*","base":{"path":"Observation.hasMember","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","http://hl7.org/fhir/StructureDefinition/MolecularSequence","http://hl7.org/fhir/StructureDefinition/vitalsigns"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Relationships established by OBX-4 usage"},{"identity":"rim","map":"outBoundRelationship"}]},{"id":"Observation.derivedFrom","path":"Observation.derivedFrom","short":"Related measurements the observation is made from","definition":"The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.","comment":"All the reference choices that are listed in this element can represent clinical observations and other measurements that may be the source for a derived value. The most common reference will be another Observation. For a discussion on the ways Observations can assembled in groups together, see [Notes](http://hl7.org/fhir/observation.html#obsgrouping) below.","min":0,"max":"*","base":{"path":"Observation.derivedFrom","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/DocumentReference","http://hl7.org/fhir/StructureDefinition/ImagingStudy","http://hl7.org/fhir/StructureDefinition/Media","http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","http://hl7.org/fhir/StructureDefinition/MolecularSequence","http://hl7.org/fhir/StructureDefinition/vitalsigns"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Relationships established by OBX-4 usage"},{"identity":"rim","map":".targetObservation"}]},{"id":"Observation.component","path":"Observation.component","short":"Used when reporting systolic and diastolic blood pressure.","definition":"Used when reporting systolic and diastolic blood pressure.","comment":"For a discussion on the ways Observations can be assembled in groups together see [Notes](http://hl7.org/fhir/observation.html#notes) below.","requirements":"Component observations share the same attributes in the Observation resource as the primary observation and are always treated a part of a single observation (they are not separable). However, the reference range for the primary observation value is not inherited by the component values and is required when appropriate for each component observation.","min":0,"max":"*","base":{"path":"Observation.component","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"vs-3","severity":"error","human":"If there is no a value a data absent reason must be present","expression":"value.exists() or dataAbsentReason.exists()","xpath":"f:*[starts-with(local-name(.), 'value')] or f:dataAbsentReason"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"containment by OBX-4?"},{"identity":"rim","map":"outBoundRelationship[typeCode=COMP]"}]},{"id":"Observation.component.id","path":"Observation.component.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component.extension","path":"Observation.component.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component.modifierExtension","path":"Observation.component.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.component.code","path":"Observation.component.code","short":"Type of component observation (code / type)","definition":"Describes what was observed. Sometimes this is called the observation \"code\".","comment":"*All* code-value and component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation.","requirements":"Knowing what kind of observation is being made is essential to understanding the observation.","min":1,"max":"1","base":{"path":"Observation.component.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSigns"}],"strength":"extensible","description":"This identifies the vital sign result type.","valueSet":"http://hl7.org/fhir/ValueSet/observation-vitalsignresult"},"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR \r< 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"}]},{"id":"Observation.component.value[x]","path":"Observation.component.value[x]","short":"Vital Sign Value recorded with UCUM","definition":"Vital Sign Value recorded with UCUM.","comment":"Used when observation has a set of component observations. An observation may have both a value (e.g. an Apgar score) and component observations (the observations from which the Apgar score was derived). If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":0,"max":"1","base":{"path":"Observation.component.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"},{"code":"CodeableConcept"},{"code":"string"},{"code":"boolean"},{"code":"integer"},{"code":"Range"},{"code":"Ratio"},{"code":"SampledData"},{"code":"time"},{"code":"dateTime"},{"code":"Period"}],"condition":["vs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSignsUnits"}],"strength":"required","description":"Common UCUM units for recording Vital Signs.","valueSet":"http://hl7.org/fhir/ValueSet/ucum-vitals-common|4.0.1"},"mapping":[{"identity":"sct-concept","map":"363714003 |Interprets| < 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.component.dataAbsentReason","path":"Observation.component.dataAbsentReason","short":"Why the component result is missing","definition":"Provides a reason why the expected value in the element Observation.component.value[x] is missing.","comment":"\"Null\" or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"test not done\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Because of these options, use-case agreements are required to interpret general observations for exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.component.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6","vs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.component.interpretation","path":"Observation.component.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.component.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.component.referenceRange","path":"Observation.component.referenceRange","short":"Provides guide for interpretation of component result","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.component.referenceRange","min":0,"max":"*"},"contentReference":"#Observation.referenceRange","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]}]},"differential":{"element":[{"id":"Observation","path":"Observation","definition":"This profile defines how to represent Weight-for-length per age and gender observations in FHIR using a standard LOINC code and UCUM units of measure.","mustSupport":false},{"id":"Observation.code","path":"Observation.code","short":"Weight-for-length per age and gender","comment":"additional codes that translate or map to this code are allowed. For example a more granular LOINC code or code that is used locally in a system.","alias":["Test","Name"],"min":1,"max":"1","type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"77606-2"}]},"mustSupport":false},{"id":"Observation.valueQuantity","path":"Observation.valueQuantity","min":1,"max":"1","mustSupport":false},{"id":"Observation.valueQuantity.value","path":"Observation.valueQuantity.value","min":1,"max":"1","type":[{"code":"decimal"}],"mustSupport":true},{"id":"Observation.valueQuantity.unit","path":"Observation.valueQuantity.unit","min":1,"max":"1","type":[{"code":"string"}],"mustSupport":true},{"id":"Observation.valueQuantity.system","path":"Observation.valueQuantity.system","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"http://unitsofmeasure.org","mustSupport":true},{"id":"Observation.valueQuantity.code","path":"Observation.valueQuantity.code","short":"Coded responses from the common UCUM units for vital signs value set.","min":1,"max":"1","type":[{"code":"code"}],"fixedCode":"%","mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-allergyintolerance.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-allergyintolerance.json new file mode 100755 index 000000000..b444d1a9d --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-allergyintolerance.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-allergyintolerance","text":{"status":"generated","div":""},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance","version":"3.1.0","name":"USCoreAllergyIntolerance","title":"US Core AllergyIntolerance Profile","status":"active","experimental":false,"date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the AllergyIntolerance resource for the minimal set of data to query and retrieve allergy information.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"}],"kind":"resource","abstract":false,"type":"AllergyIntolerance","baseDefinition":"http://hl7.org/fhir/StructureDefinition/AllergyIntolerance","derivation":"constraint","snapshot":{"element":[{"id":"AllergyIntolerance","path":"AllergyIntolerance","short":"Allergy or Intolerance (generally: Risk of adverse reaction to a substance)","definition":"The US Core Allergies Profile is based upon the core FHIR AllergyIntolerance Resource and created to meet the 2015 Edition Common Clinical Data Set 'Medical allergies' requirements.","comment":"Substances include, but are not limited to: a therapeutic substance administered correctly at an appropriate dosage for the individual; food; material derived from plants or animals; or venom from insect stings.","alias":["Allergy","Intolerance","Adverse Reaction"],"min":0,"max":"*","base":{"path":"AllergyIntolerance","min":0,"max":"*"},"constraint":[{"key":"ait-1","severity":"error","human":"AllergyIntolerance.clinicalStatus SHALL be present if verificationStatus is not entered-in-error.","expression":"verificationStatus.coding.where(system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-verification' and code = 'entered-in-error').exists() or clinicalStatus.exists()","xpath":"f:verificationStatus/f:coding/f:code/@value='entered-in-error' or exists(f:clinicalStatus)","source":"http://hl7.org/fhir/StructureDefinition/AllergyIntolerance"},{"key":"ait-2","severity":"error","human":"AllergyIntolerance.clinicalStatus SHALL NOT be present if verification Status is entered-in-error","expression":"verificationStatus.coding.where(system = 'http://terminology.hl7.org/CodeSystem/allergyintolerance-verification' and code = 'entered-in-error').empty() or clinicalStatus.empty()","xpath":"not(f:verificationStatus/f:coding/f:code/@value='entered-in-error') or not(exists(f:clinicalStatus))","source":"http://hl7.org/fhir/StructureDefinition/AllergyIntolerance"},{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"rim","map":"Observation[classCode=OBS, moodCode=EVN]"},{"identity":"argonaut-dq-dstu2","map":"AllergyIntolerance"}]},{"id":"AllergyIntolerance.id","path":"AllergyIntolerance.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"AllergyIntolerance.meta","path":"AllergyIntolerance.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"AllergyIntolerance.implicitRules","path":"AllergyIntolerance.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"AllergyIntolerance.language","path":"AllergyIntolerance.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"AllergyIntolerance.text","path":"AllergyIntolerance.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"AllergyIntolerance.contained","path":"AllergyIntolerance.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"AllergyIntolerance.extension","path":"AllergyIntolerance.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"AllergyIntolerance.modifierExtension","path":"AllergyIntolerance.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"AllergyIntolerance.identifier","path":"AllergyIntolerance.identifier","short":"External ids for this item","definition":"Business identifiers assigned to this AllergyIntolerance by the performer or other systems which remain constant as the resource is updated and propagates from server to server.","comment":"This is a business identifier, not a resource identifier (see [discussion](http://hl7.org/fhir/R4/resource.html#identifiers)). It is best practice for the identifier to only appear on a single resource instance, however business practices may occasionally dictate that multiple resource instances with the same identifier can exist - possibly even with different resource types. For example, multiple Patient and a Person resource instance might share the same social insurance number.","requirements":"Allows identification of the AllergyIntolerance as it is known by various participating systems and in a way that remains consistent across servers.","min":0,"max":"*","base":{"path":"AllergyIntolerance.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"IAM-7"},{"identity":"rim","map":"id"}]},{"id":"AllergyIntolerance.clinicalStatus","path":"AllergyIntolerance.clinicalStatus","short":"active | inactive | resolved","definition":"The clinical status of the allergy or intolerance.","comment":"Refer to [discussion](http://hl7.org/fhir/R4/extensibility.html#Special-Case) if clincalStatus is missing data.\nThe data type is CodeableConcept because clinicalStatus has some clinical judgment involved, such that there might need to be more specificity than the required FHIR value set allows. For example, a SNOMED coding might allow for additional specificity.","min":0,"max":"1","base":{"path":"AllergyIntolerance.clinicalStatus","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["ait-1","ait-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the status contains the codes inactive and resolved that mark the AllergyIntolerance as no longer active.","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/allergyintolerance-clinical"},"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"Observation ACT .inboundRelationship[typeCode=COMP].source[classCode=OBS, code=\"clinicalStatus\", moodCode=EVN].value"},{"identity":"argonaut-dq-dstu2","map":"AllergyIntolerance.status"}]},{"id":"AllergyIntolerance.verificationStatus","path":"AllergyIntolerance.verificationStatus","short":"unconfirmed | confirmed | refuted | entered-in-error","definition":"Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified substance (including pharmaceutical product).","comment":"The data type is CodeableConcept because verificationStatus has some clinical judgment involved, such that there might need to be more specificity than the required FHIR value set allows. For example, a SNOMED coding might allow for additional specificity.","min":0,"max":"1","base":{"path":"AllergyIntolerance.verificationStatus","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["ait-1","ait-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the status contains the codes refuted and entered-in-error that mark the AllergyIntolerance as not currently valid.","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/allergyintolerance-verification"},"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"Observation ACT .inboundRelationship[typeCode=COMP].source[classCode=OBS, code=\"verificationStatus\", moodCode=EVN].value"},{"identity":"argonaut-dq-dstu2","map":"AllergyIntolerance.status"}]},{"id":"AllergyIntolerance.type","path":"AllergyIntolerance.type","short":"allergy | intolerance - Underlying mechanism (if known)","definition":"Identification of the underlying physiological mechanism for the reaction risk.","comment":"Allergic (typically immune-mediated) reactions have been traditionally regarded as an indicator for potential escalation to significant future risk. Contemporary knowledge suggests that some reactions previously thought to be immune-mediated are, in fact, non-immune, but in some cases can still pose a life threatening risk. It is acknowledged that many clinicians might not be in a position to distinguish the mechanism of a particular reaction. Often the term \"allergy\" is used rather generically and may overlap with the use of \"intolerance\" - in practice the boundaries between these two concepts might not be well-defined or understood. This data element is included nevertheless, because many legacy systems have captured this attribute. Immunologic testing may provide supporting evidence for the basis of the reaction and the causative substance, but no tests are 100% sensitive or specific for sensitivity to a particular substance. If, as is commonly the case, it is unclear whether the reaction is due to an allergy or an intolerance, then the type element should be omitted from the resource.","alias":["Category","Class"],"min":0,"max":"1","base":{"path":"AllergyIntolerance.type","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AllergyIntoleranceType"}],"strength":"required","description":"Identification of the underlying physiological mechanism for a Reaction Risk.","valueSet":"http://hl7.org/fhir/ValueSet/allergy-intolerance-type|4.0.1"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"IAM-9"},{"identity":"rim","map":"code"}]},{"id":"AllergyIntolerance.category","path":"AllergyIntolerance.category","short":"food | medication | environment | biologic","definition":"Category of the identified substance.","comment":"This data element has been included because it is currently being captured in some clinical systems. This data can be derived from the substance where coding systems are used, and is effectively redundant in that situation. When searching on category, consider the implications of AllergyIntolerance resources without a category. For example, when searching on category = medication, medication allergies that don't have a category valued will not be returned. Refer to [search](http://hl7.org/fhir/R4/search.html) for more information on how to search category with a :missing modifier to get allergies that don't have a category. Additionally, category should be used with caution because category can be subjective based on the sender.","alias":["Category","Type","Reaction Type","Class"],"min":0,"max":"*","base":{"path":"AllergyIntolerance.category","min":0,"max":"*"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AllergyIntoleranceCategory"}],"strength":"required","description":"Category of an identified substance associated with allergies or intolerances.","valueSet":"http://hl7.org/fhir/ValueSet/allergy-intolerance-category|4.0.1"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"AL1-2"},{"identity":"rim","map":"value < IntoleranceValue (Agent)"}]},{"id":"AllergyIntolerance.criticality","path":"AllergyIntolerance.criticality","short":"low | high | unable-to-assess","definition":"Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance.","comment":"The default criticality value for any propensity to an adverse reaction should be 'Low Risk', indicating at the very least a relative contraindication to deliberate or voluntary exposure to the substance. 'High Risk' is flagged if the clinician has identified a propensity for a more serious or potentially life-threatening reaction, such as anaphylaxis, and implies an absolute contraindication to deliberate or voluntary exposure to the substance. If this element is missing, the criticality is unknown (though it may be known elsewhere). Systems that capture a severity at the condition level are actually representing the concept of criticality whereas the severity documented at the reaction level is representing the true reaction severity. Existing systems that are capturing both condition criticality and reaction severity may use the term \"severity\" to represent both. Criticality is the worst it could be in the future (i.e. situation-agnostic) whereas severity is situation-dependent.","alias":["Severity","Seriousness","Contra-indication","Risk"],"min":0,"max":"1","base":{"path":"AllergyIntolerance.criticality","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AllergyIntoleranceCriticality"}],"strength":"required","description":"Estimate of the potential clinical harm, or seriousness, of a reaction to an identified substance.","valueSet":"http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality|4.0.1"},"mapping":[{"identity":"w5","map":"FiveWs.grade"},{"identity":"v2","map":"AL1-4"},{"identity":"rim","map":"inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=SEV, value <= SeverityObservation (Severity Level)]"}]},{"id":"AllergyIntolerance.code","path":"AllergyIntolerance.code","short":"Code that identifies the allergy or intolerance","definition":"Code for an allergy or intolerance statement (either a positive or a negated/excluded statement). This may be a code for a substance or pharmaceutical product that is considered to be responsible for the adverse reaction risk (e.g., \"Latex\"), an allergy or intolerance condition (e.g., \"Latex allergy\"), or a negated/excluded code for a specific substance or class (e.g., \"No latex allergy\") or a general or categorical negated statement (e.g., \"No known allergy\", \"No known drug allergies\"). Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'. If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.","comment":"It is strongly recommended that this element be populated using a terminology, where possible. For example, some terminologies used include RxNorm, SNOMED CT, DM+D, NDFRT, ICD-9, IDC-10, UNII, and ATC. Plain text should only be used if there is no appropriate terminology available. Additional details can be specified in the text.\r\rWhen a substance or product code is specified for the 'code' element, the \"default\" semantic context is that this is a positive statement of an allergy or intolerance (depending on the value of the 'type' element, if present) condition to the specified substance/product. In the corresponding SNOMED CT allergy model, the specified substance/product is the target (destination) of the \"Causative agent\" relationship.\r\rThe 'substanceExposureRisk' extension is available as a structured and more flexible alternative to the 'code' element for making positive or negative allergy or intolerance statements. This extension provides the capability to make \"no known allergy\" (or \"no risk of adverse reaction\") statements regarding any coded substance/product (including cases when a pre-coordinated \"no allergy to x\" concept for that substance/product does not exist). If the 'substanceExposureRisk' extension is present, the AllergyIntolerance.code element SHALL be omitted.","alias":["Code"],"min":1,"max":"1","base":{"path":"AllergyIntolerance.code","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-allergy-substance"},"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"v2","map":"AL1-3 / IAM-3"},{"identity":"rim","map":"substance/product:\r\r.participation[typeCode=CAGNT].role[classCode=ADMM].player[classCode=MAT, determinerCode=KIND, code <= ExposureAgentEntityType]\r\rnegated/excluded substance/product:\r\r.participation[typeCode=CAGNT, negationInd=true].role[classCode=ADMM].player[classCode=MAT, determinerCode=KIND, code <= ExposureAgentEntityType]\r\rpositive or negated/excluded condition/situation:\r\rObservation.code=ASSERTION; Observation.value"},{"identity":"argonaut-dq-dstu2","map":"AllergyIntolerance.substance"}]},{"id":"AllergyIntolerance.patient","path":"AllergyIntolerance.patient","short":"Who the sensitivity is for","definition":"The patient who has the allergy or intolerance.","alias":["Patient"],"min":1,"max":"1","base":{"path":"AllergyIntolerance.patient","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"(PID-3)"},{"identity":"rim","map":".participation[typeCode=SBJ].role[classCode=PAT]"},{"identity":"w5","map":"FiveWs.subject"},{"identity":"argonaut-dq-dstu2","map":"AllergyIntolerance.patient"}]},{"id":"AllergyIntolerance.encounter","path":"AllergyIntolerance.encounter","short":"Encounter when the allergy or intolerance was asserted","definition":"The encounter when the allergy or intolerance was asserted.","min":0,"max":"1","base":{"path":"AllergyIntolerance.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.context"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN]"}]},{"id":"AllergyIntolerance.onset[x]","path":"AllergyIntolerance.onset[x]","short":"When allergy or intolerance was identified","definition":"Estimated or actual date, date-time, or age when allergy or intolerance was identified.","min":0,"max":"1","base":{"path":"AllergyIntolerance.onset[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Age"},{"code":"Period"},{"code":"Range"},{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.init"},{"identity":"rim","map":"effectiveTime.low"}]},{"id":"AllergyIntolerance.recordedDate","path":"AllergyIntolerance.recordedDate","short":"Date first version of the resource instance was recorded","definition":"The recordedDate represents when this particular AllergyIntolerance record was created in the system, which is often a system-generated date.","min":0,"max":"1","base":{"path":"AllergyIntolerance.recordedDate","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"v2","map":"IAM-13"},{"identity":"rim","map":".participation[typeCode=AUT].time"}]},{"id":"AllergyIntolerance.recorder","path":"AllergyIntolerance.recorder","short":"Who recorded the sensitivity","definition":"Individual who recorded the record and takes responsibility for its content.","alias":["Author"],"min":0,"max":"1","base":{"path":"AllergyIntolerance.recorder","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.author"},{"identity":"rim","map":".participation[typeCode=AUT].role"}]},{"id":"AllergyIntolerance.asserter","path":"AllergyIntolerance.asserter","short":"Source of the information about the allergy","definition":"The source of the information about the allergy that is recorded.","comment":"The recorder takes responsibility for the content, but can reference the source from where they got it.","alias":["Source","Informant"],"min":0,"max":"1","base":{"path":"AllergyIntolerance.asserter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.source"},{"identity":"v2","map":"IAM-14 (if patient) / IAM-18 (if practitioner)"},{"identity":"rim","map":".participation[typeCode=INF].role"}]},{"id":"AllergyIntolerance.lastOccurrence","path":"AllergyIntolerance.lastOccurrence","short":"Date(/time) of last known occurrence of a reaction","definition":"Represents the date and/or time of the last known occurrence of a reaction event.","comment":"This date may be replicated by one of the Onset of Reaction dates. Where a textual representation of the date of last occurrence is required e.g. 'In Childhood, '10 years ago' the Comment element should be used.","min":0,"max":"1","base":{"path":"AllergyIntolerance.lastOccurrence","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"outBoundRelationship[typeCode=SUBJ].target[classCode=OBS, moodCode=EVN, code <= CommonClinicalObservationType, value <= ObservationValue (Reaction Type)].effectiveTime"}]},{"id":"AllergyIntolerance.note","path":"AllergyIntolerance.note","short":"Additional text not captured in other fields","definition":"Additional narrative about the propensity for the Adverse Reaction, not captured in other fields.","comment":"For example: including reason for flagging a seriousness of 'High Risk'; and instructions related to future exposure or administration of the substance, such as administration within an Intensive Care Unit or under corticosteroid cover. The notes should be related to an allergy or intolerance as a condition in general and not related to any particular episode of it. For episode notes and descriptions, use AllergyIntolerance.event.description and AllergyIntolerance.event.notes.","min":0,"max":"*","base":{"path":"AllergyIntolerance.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"subjectOf.observationEvent[code=\"annotation\"].value"}]},{"id":"AllergyIntolerance.reaction","path":"AllergyIntolerance.reaction","short":"Adverse Reaction Events linked to exposure to substance","definition":"Details about each adverse reaction event linked to exposure to the identified substance.","min":0,"max":"*","base":{"path":"AllergyIntolerance.reaction","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"outBoundRelationship[typeCode=SUBJ].target[classCode=OBS, moodCode=EVN, code <= CommonClinicalObservationType, value <= ObservationValue (Reaction Type)]"}]},{"id":"AllergyIntolerance.reaction.id","path":"AllergyIntolerance.reaction.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"AllergyIntolerance.reaction.extension","path":"AllergyIntolerance.reaction.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"AllergyIntolerance.reaction.modifierExtension","path":"AllergyIntolerance.reaction.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"AllergyIntolerance.reaction.substance","path":"AllergyIntolerance.reaction.substance","short":"Specific substance or pharmaceutical product considered to be responsible for event","definition":"Identification of the specific substance (or pharmaceutical product) considered to be responsible for the Adverse Reaction event. Note: the substance for a specific reaction may be different from the substance identified as the cause of the risk, but it must be consistent with it. For instance, it may be a more specific substance (e.g. a brand medication) or a composite product that includes the identified substance. It must be clinically safe to only process the 'code' and ignore the 'reaction.substance'. If a receiving system is unable to confirm that AllergyIntolerance.reaction.substance falls within the semantic scope of AllergyIntolerance.code, then the receiving system should ignore AllergyIntolerance.reaction.substance.","comment":"Coding of the specific substance (or pharmaceutical product) with a terminology capable of triggering decision support should be used wherever possible. The 'code' element allows for the use of a specific substance or pharmaceutical product, or a group or class of substances. In the case of an allergy or intolerance to a class of substances, (for example, \"penicillins\"), the 'reaction.substance' element could be used to code the specific substance that was identified as having caused the reaction (for example, \"amoxycillin\"). Duplication of the value in the 'code' and 'reaction.substance' elements is acceptable when a specific substance has been recorded in 'code'.","min":0,"max":"1","base":{"path":"AllergyIntolerance.reaction.substance","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"SubstanceCode"}],"strength":"example","description":"Codes defining the type of the substance (including pharmaceutical products).","valueSet":"http://hl7.org/fhir/ValueSet/substance-code"},"mapping":[{"identity":"rim","map":"outBoundRelationship[typeCode=SAS].target[classCode=SBADM, code <= ExposureCode].participation[typeCode=CSM].role[classCode=ADMM].player[classCode=MAT, determinerCode=KIND, code <= ExposureAgentEntityType]"}]},{"id":"AllergyIntolerance.reaction.manifestation","path":"AllergyIntolerance.reaction.manifestation","short":"Clinical symptoms/signs associated with the Event","definition":"Clinical symptoms and/or signs that are observed or associated with the adverse reaction event.","comment":"Manifestation can be expressed as a single word, phrase or brief description. For example: nausea, rash or no reaction. It is preferable that manifestation should be coded with a terminology, where possible. The values entered here may be used to display on an application screen as part of a list of adverse reactions, as recommended in the UK NHS CUI guidelines. Terminologies commonly used include, but are not limited to, SNOMED CT or ICD10.","alias":["Symptoms","Signs"],"min":1,"max":"*","base":{"path":"AllergyIntolerance.reaction.manifestation","min":1,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Manifestation"}],"strength":"example","description":"Clinical symptoms and/or signs that are observed or associated with an Adverse Reaction Event.","valueSet":"http://hl7.org/fhir/ValueSet/clinical-findings"},"mapping":[{"identity":"v2","map":"AL1-5"},{"identity":"rim","map":"code"}]},{"id":"AllergyIntolerance.reaction.description","path":"AllergyIntolerance.reaction.description","short":"Description of the event as a whole","definition":"Text description about the reaction as a whole, including details of the manifestation if required.","comment":"Use the description to provide any details of a particular event of the occurred reaction such as circumstances, reaction specifics, what happened before/after. Information, related to the event, but not describing a particular care should be captured in the comment field. For example: at the age of four, the patient was given penicillin for strep throat and subsequently developed severe hives.","alias":["Narrative","Text"],"min":0,"max":"1","base":{"path":"AllergyIntolerance.reaction.description","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"text"}]},{"id":"AllergyIntolerance.reaction.onset","path":"AllergyIntolerance.reaction.onset","short":"Date(/time) when manifestations showed","definition":"Record of the date and/or time of the onset of the Reaction.","min":0,"max":"1","base":{"path":"AllergyIntolerance.reaction.onset","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"AL1-6"},{"identity":"rim","map":"effectiveTime.low"}]},{"id":"AllergyIntolerance.reaction.severity","path":"AllergyIntolerance.reaction.severity","short":"mild | moderate | severe (of event as a whole)","definition":"Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different manifestations.","comment":"It is acknowledged that this assessment is very subjective. There may be some specific practice domains where objective scales have been applied. Objective scales can be included in this model as extensions.","min":0,"max":"1","base":{"path":"AllergyIntolerance.reaction.severity","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AllergyIntoleranceSeverity"}],"strength":"required","description":"Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different manifestations.","valueSet":"http://hl7.org/fhir/ValueSet/reaction-event-severity|4.0.1"},"mapping":[{"identity":"rim","map":"inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=SEV, value <= SeverityObservation (Severity Level)]"}]},{"id":"AllergyIntolerance.reaction.exposureRoute","path":"AllergyIntolerance.reaction.exposureRoute","short":"How the subject was exposed to the substance","definition":"Identification of the route by which the subject was exposed to the substance.","comment":"Coding of the route of exposure with a terminology should be used wherever possible.","min":0,"max":"1","base":{"path":"AllergyIntolerance.reaction.exposureRoute","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"RouteOfAdministration"}],"strength":"example","description":"A coded concept describing the route or physiological path of administration of a therapeutic agent into or onto the body of a subject.","valueSet":"http://hl7.org/fhir/ValueSet/route-codes"},"mapping":[{"identity":"rim","map":"outBoundRelationship[typeCode=SAS].target[classCode=SBADM, code <= ExposureCode].routeCode"}]},{"id":"AllergyIntolerance.reaction.note","path":"AllergyIntolerance.reaction.note","short":"Text about event not captured in other fields","definition":"Additional text about the adverse reaction event not captured in other fields.","comment":"Use this field to record information indirectly related to a particular event and not captured in the description. For example: Clinical records are no longer available, recorded based on information provided to the patient by her mother and her mother is deceased.","min":0,"max":"*","base":{"path":"AllergyIntolerance.reaction.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"subjectOf.observationEvent[code=\"annotation\"].value"}]}]},"differential":{"element":[{"id":"AllergyIntolerance","path":"AllergyIntolerance","definition":"The US Core Allergies Profile is based upon the core FHIR AllergyIntolerance Resource and created to meet the 2015 Edition Common Clinical Data Set 'Medical allergies' requirements.","mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"AllergyIntolerance"}]},{"id":"AllergyIntolerance.clinicalStatus","path":"AllergyIntolerance.clinicalStatus","min":0,"max":"1","mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/allergyintolerance-clinical"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"AllergyIntolerance.status"}]},{"id":"AllergyIntolerance.verificationStatus","path":"AllergyIntolerance.verificationStatus","min":0,"max":"1","mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/allergyintolerance-verification"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"AllergyIntolerance.status"}]},{"id":"AllergyIntolerance.code","path":"AllergyIntolerance.code","min":1,"max":"1","mustSupport":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-allergy-substance"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"AllergyIntolerance.substance"}]},{"id":"AllergyIntolerance.patient","path":"AllergyIntolerance.patient","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"AllergyIntolerance.patient"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-birthsex.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-birthsex.json new file mode 100755 index 000000000..66493ebc1 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-birthsex.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-birthsex","text":{"status":"generated","div":"
    \r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Extension 0..1
    \".\"\".\"\".\" url 1..1uri"http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex"
    \".\"\".\"\".\" valueCode 0..1codeBinding: Birth Sex (required)

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex","version":"3.1.0","name":"USCoreBirthSexExtension","title":"US Core Birth Sex Extension","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"A code classifying the person's sex assigned at birth as specified by the [Office of the National Coordinator for Health IT (ONC)](https://www.healthit.gov/newsroom/about-onc). This extension aligns with the C-CDA Birth Sex Observation (LOINC 76689-9).","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"complex-type","abstract":false,"context":[{"type":"element","expression":"Patient"}],"type":"Extension","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Extension","derivation":"constraint","snapshot":{"element":[{"id":"Extension","path":"Extension","short":"Extension","definition":"A code classifying the person's sex assigned at birth as specified by the [Office of the National Coordinator for Health IT (ONC)](https://www.healthit.gov/newsroom/about-onc).","comment":"The codes required are intended to present birth sex (i.e., the sex recorded on the patient’s birth certificate) and not gender identity or reassigned sex.","min":0,"max":"1","base":{"path":"Extension","min":0,"max":"*"},"condition":["ele-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"mapping":[{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"iso11179","map":".patient.administrativeGenderCode"}]},{"id":"Extension.id","path":"Extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension","path":"Extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.url","path":"Extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"fixedUri":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.value[x]","path":"Extension.value[x]","slicing":{"discriminator":[{"type":"type","path":"$this"}],"ordered":false,"rules":"closed"},"short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.value[x]:valueCode","path":"Extension.value[x]","sliceName":"valueCode","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"strength":"required","description":"Code for sex assigned at birth","valueSet":"http://hl7.org/fhir/us/core/ValueSet/birthsex"},"mapping":[{"identity":"rim","map":"N/A"}]}]},"differential":{"element":[{"id":"Extension","path":"Extension","definition":"A code classifying the person's sex assigned at birth as specified by the [Office of the National Coordinator for Health IT (ONC)](https://www.healthit.gov/newsroom/about-onc).","comment":"The codes required are intended to present birth sex (i.e., the sex recorded on the patient’s birth certificate) and not gender identity or reassigned sex.","min":0,"max":"1","isModifier":false,"mapping":[{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"iso11179","map":".patient.administrativeGenderCode"}]},{"id":"Extension.url","path":"Extension.url","fixedUri":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex"},{"id":"Extension.valueCode","path":"Extension.valueCode","min":0,"max":"1","type":[{"code":"code"}],"binding":{"strength":"required","description":"Code for sex assigned at birth","valueSet":"http://hl7.org/fhir/us/core/ValueSet/birthsex"}}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-careplan.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-careplan.json new file mode 100755 index 000000000..d37b86891 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-careplan.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-careplan","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" CarePlan 0..*
    \".\"\".\"\".\" text S1..1Narrative
    \".\"\".\"\".\"\".\" status S1..1codeBinding: US Core Narrative Status (required)
    \".\"\".\"\".\" status S1..1codeBinding: RequestStatus (required)
    \".\"\".\"\".\" intent S1..1codeBinding: CarePlanIntent (required)
    \".\"\".\"\".\" category S1..*(Slice Definition)Slice: Unordered, Open by pattern:$this
    \".\"\".\"\".\"\".\" category:AssessPlan S1..1CodeableConceptRequired Pattern: At least the following
    \".\"\".\"\".\"\".\"\".\" coding1..*CodingCode defined by a terminology system
    Fixed Value: (complex)
    \".\"\".\"\".\"\".\"\".\"\".\" system1..1uriIdentity of the terminology system
    Fixed Value: http://hl7.org/fhir/us/core/CodeSystem/careplan-category
    \".\"\".\"\".\"\".\"\".\"\".\" code1..1codeSymbol in syntax defined by the system
    Fixed Value: assess-plan
    \".\"\".\"\".\" subject S1..1Reference(US Core Patient Profile)

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan","version":"3.1.0","name":"USCoreCarePlanProfile","title":"US Core CarePlan Profile","status":"active","experimental":false,"date":"2019-08-29T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the CarePlan resource for the minimal set of data to query and retrieve a patient's Care Plan.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"}],"kind":"resource","abstract":false,"type":"CarePlan","baseDefinition":"http://hl7.org/fhir/StructureDefinition/CarePlan","derivation":"constraint","snapshot":{"element":[{"id":"CarePlan","path":"CarePlan","short":"Healthcare plan for patient or group","definition":"The US Core CarePlan Profile is based upon the core FHIR CarePlan Resource and created to meet the 2015 Edition Common Clinical Data Set 'Assessment and Plan of Treatment requirements.","alias":["Care Team"],"min":0,"max":"*","base":{"path":"CarePlan","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Request"},{"identity":"rim","map":"Act[classCode=PCPR, moodCode=INT]"},{"identity":"argonaut-dq-dstu2","map":"CarePlan"}]},{"id":"CarePlan.id","path":"CarePlan.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"CarePlan.meta","path":"CarePlan.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"CarePlan.implicitRules","path":"CarePlan.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"CarePlan.language","path":"CarePlan.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"CarePlan.text","path":"CarePlan.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":1,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.text"}]},{"id":"CarePlan.text.id","path":"CarePlan.text.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"CarePlan.text.extension","path":"CarePlan.text.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"CarePlan.text.status","path":"CarePlan.text.status","short":"generated | extensions | additional | empty","definition":"generated | additional.","min":1,"max":"1","base":{"path":"Narrative.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"strength":"required","description":"Constrained value set of narrative statuses.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-narrative-status"},"mapping":[{"identity":"rim","map":"N/A"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.text.status"}]},{"id":"CarePlan.text.div","path":"CarePlan.text.div","short":"Limited xhtml content","definition":"The actual narrative content, a stripped down version of XHTML.","comment":"The contents of the html element are an XHTML fragment containing only the basic html formatting elements described in chapters 7-11 and 15 of the HTML 4.0 standard, elements (either name or href), images and internally contained stylesheets. The XHTML content SHALL NOT contain a head, a body, external stylesheet references, scripts, forms, base/link/xlink, frames, iframes and objects.","min":1,"max":"1","base":{"path":"Narrative.div","min":1,"max":"1"},"type":[{"code":"xhtml"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"txt-1","severity":"error","human":"The narrative SHALL contain only the basic html formatting elements and attributes described in chapters 7-11 (except section 4 of chapter 9) and 15 of the HTML 4.0 standard, elements (either name or href), images and internally contained style attributes","expression":"htmlChecks()","xpath":"not(descendant-or-self::*[not(local-name(.)=('a', 'abbr', 'acronym', 'b', 'big', 'blockquote', 'br', 'caption', 'cite', 'code', 'col', 'colgroup', 'dd', 'dfn', 'div', 'dl', 'dt', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'i', 'img', 'li', 'ol', 'p', 'pre', 'q', 'samp', 'small', 'span', 'strong', 'sub', 'sup', 'table', 'tbody', 'td', 'tfoot', 'th', 'thead', 'tr', 'tt', 'ul', 'var'))]) and not(descendant-or-self::*/@*[not(name(.)=('abbr', 'accesskey', 'align', 'alt', 'axis', 'bgcolor', 'border', 'cellhalign', 'cellpadding', 'cellspacing', 'cellvalign', 'char', 'charoff', 'charset', 'cite', 'class', 'colspan', 'compact', 'coords', 'dir', 'frame', 'headers', 'height', 'href', 'hreflang', 'hspace', 'id', 'lang', 'longdesc', 'name', 'nowrap', 'rel', 'rev', 'rowspan', 'rules', 'scope', 'shape', 'span', 'src', 'start', 'style', 'summary', 'tabindex', 'title', 'type', 'valign', 'value', 'vspace', 'width'))])"},{"key":"txt-2","severity":"error","human":"The narrative SHALL have some non-whitespace content","expression":"htmlChecks()","xpath":"descendant::text()[normalize-space(.)!=''] or descendant::h:img[@src]"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"CarePlan.contained","path":"CarePlan.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"CarePlan.extension","path":"CarePlan.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"CarePlan.modifierExtension","path":"CarePlan.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"CarePlan.identifier","path":"CarePlan.identifier","short":"External Ids for this plan","definition":"Business identifiers assigned to this care plan by the performer or other systems which remain constant as the resource is updated and propagates from server to server.","comment":"This is a business identifier, not a resource identifier (see [discussion](http://hl7.org/fhir/R4/resource.html#identifiers)). It is best practice for the identifier to only appear on a single resource instance, however business practices may occasionally dictate that multiple resource instances with the same identifier can exist - possibly even with different resource types. For example, multiple Patient and a Person resource instance might share the same social insurance number.","requirements":"Allows identification of the care plan as it is known by various participating systems and in a way that remains consistent across servers.","min":0,"max":"*","base":{"path":"CarePlan.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PTH-3"},{"identity":"rim","map":".id"}]},{"id":"CarePlan.instantiatesCanonical","path":"CarePlan.instantiatesCanonical","short":"Instantiates FHIR protocol or definition","definition":"The URL pointing to a FHIR-defined protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan.","min":0,"max":"*","base":{"path":"CarePlan.instantiatesCanonical","min":0,"max":"*"},"type":[{"code":"canonical","targetProfile":["http://hl7.org/fhir/StructureDefinition/PlanDefinition","http://hl7.org/fhir/StructureDefinition/Questionnaire","http://hl7.org/fhir/StructureDefinition/Measure","http://hl7.org/fhir/StructureDefinition/ActivityDefinition","http://hl7.org/fhir/StructureDefinition/OperationDefinition"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.instantiatesCanonical"},{"identity":"rim","map":".outboundRelationship[typeCode=DEFN].target"}]},{"id":"CarePlan.instantiatesUri","path":"CarePlan.instantiatesUri","short":"Instantiates external protocol or definition","definition":"The URL pointing to an externally maintained protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan.","comment":"This might be an HTML page, PDF, etc. or could just be a non-resolvable URI identifier.","min":0,"max":"*","base":{"path":"CarePlan.instantiatesUri","min":0,"max":"*"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.instantiatesUri"},{"identity":"rim","map":".outboundRelationship[typeCode=DEFN].target"}]},{"id":"CarePlan.basedOn","path":"CarePlan.basedOn","short":"Fulfills CarePlan","definition":"A care plan that is fulfilled in whole or in part by this care plan.","requirements":"Allows tracing of the care plan and tracking whether proposals/recommendations were acted upon.","alias":["fulfills"],"min":0,"max":"*","base":{"path":"CarePlan.basedOn","min":0,"max":"*"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.basedOn"}]},{"id":"CarePlan.replaces","path":"CarePlan.replaces","short":"CarePlan replaced by this CarePlan","definition":"Completed or terminated care plan whose function is taken by this new care plan.","comment":"The replacement could be because the initial care plan was immediately rejected (due to an issue) or because the previous care plan was completed, but the need for the action described by the care plan remains ongoing.","requirements":"Allows tracing the continuation of a therapy or administrative process instantiated through multiple care plans.","alias":["supersedes"],"min":0,"max":"*","base":{"path":"CarePlan.replaces","min":0,"max":"*"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.replaces"}]},{"id":"CarePlan.partOf","path":"CarePlan.partOf","short":"Part of referenced CarePlan","definition":"A larger care plan of which this particular care plan is a component or step.","comment":"Each care plan is an independent request, such that having a care plan be part of another care plan can cause issues with cascading statuses. As such, this element is still being discussed.","min":0,"max":"*","base":{"path":"CarePlan.partOf","min":0,"max":"*"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"CarePlan.status","path":"CarePlan.status","short":"draft | active | on-hold | revoked | completed | entered-in-error | unknown","definition":"Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.","comment":"The unknown code is not to be used to convey other statuses. The unknown code should be used when one of the statuses applies, but the authoring system doesn't know the current state of the care plan.\n\nThis element is labeled as a modifier because the status contains the code entered-in-error that marks the plan as not currently valid.","requirements":"Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.","min":1,"max":"1","base":{"path":"CarePlan.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","description":"Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.","valueSet":"http://hl7.org/fhir/ValueSet/request-status"},"mapping":[{"identity":"workflow","map":"Request.status {uses different ValueSet}"},{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"PTH-5"},{"identity":"rim","map":".statusCode planned = new active = active completed = completed"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.status"}]},{"id":"CarePlan.intent","path":"CarePlan.intent","short":"proposal | plan | order | option","definition":"Indicates the level of authority/intentionality associated with the care plan and where the care plan fits into the workflow chain.","comment":"This element is labeled as a modifier because the intent alters when and how the resource is actually applicable.","requirements":"Proposals/recommendations, plans and orders all use the same structure and can exist in the same fulfillment chain.","min":1,"max":"1","base":{"path":"CarePlan.intent","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element changes the interpretation of all descriptive attributes. For example \"the time the request is recommended to occur\" vs. \"the time the request is authorized to occur\" or \"who is recommended to perform the request\" vs. \"who is authorized to perform the request\"","isSummary":true,"binding":{"strength":"required","description":"Codes indicating the degree of authority/intentionality associated with a care plan","valueSet":"http://hl7.org/fhir/ValueSet/care-plan-intent"},"mapping":[{"identity":"workflow","map":"Request.intent"},{"identity":"argonaut-dq-dstu2","map":"NA (new element in STU3)"}]},{"id":"CarePlan.category","path":"CarePlan.category","slicing":{"discriminator":[{"type":"pattern","path":"$this"}],"rules":"open"},"short":"Type of plan","definition":"Type of plan.","comment":"There may be multiple axes of categorization and one plan may serve multiple purposes. In some cases, this may be redundant with references to CarePlan.concern.","requirements":"Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.","min":1,"max":"*","base":{"path":"CarePlan.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CarePlanCategory"}],"strength":"example","description":"Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", etc.","valueSet":"http://hl7.org/fhir/ValueSet/care-plan-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.category"}]},{"id":"CarePlan.category:AssessPlan","path":"CarePlan.category","sliceName":"AssessPlan","short":"Type of plan","definition":"Type of plan.","comment":"There may be multiple axes of categorization and one plan may serve multiple purposes. In some cases, this may be redundant with references to CarePlan.concern.","requirements":"Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.","min":1,"max":"1","base":{"path":"CarePlan.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://hl7.org/fhir/us/core/CodeSystem/careplan-category","code":"assess-plan"}]},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CarePlanCategory"}],"strength":"example","description":"Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", etc.","valueSet":"http://hl7.org/fhir/ValueSet/care-plan-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.category"}]},{"id":"CarePlan.title","path":"CarePlan.title","short":"Human-friendly name for the care plan","definition":"Human-friendly name for the care plan.","min":0,"max":"1","base":{"path":"CarePlan.title","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"CarePlan.description","path":"CarePlan.description","short":"Summary of nature of plan","definition":"A description of the scope and nature of the plan.","requirements":"Provides more detail than conveyed by category.","min":0,"max":"1","base":{"path":"CarePlan.description","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"}]},{"id":"CarePlan.subject","path":"CarePlan.subject","short":"Who the care plan is for","definition":"Who care plan is for.","requirements":"Identifies the patient or group whose intended care is described by the plan.","alias":["patient"],"min":1,"max":"1","base":{"path":"CarePlan.subject","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":".participation[typeCode=PAT].role[classCode=PAT]"},{"identity":"w5","map":"FiveWs.subject"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.subject"}]},{"id":"CarePlan.encounter","path":"CarePlan.encounter","short":"Encounter created as part of","definition":"The Encounter during which this CarePlan was created or to which the creation of this record is tightly associated.","comment":"This will typically be the encounter the event occurred within, but some activities may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter. CarePlan activities conducted as a result of the care plan may well occur as part of other encounters.","min":0,"max":"1","base":{"path":"CarePlan.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"Associated PV1"},{"identity":"rim","map":"."}]},{"id":"CarePlan.period","path":"CarePlan.period","short":"Time period plan covers","definition":"Indicates when the plan did (or is intended to) come into effect and end.","comment":"Any activities scheduled as part of the plan should be constrained to the specified period regardless of whether the activities are planned within a single encounter/episode or across multiple encounters/episodes (e.g. the longitudinal management of a chronic condition).","requirements":"Allows tracking what plan(s) are in effect at a particular time.","alias":["timing"],"min":0,"max":"1","base":{"path":"CarePlan.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.occurrence[x]"},{"identity":"w5","map":"FiveWs.planned"},{"identity":"v2","map":"GOL-7 / GOL-8"},{"identity":"rim","map":".effectiveTime"}]},{"id":"CarePlan.created","path":"CarePlan.created","short":"Date record was first recorded","definition":"Represents when this particular CarePlan record was created in the system, which is often a system-generated date.","alias":["authoredOn"],"min":0,"max":"1","base":{"path":"CarePlan.created","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.authoredOn"},{"identity":"w5","map":"FiveWs.recorded"},{"identity":"rim","map":".participation[typeCode=AUT].time"}]},{"id":"CarePlan.author","path":"CarePlan.author","short":"Who is the designated responsible party","definition":"When populated, the author is responsible for the care plan. The care plan is attributed to the author.","comment":"The author may also be a contributor. For example, an organization can be an author, but not listed as a contributor.","min":0,"max":"1","base":{"path":"CarePlan.author","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/CareTeam"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.requester"},{"identity":"w5","map":"FiveWs.author"}]},{"id":"CarePlan.contributor","path":"CarePlan.contributor","short":"Who provided the content of the care plan","definition":"Identifies the individual(s) or organization who provided the contents of the care plan.","comment":"Collaborative care plans may have multiple contributors.","min":0,"max":"*","base":{"path":"CarePlan.contributor","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/CareTeam"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"CarePlan.careTeam","path":"CarePlan.careTeam","short":"Who's involved in plan?","definition":"Identifies all people and organizations who are expected to be involved in the care envisioned by this plan.","requirements":"Allows representation of care teams, helps scope care plan. In some cases may be a determiner of access permissions.","min":0,"max":"*","base":{"path":"CarePlan.careTeam","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CareTeam"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.performer {similar but does not entail CareTeam}"},{"identity":"w5","map":"FiveWs.actor"}]},{"id":"CarePlan.addresses","path":"CarePlan.addresses","short":"Health issues this plan addresses","definition":"Identifies the conditions/problems/concerns/diagnoses/etc. whose management and/or mitigation are handled by this plan.","comment":"When the diagnosis is related to an allergy or intolerance, the Condition and AllergyIntolerance resources can both be used. However, to be actionable for decision support, using Condition alone is not sufficient as the allergy or intolerance condition needs to be represented as an AllergyIntolerance.","requirements":"Links plan to the conditions it manages. The element can identify risks addressed by the plan as well as active conditions. (The Condition resource can include things like \"at risk for hypertension\" or \"fall risk\".) Also scopes plans - multiple plans may exist addressing different concerns.","min":0,"max":"*","base":{"path":"CarePlan.addresses","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Condition"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.reasonReference"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"v2","map":"PRB-4"},{"identity":"rim","map":".actRelationship[typeCode=SUBJ].target[classCode=CONC, moodCode=EVN]"}]},{"id":"CarePlan.supportingInfo","path":"CarePlan.supportingInfo","short":"Information considered as part of plan","definition":"Identifies portions of the patient's record that specifically influenced the formation of the plan. These might include comorbidities, recent procedures, limitations, recent assessments, etc.","comment":"Use \"concern\" to identify specific conditions addressed by the care plan.","requirements":"Identifies barriers and other considerations associated with the care plan.","min":0,"max":"*","base":{"path":"CarePlan.supportingInfo","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.supportingInfo"}]},{"id":"CarePlan.goal","path":"CarePlan.goal","short":"Desired outcome of plan","definition":"Describes the intended objective(s) of carrying out the care plan.","comment":"Goal can be achieving a particular change or merely maintaining a current state or even slowing a decline.","requirements":"Provides context for plan. Allows plan effectiveness to be evaluated by clinicians.","min":0,"max":"*","base":{"path":"CarePlan.goal","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Goal"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"GOL.1"},{"identity":"rim","map":".outboundRelationship[typeCode<=OBJ]."}]},{"id":"CarePlan.activity","path":"CarePlan.activity","short":"Action to occur as part of plan","definition":"Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, self-monitoring, education, etc.","requirements":"Allows systems to prompt for performance of planned activities, and validate plans against best practice.","min":0,"max":"*","base":{"path":"CarePlan.activity","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"cpl-3","severity":"error","human":"Provide a reference or detail, not both","expression":"detail.empty() or reference.empty()","xpath":"not(exists(f:detail)) or not(exists(f:reference))"},{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"{no mapping\nNOTE: This is a list of contained Request-Event tuples!}"},{"identity":"rim","map":".outboundRelationship[typeCode=COMP].target"}]},{"id":"CarePlan.activity.id","path":"CarePlan.activity.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"CarePlan.activity.extension","path":"CarePlan.activity.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"CarePlan.activity.modifierExtension","path":"CarePlan.activity.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"CarePlan.activity.outcomeCodeableConcept","path":"CarePlan.activity.outcomeCodeableConcept","short":"Results of the activity","definition":"Identifies the outcome at the point when the status of the activity is assessed. For example, the outcome of an education activity could be patient understands (or not).","comment":"Note that this should not duplicate the activity status (e.g. completed or in progress).","min":0,"max":"*","base":{"path":"CarePlan.activity.outcomeCodeableConcept","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CarePlanActivityOutcome"}],"strength":"example","description":"Identifies the results of the activity.","valueSet":"http://hl7.org/fhir/ValueSet/care-plan-activity-outcome"}},{"id":"CarePlan.activity.outcomeReference","path":"CarePlan.activity.outcomeReference","short":"Appointment, Encounter, Procedure, etc.","definition":"Details of the outcome or action resulting from the activity. The reference to an \"event\" resource, such as Procedure or Encounter or Observation, is the result/outcome of the activity itself. The activity can be conveyed using CarePlan.activity.detail OR using the CarePlan.activity.reference (a reference to a “request” resource).","comment":"The activity outcome is independent of the outcome of the related goal(s). For example, if the goal is to achieve a target body weight of 150 lbs and an activity is defined to diet, then the activity outcome could be calories consumed whereas the goal outcome is an observation for the actual body weight measured.","requirements":"Links plan to resulting actions.","min":0,"max":"*","base":{"path":"CarePlan.activity.outcomeReference","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"{Event that is outcome of Request in activity.reference}"},{"identity":"rim","map":".inboundRelationship[typeCode=FLFS].source"}]},{"id":"CarePlan.activity.progress","path":"CarePlan.activity.progress","short":"Comments about the activity status/progress","definition":"Notes about the adherence/status/progress of the activity.","comment":"This element should NOT be used to describe the activity to be performed - that occurs either within the resource pointed to by activity.detail.reference or in activity.detail.description.","requirements":"Can be used to capture information about adherence, progress, concerns, etc.","min":0,"max":"*","base":{"path":"CarePlan.activity.progress","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NTE?"},{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"annotation\"].value"}]},{"id":"CarePlan.activity.reference","path":"CarePlan.activity.reference","short":"Activity details defined in specific resource","definition":"The details of the proposed activity represented in a specific resource.","comment":"Standard extension exists ([resource-pertainsToGoal](http://hl7.org/fhir/R4/extension-resource-pertainstogoal.html)) that allows goals to be referenced from any of the referenced resources in CarePlan.activity.reference. \rThe goal should be visible when the resource referenced by CarePlan.activity.reference is viewed independently from the CarePlan. Requests that are pointed to by a CarePlan using this element should *not* point to this CarePlan using the \"basedOn\" element. i.e. Requests that are part of a CarePlan are not \"based on\" the CarePlan.","requirements":"Details in a form consistent with other applications and contexts of use.","min":0,"max":"1","base":{"path":"CarePlan.activity.reference","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Appointment","http://hl7.org/fhir/StructureDefinition/CommunicationRequest","http://hl7.org/fhir/StructureDefinition/DeviceRequest","http://hl7.org/fhir/StructureDefinition/MedicationRequest","http://hl7.org/fhir/StructureDefinition/NutritionOrder","http://hl7.org/fhir/StructureDefinition/Task","http://hl7.org/fhir/StructureDefinition/ServiceRequest","http://hl7.org/fhir/StructureDefinition/VisionPrescription","http://hl7.org/fhir/StructureDefinition/RequestGroup"]}],"condition":["cpl-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"{Request that resulted in Event in activity.actionResulting}"},{"identity":"rim","map":".outboundRelationship[typeCode=COMP].target"}]},{"id":"CarePlan.activity.detail","path":"CarePlan.activity.detail","short":"In-line definition of activity","definition":"A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know about specific resources such as procedure etc.","requirements":"Details in a simple form for generic care plan systems.","min":0,"max":"1","base":{"path":"CarePlan.activity.detail","min":0,"max":"1"},"type":[{"code":"BackboneElement"}],"condition":["cpl-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode=COMP, subsetCode=SUMM].target"}]},{"id":"CarePlan.activity.detail.id","path":"CarePlan.activity.detail.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"CarePlan.activity.detail.extension","path":"CarePlan.activity.detail.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"CarePlan.activity.detail.modifierExtension","path":"CarePlan.activity.detail.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"CarePlan.activity.detail.kind","path":"CarePlan.activity.detail.kind","short":"Appointment | CommunicationRequest | DeviceRequest | MedicationRequest | NutritionOrder | Task | ServiceRequest | VisionPrescription","definition":"A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ServiceRequest, or a CommunicationRequest.","requirements":"May determine what types of extensions are permitted.","min":0,"max":"1","base":{"path":"CarePlan.activity.detail.kind","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CarePlanActivityKind"}],"strength":"required","description":"Resource types defined as part of FHIR that can be represented as in-line definitions of a care plan activity.","valueSet":"http://hl7.org/fhir/ValueSet/care-plan-activity-kind|4.0.1"},"mapping":[{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[classCode=LIST].code"}]},{"id":"CarePlan.activity.detail.instantiatesCanonical","path":"CarePlan.activity.detail.instantiatesCanonical","short":"Instantiates FHIR protocol or definition","definition":"The URL pointing to a FHIR-defined protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan activity.","requirements":"Allows Questionnaires that the patient (or practitioner) should fill in to fulfill the care plan activity.","min":0,"max":"*","base":{"path":"CarePlan.activity.detail.instantiatesCanonical","min":0,"max":"*"},"type":[{"code":"canonical","targetProfile":["http://hl7.org/fhir/StructureDefinition/PlanDefinition","http://hl7.org/fhir/StructureDefinition/ActivityDefinition","http://hl7.org/fhir/StructureDefinition/Questionnaire","http://hl7.org/fhir/StructureDefinition/Measure","http://hl7.org/fhir/StructureDefinition/OperationDefinition"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.instantiatesCanonical"},{"identity":"rim","map":".outboundRelationship[typeCode=DEFN].target"}]},{"id":"CarePlan.activity.detail.instantiatesUri","path":"CarePlan.activity.detail.instantiatesUri","short":"Instantiates external protocol or definition","definition":"The URL pointing to an externally maintained protocol, guideline, questionnaire or other definition that is adhered to in whole or in part by this CarePlan activity.","comment":"This might be an HTML page, PDF, etc. or could just be a non-resolvable URI identifier.","requirements":"Allows Questionnaires that the patient (or practitioner) should fill in to fulfill the care plan activity.","min":0,"max":"*","base":{"path":"CarePlan.activity.detail.instantiatesUri","min":0,"max":"*"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.instantiatesUri"},{"identity":"rim","map":".outboundRelationship[typeCode=DEFN].target"}]},{"id":"CarePlan.activity.detail.code","path":"CarePlan.activity.detail.code","short":"Detail type of activity","definition":"Detailed description of the type of planned activity; e.g. what lab test, what procedure, what kind of encounter.","comment":"Tends to be less relevant for activities involving particular products. Codes should not convey negation - use \"prohibited\" instead.","requirements":"Allows matching performed to planned as well as validation against protocols.","min":0,"max":"1","base":{"path":"CarePlan.activity.detail.code","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CarePlanActivityType"}],"strength":"example","description":"Detailed description of the type of activity; e.g. What lab test, what procedure, what kind of encounter.","valueSet":"http://hl7.org/fhir/ValueSet/procedure-code"},"mapping":[{"identity":"workflow","map":"Request.code"},{"identity":"v2","map":"OBR-4 / RXE-2 / RXO-1 / RXD-2"},{"identity":"rim","map":".code"}]},{"id":"CarePlan.activity.detail.reasonCode","path":"CarePlan.activity.detail.reasonCode","short":"Why activity should be done or why activity was prohibited","definition":"Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited.","comment":"This could be a diagnosis code. If a full condition record exists or additional detail is needed, use reasonCondition instead.","min":0,"max":"*","base":{"path":"CarePlan.activity.detail.reasonCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CarePlanActivityReason"}],"strength":"example","description":"Identifies why a care plan activity is needed. Can include any health condition codes as well as such concepts as \"general wellness\", prophylaxis, surgical preparation, etc.","valueSet":"http://hl7.org/fhir/ValueSet/clinical-findings"},"mapping":[{"identity":"workflow","map":"Request.reasonCode"}]},{"id":"CarePlan.activity.detail.reasonReference","path":"CarePlan.activity.detail.reasonReference","short":"Why activity is needed","definition":"Indicates another resource, such as the health condition(s), whose existence justifies this request and drove the inclusion of this particular activity as part of the plan.","comment":"Conditions can be identified at the activity level that are not identified as reasons for the overall plan.","min":0,"max":"*","base":{"path":"CarePlan.activity.detail.reasonReference","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Condition","http://hl7.org/fhir/StructureDefinition/Observation","http://hl7.org/fhir/StructureDefinition/DiagnosticReport","http://hl7.org/fhir/StructureDefinition/DocumentReference"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.reasonReference"}]},{"id":"CarePlan.activity.detail.goal","path":"CarePlan.activity.detail.goal","short":"Goals this activity relates to","definition":"Internal reference that identifies the goals that this activity is intended to contribute towards meeting.","requirements":"So that participants know the link explicitly.","min":0,"max":"*","base":{"path":"CarePlan.activity.detail.goal","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Goal"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode<=OBJ]."}]},{"id":"CarePlan.activity.detail.status","path":"CarePlan.activity.detail.status","short":"not-started | scheduled | in-progress | on-hold | completed | cancelled | stopped | unknown | entered-in-error","definition":"Identifies what progress is being made for the specific activity.","comment":"Some aspects of status can be inferred based on the resources linked in actionTaken. Note that \"status\" is only as current as the plan was most recently updated. \nThe unknown code is not to be used to convey other statuses. The unknown code should be used when one of the statuses applies, but the authoring system doesn't know the current state of the activity.","requirements":"Indicates progress against the plan, whether the activity is still relevant for the plan.","min":1,"max":"1","base":{"path":"CarePlan.activity.detail.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the activity should not be treated as valid","isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CarePlanActivityStatus"}],"strength":"required","description":"Codes that reflect the current state of a care plan activity within its overall life cycle.","valueSet":"http://hl7.org/fhir/ValueSet/care-plan-activity-status|4.0.1"},"mapping":[{"identity":"workflow","map":"Request.status"},{"identity":"v2","map":"ORC-5?"},{"identity":"rim","map":".statusCode not-started = new scheduled = not-started (and fulfillment relationship to appointent) in-progress = active on-hold = suspended completed = completed cancelled = aborted"}]},{"id":"CarePlan.activity.detail.statusReason","path":"CarePlan.activity.detail.statusReason","short":"Reason for current status","definition":"Provides reason why the activity isn't yet started, is on hold, was cancelled, etc.","comment":"Will generally not be present if status is \"complete\". Be sure to prompt to update this (or at least remove the existing value) if the status is changed.","min":0,"max":"1","base":{"path":"CarePlan.activity.detail.statusReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.statusReason"}]},{"id":"CarePlan.activity.detail.doNotPerform","path":"CarePlan.activity.detail.doNotPerform","short":"If true, activity is prohibiting action","definition":"If true, indicates that the described activity is one that must NOT be engaged in when following the plan. If false, or missing, indicates that the described activity is one that should be engaged in when following the plan.","comment":"This element is labeled as a modifier because it marks an activity as an activity that is not to be performed.","requirements":"Captures intention to not do something that may have been previously typical.","min":0,"max":"1","base":{"path":"CarePlan.activity.detail.doNotPerform","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"If missing indicates that the described activity is one that should be engaged in when following the plan.","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"If true this element negates the specified action. For example, instead of a request for a procedure, it is a request for the procedure to not occur.","isSummary":false,"mapping":[{"identity":"workflow","map":"Request.doNotPerform"},{"identity":"rim","map":"actionNegationInd"}]},{"id":"CarePlan.activity.detail.scheduled[x]","path":"CarePlan.activity.detail.scheduled[x]","short":"When activity is to occur","definition":"The period, timing or frequency upon which the described activity is to occur.","requirements":"Allows prompting for activities and detection of missed planned activities.","min":0,"max":"1","base":{"path":"CarePlan.activity.detail.scheduled[x]","min":0,"max":"1"},"type":[{"code":"Timing"},{"code":"Period"},{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.occurrence[x]"},{"identity":"v2","map":"TQ1"},{"identity":"rim","map":".effectiveTime"}]},{"id":"CarePlan.activity.detail.location","path":"CarePlan.activity.detail.location","short":"Where it should happen","definition":"Identifies the facility where the activity will occur; e.g. home, hospital, specific clinic, etc.","comment":"May reference a specific clinical location or may identify a type of location.","requirements":"Helps in planning of activity.","min":0,"max":"1","base":{"path":"CarePlan.activity.detail.location","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBR-24(???!!)"},{"identity":"rim","map":".participation[typeCode=LOC].role"}]},{"id":"CarePlan.activity.detail.performer","path":"CarePlan.activity.detail.performer","short":"Who will be responsible?","definition":"Identifies who's expected to be involved in the activity.","comment":"A performer MAY also be a participant in the care plan.","requirements":"Helps in planning of activity.","min":0,"max":"*","base":{"path":"CarePlan.activity.detail.performer","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/CareTeam","http://hl7.org/fhir/StructureDefinition/HealthcareService","http://hl7.org/fhir/StructureDefinition/Device"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.performer"},{"identity":"v2","map":"PRT-5 : ( PRV-4 = (provider participations)); PRT-5 : ( PRV-4 = (non-provider person participations )) ; PRT-5 : ( PRV-4 = (patient non-subject of care) ) ; PRT-8"},{"identity":"rim","map":".participation[typeCode=PFM]"}]},{"id":"CarePlan.activity.detail.product[x]","path":"CarePlan.activity.detail.product[x]","short":"What is to be administered/supplied","definition":"Identifies the food, drug or other product to be consumed or supplied in the activity.","min":0,"max":"1","base":{"path":"CarePlan.activity.detail.product[x]","min":0,"max":"1"},"type":[{"code":"CodeableConcept"},{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Medication","http://hl7.org/fhir/StructureDefinition/Substance"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CarePlanProduct"}],"strength":"example","description":"A product supplied or administered as part of a care plan activity.","valueSet":"http://hl7.org/fhir/ValueSet/medication-codes"},"mapping":[{"identity":"v2","map":"RXE-2 / RXO-1 / RXD-2"},{"identity":"rim","map":".participation[typeCode=PRD].role"}]},{"id":"CarePlan.activity.detail.dailyAmount","path":"CarePlan.activity.detail.dailyAmount","short":"How to consume/day?","definition":"Identifies the quantity expected to be consumed in a given day.","requirements":"Allows rough dose checking.","alias":["daily dose"],"min":0,"max":"1","base":{"path":"CarePlan.activity.detail.dailyAmount","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"RXO-23 / RXE-19 / RXD-12"},{"identity":"rim","map":".outboundRelationship[typeCode=COMP][classCode=SBADM].doseQuantity"}]},{"id":"CarePlan.activity.detail.quantity","path":"CarePlan.activity.detail.quantity","short":"How much to administer/supply/consume","definition":"Identifies the quantity expected to be supplied, administered or consumed by the subject.","min":0,"max":"1","base":{"path":"CarePlan.activity.detail.quantity","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"RXO-11 / RXE-10 / RXD-4 / RXG-5 / RXA-6 / TQ1-2.1 *and* RXO-12 / RXE-11 / RXD-5 / RXG-7 / RXA-7 / TQ1-2.2"},{"identity":"rim","map":".outboundRelationship[typeCode=COMP][classCode=SPLY].quantity"}]},{"id":"CarePlan.activity.detail.description","path":"CarePlan.activity.detail.description","short":"Extra info describing activity to perform","definition":"This provides a textual description of constraints on the intended activity occurrence, including relation to other activities. It may also include objectives, pre-conditions and end-conditions. Finally, it may convey specifics about the activity such as body site, method, route, etc.","min":0,"max":"1","base":{"path":"CarePlan.activity.detail.description","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NTE?"},{"identity":"rim","map":".text"}]},{"id":"CarePlan.note","path":"CarePlan.note","short":"Comments about the plan","definition":"General notes about the care plan not covered elsewhere.","requirements":"Used to capture information that applies to the plan as a whole that doesn't fit into discrete elements.","min":0,"max":"*","base":{"path":"CarePlan.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.note"},{"identity":"v2","map":"NTE?"},{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"annotation\"].value"}]}]},"differential":{"element":[{"id":"CarePlan","path":"CarePlan","definition":"The US Core CarePlan Profile is based upon the core FHIR CarePlan Resource and created to meet the 2015 Edition Common Clinical Data Set 'Assessment and Plan of Treatment requirements.","mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan"}]},{"id":"CarePlan.text","path":"CarePlan.text","min":1,"max":"1","type":[{"code":"Narrative"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.text"}]},{"id":"CarePlan.text.status","path":"CarePlan.text.status","definition":"generated | additional.","type":[{"code":"code"}],"mustSupport":true,"binding":{"strength":"required","description":"Constrained value set of narrative statuses.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-narrative-status"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.text.status"}]},{"id":"CarePlan.status","path":"CarePlan.status","requirements":"Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true,"binding":{"strength":"required","description":"Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.","valueSet":"http://hl7.org/fhir/ValueSet/request-status"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.status"}]},{"id":"CarePlan.intent","path":"CarePlan.intent","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true,"binding":{"strength":"required","description":"Codes indicating the degree of authority/intentionality associated with a care plan","valueSet":"http://hl7.org/fhir/ValueSet/care-plan-intent"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA (new element in STU3)"}]},{"id":"CarePlan.category","path":"CarePlan.category","slicing":{"discriminator":[{"type":"pattern","path":"$this"}],"rules":"open"},"definition":"Type of plan.","requirements":"Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.","min":1,"max":"*","type":[{"code":"CodeableConcept"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.category"}]},{"id":"CarePlan.category:AssessPlan","path":"CarePlan.category","sliceName":"AssessPlan","definition":"Type of plan.","requirements":"Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://hl7.org/fhir/us/core/CodeSystem/careplan-category","code":"assess-plan"}]},"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.category"}]},{"id":"CarePlan.subject","path":"CarePlan.subject","definition":"Who care plan is for.","requirements":"Identifies the patient or group whose intended care is described by the plan.","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.subject"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-careteam.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-careteam.json new file mode 100755 index 000000000..f320efd3b --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-careteam.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-careteam","text":{"status":"generated","div":""},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam","version":"3.1.0","name":"USCoreCareTeam","title":"US Core CareTeam Profile","status":"active","experimental":false,"date":"2019-08-26T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the CareTeam resource for the minimal set of data to query and retrieve a patient's Care Team.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"resource","abstract":false,"type":"CareTeam","baseDefinition":"http://hl7.org/fhir/StructureDefinition/CareTeam","derivation":"constraint","snapshot":{"element":[{"id":"CareTeam","path":"CareTeam","short":"Planned participants in the coordination and delivery of care for a patient or group","definition":"The US Core CareTeam Profile is based upon the core FHIR CareTeam Resource and created to meet the 2015 Edition Common Clinical Data Set 'Care team member(s)' requirements.","min":0,"max":"*","base":{"path":"CareTeam","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"argonaut-dq-dstu2","map":"CarePlan"}]},{"id":"CareTeam.id","path":"CareTeam.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"CareTeam.meta","path":"CareTeam.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"CareTeam.implicitRules","path":"CareTeam.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"CareTeam.language","path":"CareTeam.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"CareTeam.text","path":"CareTeam.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"CareTeam.contained","path":"CareTeam.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"CareTeam.extension","path":"CareTeam.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"CareTeam.modifierExtension","path":"CareTeam.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"CareTeam.identifier","path":"CareTeam.identifier","short":"External Ids for this team","definition":"Business identifiers assigned to this care team by the performer or other systems which remain constant as the resource is updated and propagates from server to server.","comment":"This is a business identifier, not a resource identifier (see [discussion](http://hl7.org/fhir/R4/resource.html#identifiers)). It is best practice for the identifier to only appear on a single resource instance, however business practices may occasionally dictate that multiple resource instances with the same identifier can exist - possibly even with different resource types. For example, multiple Patient and a Person resource instance might share the same social insurance number.","requirements":"Allows identification of the care team as it is known by various participating systems and in a way that remains consistent across servers.","min":0,"max":"*","base":{"path":"CareTeam.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"}]},{"id":"CareTeam.status","path":"CareTeam.status","short":"proposed | active | suspended | inactive | entered-in-error","definition":"Indicates the current state of the care team.","comment":"This element is labeled as a modifier because the status contains the code entered-in-error that marks the care team as not currently valid.","min":0,"max":"1","base":{"path":"CareTeam.status","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","description":"Indicates whether the team is current , represents future intentions or is now a historical record.","valueSet":"http://hl7.org/fhir/ValueSet/care-team-status"},"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.status"}]},{"id":"CareTeam.category","path":"CareTeam.category","short":"Type of team","definition":"Identifies what kind of team. This is to support differentiation between multiple co-existing teams, such as care plan team, episode of care team, longitudinal care team.","comment":"There may be multiple axis of categorization and one team may serve multiple purposes.","requirements":"Used for filtering what teams(s) are retrieved and displayed to different types of users.","min":0,"max":"*","base":{"path":"CareTeam.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CareTeamCategory"}],"strength":"example","description":"Indicates the type of care team.","valueSet":"http://hl7.org/fhir/ValueSet/care-team-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"}]},{"id":"CareTeam.name","path":"CareTeam.name","short":"Name of the team, such as crisis assessment team","definition":"A label for human use intended to distinguish like teams. E.g. the \"red\" vs. \"green\" trauma teams.","comment":"The meaning/purpose of the team is conveyed in CareTeam.category. This element may also convey semantics of the team (e.g. \"Red trauma team\"), but its primary purpose is to distinguish between identical teams in a human-friendly way. (\"Team 18735\" isn't as friendly.).","min":0,"max":"1","base":{"path":"CareTeam.name","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"CareTeam.subject","path":"CareTeam.subject","short":"Who care team is for","definition":"Identifies the patient or group whose intended care is handled by the team.","requirements":"Allows the team to care for a group (e.g. marriage) therapy. \nAllows for an organization to designate a team such as the PICC line team.","alias":["patient"],"min":1,"max":"1","base":{"path":"CareTeam.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"w5","map":"FiveWs.subject"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.subject"}]},{"id":"CareTeam.encounter","path":"CareTeam.encounter","short":"Encounter created as part of","definition":"The Encounter during which this CareTeam was created or to which the creation of this record is tightly associated.","comment":"This will typically be the encounter the event occurred within, but some activities may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter.","min":0,"max":"1","base":{"path":"CareTeam.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.context"}]},{"id":"CareTeam.period","path":"CareTeam.period","short":"Time period team covers","definition":"Indicates when the team did (or is intended to) come into effect and end.","requirements":"Allows tracking what team(s) are in effect at a particular time.","min":0,"max":"1","base":{"path":"CareTeam.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.init"}]},{"id":"CareTeam.participant","path":"CareTeam.participant","short":"Members of the team","definition":"Identifies all people and organizations who are expected to be involved in the care team.","min":1,"max":"*","base":{"path":"CareTeam.participant","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"condition":["ctm-1"],"constraint":[{"key":"ctm-1","severity":"error","human":"CareTeam.participant.onBehalfOf can only be populated when CareTeam.participant.member is a Practitioner","expression":"onBehalfOf.exists() implies (member.resolve().iif(empty(), true, ofType(Practitioner).exists()))","xpath":"starts-with(f:member/f:reference/@value, 'Practitioner/') or contains(f:member/f:reference/@value, '/Practitioner/') or exists(ancestor::*/f:contains/f:Practitioner/f:id[@value=substring-after(current()/f:member/f:reference/@value, '#')]) or not(exists(f:onBehalfOf))","source":"http://hl7.org/fhir/StructureDefinition/CareTeam"},{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"REL (REL.4 is always the Patient) ( or PRT?)"},{"identity":"rim","map":".participation[typeCode=PRF]"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.participant"}]},{"id":"CareTeam.participant.id","path":"CareTeam.participant.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"CareTeam.participant.extension","path":"CareTeam.participant.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"CareTeam.participant.modifierExtension","path":"CareTeam.participant.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"CareTeam.participant.role","path":"CareTeam.participant.role","short":"Type of involvement","definition":"Indicates specific responsibility of an individual within the care team, such as \"Primary care physician\", \"Trained social worker counselor\", \"Caregiver\", etc.","comment":"Roles may sometimes be inferred by type of Practitioner. These are relationships that hold only within the context of the care team. General relationships should be handled as properties of the Patient resource directly.","min":1,"max":"1","base":{"path":"CareTeam.participant.role","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Indicates specific responsibility of an individual within the care team, such as Primary physician, Team coordinator, Caregiver, etc.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-careteam-provider-roles"},"mapping":[{"identity":"v2","map":"REL.2 (or PRT-4?)"},{"identity":"rim","map":".functionCode"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.participant.role"}]},{"id":"CareTeam.participant.member","path":"CareTeam.participant.member","short":"Who is involved","definition":"The specific person or organization who is participating/expected to participate in the care team.","comment":"Patient only needs to be listed if they have a role other than \"subject of care\".\n\nMember is optional because some participants may be known only by their role, particularly in draft plans.","min":1,"max":"1","base":{"path":"CareTeam.participant.member","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"REL.5 (or PRT-5 : ( PRV-4 {provider participations} ) / PRT-5 : ( PRV-4 {non-provider person participations} ) / PRT-5 : ( PRV-4 = (patient non-subject of care) ) / PRT-8?)"},{"identity":"rim","map":".role"},{"identity":"argonaut-dq-dstu2","map":"CarePlan.participant.member"}]},{"id":"CareTeam.participant.onBehalfOf","path":"CareTeam.participant.onBehalfOf","short":"Organization of the practitioner","definition":"The organization of the practitioner.","requirements":"Practitioners can be associated with multiple organizations. This element indicates which organization they were acting on behalf of.","min":0,"max":"1","base":{"path":"CareTeam.participant.onBehalfOf","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"CareTeam.participant.period","path":"CareTeam.participant.period","short":"Time period of participant","definition":"Indicates when the specific member or organization did (or is intended to) come into effect and end.","min":0,"max":"1","base":{"path":"CareTeam.participant.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"CareTeam.reasonCode","path":"CareTeam.reasonCode","short":"Why the care team exists","definition":"Describes why the care team exists.","min":0,"max":"*","base":{"path":"CareTeam.reasonCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"CareTeamReason"}],"strength":"example","description":"Indicates the reason for the care team.","valueSet":"http://hl7.org/fhir/ValueSet/clinical-findings"},"mapping":[{"identity":"w5","map":"FiveWs.why[x]"}]},{"id":"CareTeam.reasonReference","path":"CareTeam.reasonReference","short":"Why the care team exists","definition":"Condition(s) that this care team addresses.","min":0,"max":"*","base":{"path":"CareTeam.reasonReference","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Condition"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.why[x]"}]},{"id":"CareTeam.managingOrganization","path":"CareTeam.managingOrganization","short":"Organization responsible for the care team","definition":"The organization responsible for the care team.","requirements":"Allows for multiple organizations to collaboratively manage cross-organizational, longitudinal care plan.","min":0,"max":"*","base":{"path":"CareTeam.managingOrganization","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"CareTeam.telecom","path":"CareTeam.telecom","short":"A contact detail for the care team (that applies to all members)","definition":"A central contact detail for the care team (that applies to all members).","comment":"The ContactPoint.use code of home is not appropriate to use. These contacts are not the contact details of individual care team members.","min":0,"max":"*","base":{"path":"CareTeam.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"CareTeam.note","path":"CareTeam.note","short":"Comments made about the CareTeam","definition":"Comments made about the CareTeam.","min":0,"max":"*","base":{"path":"CareTeam.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false}]},"differential":{"element":[{"id":"CareTeam","path":"CareTeam","definition":"The US Core CareTeam Profile is based upon the core FHIR CareTeam Resource and created to meet the 2015 Edition Common Clinical Data Set 'Care team member(s)' requirements.","mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan"}]},{"id":"CareTeam.status","path":"CareTeam.status","min":0,"max":"1","type":[{"code":"code"}],"mustSupport":true,"binding":{"strength":"required","description":"Indicates whether the team is current , represents future intentions or is now a historical record.","valueSet":"http://hl7.org/fhir/ValueSet/care-team-status"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.status"}]},{"id":"CareTeam.subject","path":"CareTeam.subject","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.subject"}]},{"id":"CareTeam.participant","path":"CareTeam.participant","min":1,"max":"*","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.participant"}]},{"id":"CareTeam.participant.role","path":"CareTeam.participant.role","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","description":"Indicates specific responsibility of an individual within the care team, such as Primary physician, Team coordinator, Caregiver, etc.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-careteam-provider-roles"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.participant.role"}]},{"id":"CareTeam.participant.member","path":"CareTeam.participant.member","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"CarePlan.participant.member"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-condition.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-condition.json new file mode 100755 index 000000000..5a5b2d107 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-condition.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-condition","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Condition I0..*us-core-1: A code in Condition.category SHOULD be from US Core Condition Category Codes value set.
    \".\"\".\"\".\" clinicalStatus S0..1CodeableConceptBinding: ConditionClinicalStatusCodes (required)
    \".\"\".\"\".\" verificationStatus S0..1CodeableConceptBinding: ConditionVerificationStatus (required)
    \".\"\".\"\".\" category SI1..*CodeableConceptproblem-list-item | encounter-diagnosis | health-concern
    Binding: US Core Condition Category Codes (extensible)
    \".\"\".\"\".\" code S1..1CodeableConceptBinding: US Core Condition Code (extensible)
    \".\"\".\"\".\" subject S1..1Reference(US Core Patient Profile)

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition","version":"3.1.0","name":"USCoreCondition","title":"US Core Condition Profile","status":"active","experimental":false,"date":"2019-10-24T00:00:00+11:00","publisher":"Health Level Seven International (Infrastructure and Messaging - Data Access Framework)","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Condition resource for the minimal set of data to query and retrieve problems and health concerns information.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"sct-concept","uri":"http://snomed.info/conceptdomain","name":"SNOMED CT Concept Domain Binding"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"sct-attr","uri":"http://snomed.org/attributebinding","name":"SNOMED CT Attribute Binding"}],"kind":"resource","abstract":false,"type":"Condition","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Condition","derivation":"constraint","snapshot":{"element":[{"id":"Condition","path":"Condition","short":"Detailed information about conditions, problems or diagnoses","definition":"The US Core Condition Profile is based upon the core FHIR Condition Resource and created to meet the 2015 Edition Common Clinical Data Set 'Problems' and 'Health Concerns' requirements.","min":0,"max":"*","base":{"path":"Condition","min":0,"max":"*"},"constraint":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"Most systems will expect a clinicalStatus to be valued for problem-list-items that are managed over time, but might not need a clinicalStatus for point in time encounter-diagnosis."}],"key":"con-3","severity":"warning","human":"Condition.clinicalStatus SHALL be present if verificationStatus is not entered-in-error and category is problem-list-item","expression":"clinicalStatus.exists() or verificationStatus.coding.where(system='http://terminology.hl7.org/CodeSystem/condition-ver-status' and code = 'entered-in-error').exists() or category.select($this='problem-list-item').empty()","xpath":"exists(f:clinicalStatus) or exists(f:verificationStatus/f:coding/f:code/@value='entered-in-error') or not(exists(category[@value='problem-list-item']))","source":"http://hl7.org/fhir/StructureDefinition/Condition"},{"key":"con-4","severity":"error","human":"If condition is abated, then clinicalStatus must be either inactive, resolved, or remission","expression":"abatement.empty() or clinicalStatus.coding.where(system='http://terminology.hl7.org/CodeSystem/condition-clinical' and (code='resolved' or code='remission' or code='inactive')).exists()","xpath":"not(exists(*[starts-with(local-name(.), 'abatement')])) or exists(f:clinicalStatus/f:coding[f:system/@value='http://terminology.hl7.org/CodeSystem/condition-clinical' and f:code/@value=('resolved', 'remission', 'inactive')])","source":"http://hl7.org/fhir/StructureDefinition/Condition"},{"key":"con-5","severity":"error","human":"Condition.clinicalStatus SHALL NOT be present if verification Status is entered-in-error","expression":"verificationStatus.coding.where(system='http://terminology.hl7.org/CodeSystem/condition-ver-status' and code='entered-in-error').empty() or clinicalStatus.empty()","xpath":"not(exists(f:verificationStatus/f:coding[f:system/@value='http://terminology.hl7.org/CodeSystem/condition-ver-status' and f:code/@value='entered-in-error'])) or not(exists(f:clinicalStatus))","source":"http://hl7.org/fhir/StructureDefinition/Condition"},{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true}],"key":"us-core-1","severity":"warning","human":"A code in Condition.category SHOULD be from US Core Condition Category Codes value set.","expression":"where(category in 'http://hl7.org/fhir/us/core/ValueSet/us-core-condition-category').exists()","xpath":"(no xpath equivalent)"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"sct-concept","map":"< 243796009 |Situation with explicit context| : 246090004 |Associated finding| = ( ( < 404684003 |Clinical finding| MINUS ( << 420134006 |Propensity to adverse reactions| OR << 473010000 |Hypersensitivity condition| OR << 79899007 |Drug interaction| OR << 69449002 |Drug action| OR << 441742003 |Evaluation finding| OR << 307824009 |Administrative status| OR << 385356007 |Tumor stage finding|)) OR < 272379006 |Event|)"},{"identity":"v2","map":"PPR message"},{"identity":"rim","map":"Observation[classCode=OBS, moodCode=EVN, code=ASSERTION, value id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Condition.implicitRules","path":"Condition.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Condition.language","path":"Condition.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Condition.text","path":"Condition.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Condition.contained","path":"Condition.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Condition.extension","path":"Condition.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Condition.modifierExtension","path":"Condition.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Condition.identifier","path":"Condition.identifier","short":"External Ids for this condition","definition":"Business identifiers assigned to this condition by the performer or other systems which remain constant as the resource is updated and propagates from server to server.","comment":"This is a business identifier, not a resource identifier (see [discussion](http://hl7.org/fhir/R4/resource.html#identifiers)). It is best practice for the identifier to only appear on a single resource instance, however business practices may occasionally dictate that multiple resource instances with the same identifier can exist - possibly even with different resource types. For example, multiple Patient and a Person resource instance might share the same social insurance number.","requirements":"Allows identification of the condition as it is known by various participating systems and in a way that remains consistent across servers.","min":0,"max":"*","base":{"path":"Condition.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"rim","map":".id"}]},{"id":"Condition.clinicalStatus","path":"Condition.clinicalStatus","short":"active | recurrence | relapse | inactive | remission | resolved","definition":"The clinical status of the condition.","comment":"The data type is CodeableConcept because clinicalStatus has some clinical judgment involved, such that there might need to be more specificity than the required FHIR value set allows. For example, a SNOMED coding might allow for additional specificity.","min":0,"max":"1","base":{"path":"Condition.clinicalStatus","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["con-3","con-4","con-5"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the status contains codes that mark the condition as no longer active.","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/condition-clinical"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"sct-concept","map":"< 303105007 |Disease phases|"},{"identity":"v2","map":"PRB-14"},{"identity":"rim","map":"Observation ACT\n.inboundRelationship[typeCode=COMP].source[classCode=OBS, code=\"clinicalStatus\", moodCode=EVN].value"},{"identity":"argonaut-dq-dstu2","map":"Condition.clinicalStatus"}]},{"id":"Condition.verificationStatus","path":"Condition.verificationStatus","short":"unconfirmed | provisional | differential | confirmed | refuted | entered-in-error","definition":"The verification status to support the clinical status of the condition.","comment":"verificationStatus is not required. For example, when a patient has abdominal pain in the ED, there is not likely going to be a verification status.\nThe data type is CodeableConcept because verificationStatus has some clinical judgment involved, such that there might need to be more specificity than the required FHIR value set allows. For example, a SNOMED coding might allow for additional specificity.","min":0,"max":"1","base":{"path":"Condition.verificationStatus","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["con-3","con-5"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the status contains the code refuted and entered-in-error that mark the Condition as not currently valid.","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/condition-ver-status"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"sct-concept","map":"< 410514004 |Finding context value|"},{"identity":"v2","map":"PRB-13"},{"identity":"rim","map":"Observation ACT\n.inboundRelationship[typeCode=COMP].source[classCode=OBS, code=\"verificationStatus\", moodCode=EVN].value"},{"identity":"sct-attr","map":"408729009"},{"identity":"argonaut-dq-dstu2","map":"Condition.verificationStatus"}]},{"id":"Condition.category","path":"Condition.category","short":"problem-list-item | encounter-diagnosis | health-concern","definition":"A category assigned to the condition.","comment":"The categorization is often highly contextual and may appear poorly differentiated or not very useful in other contexts.","min":1,"max":"*","base":{"path":"Condition.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"condition":["us-core-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-condition-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"sct-concept","map":"< 404684003 |Clinical finding|"},{"identity":"v2","map":"'problem' if from PRB-3. 'diagnosis' if from DG1 segment in PV1 message"},{"identity":"rim","map":".code"},{"identity":"argonaut-dq-dstu2","map":"Condition.category"}]},{"id":"Condition.severity","path":"Condition.severity","short":"Subjective severity of condition","definition":"A subjective assessment of the severity of the condition as evaluated by the clinician.","comment":"Coding of the severity with a terminology is preferred, where possible.","min":0,"max":"1","base":{"path":"Condition.severity","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ConditionSeverity"}],"strength":"preferred","description":"A subjective assessment of the severity of the condition as evaluated by the clinician.","valueSet":"http://hl7.org/fhir/ValueSet/condition-severity"},"mapping":[{"identity":"w5","map":"FiveWs.grade"},{"identity":"sct-concept","map":"< 272141005 |Severities|"},{"identity":"v2","map":"PRB-26 / ABS-3"},{"identity":"rim","map":"Can be pre/post-coordinated into value. Or ./inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"severity\"].value"},{"identity":"sct-attr","map":"246112005"}]},{"id":"Condition.code","path":"Condition.code","short":"Identification of the condition, problem or diagnosis","definition":"Identification of the condition, problem or diagnosis.","requirements":"0..1 to account for primarily narrative only resources.","alias":["type"],"min":1,"max":"1","base":{"path":"Condition.code","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Valueset to describe the actual problem experienced by the patient","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-condition-code"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"code 246090004 |Associated finding| (< 404684003 |Clinical finding| MINUS\n<< 420134006 |Propensity to adverse reactions| MINUS \n<< 473010000 |Hypersensitivity condition| MINUS \n<< 79899007 |Drug interaction| MINUS\n<< 69449002 |Drug action| MINUS \n<< 441742003 |Evaluation finding| MINUS \n<< 307824009 |Administrative status| MINUS \n<< 385356007 |Tumor stage finding|) \nOR < 413350009 |Finding with explicit context|\nOR < 272379006 |Event|"},{"identity":"v2","map":"PRB-3"},{"identity":"rim","map":".value"},{"identity":"sct-attr","map":"246090004"},{"identity":"argonaut-dq-dstu2","map":"Condition.code"}]},{"id":"Condition.bodySite","path":"Condition.bodySite","short":"Anatomical location, if relevant","definition":"The anatomical location where this condition manifests itself.","comment":"Only used if not implicit in code found in Condition.code. If the use case requires attributes from the BodySite resource (e.g. to identify and track separately) then use the standard extension [bodySite](http://hl7.org/fhir/R4/extension-bodysite.html). May be a summary code, or a reference to a very precise definition of the location, or both.","min":0,"max":"*","base":{"path":"Condition.bodySite","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BodySite"}],"strength":"example","description":"Codes describing anatomical locations. May include laterality.","valueSet":"http://hl7.org/fhir/ValueSet/body-site"},"mapping":[{"identity":"sct-concept","map":"< 442083009 |Anatomical or acquired body structure|"},{"identity":"rim","map":".targetBodySiteCode"},{"identity":"sct-attr","map":"363698007"}]},{"id":"Condition.subject","path":"Condition.subject","short":"Who has the condition?","definition":"Indicates the patient or group who the condition record is associated with.","requirements":"Group is typically used for veterinary or public health use cases.","alias":["patient"],"min":1,"max":"1","base":{"path":"Condition.subject","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":".participation[typeCode=SBJ].role[classCode=PAT]"},{"identity":"w5","map":"FiveWs.subject"},{"identity":"argonaut-dq-dstu2","map":"Condition.patient"}]},{"id":"Condition.encounter","path":"Condition.encounter","short":"Encounter created as part of","definition":"The Encounter during which this Condition was created or to which the creation of this record is tightly associated.","comment":"This will typically be the encounter the event occurred within, but some activities may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter. This record indicates the encounter this particular record is associated with. In the case of a \"new\" diagnosis reflecting ongoing/revised information about the condition, this might be distinct from the first encounter in which the underlying condition was first \"known\".","min":0,"max":"1","base":{"path":"Condition.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1-19 (+PV1-54)"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN]"}]},{"id":"Condition.onset[x]","path":"Condition.onset[x]","short":"Estimated or actual date, date-time, or age","definition":"Estimated or actual date or date-time the condition began, in the opinion of the clinician.","comment":"Age is generally used when the patient reports an age at which the Condition began to occur.","min":0,"max":"1","base":{"path":"Condition.onset[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Age"},{"code":"Period"},{"code":"Range"},{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.init"},{"identity":"v2","map":"PRB-16"},{"identity":"rim","map":".effectiveTime.low or .inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"age at onset\"].value"}]},{"id":"Condition.abatement[x]","path":"Condition.abatement[x]","short":"When in resolution/remission","definition":"The date or estimated date that the condition resolved or went into remission. This is called \"abatement\" because of the many overloaded connotations associated with \"remission\" or \"resolution\" - Conditions are never really resolved, but they can abate.","comment":"There is no explicit distinction between resolution and remission because in many cases the distinction is not clear. Age is generally used when the patient reports an age at which the Condition abated. If there is no abatement element, it is unknown whether the condition has resolved or entered remission; applications and users should generally assume that the condition is still valid. When abatementString exists, it implies the condition is abated.","min":0,"max":"1","base":{"path":"Condition.abatement[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Age"},{"code":"Period"},{"code":"Range"},{"code":"string"}],"condition":["con-4"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"rim","map":".effectiveTime.high or .inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"age at remission\"].value or .inboundRelationship[typeCode=SUBJ]source[classCode=CONC, moodCode=EVN].status=completed"}]},{"id":"Condition.recordedDate","path":"Condition.recordedDate","short":"Date record was first recorded","definition":"The recordedDate represents when this particular Condition record was created in the system, which is often a system-generated date.","min":0,"max":"1","base":{"path":"Condition.recordedDate","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"v2","map":"REL-11"},{"identity":"rim","map":".participation[typeCode=AUT].time"}]},{"id":"Condition.recorder","path":"Condition.recorder","short":"Who recorded the condition","definition":"Individual who recorded the record and takes responsibility for its content.","min":0,"max":"1","base":{"path":"Condition.recorder","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.author"},{"identity":"rim","map":".participation[typeCode=AUT].role"}]},{"id":"Condition.asserter","path":"Condition.asserter","short":"Person who asserts this condition","definition":"Individual who is making the condition statement.","min":0,"max":"1","base":{"path":"Condition.asserter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.source"},{"identity":"v2","map":"REL-7.1 identifier + REL-7.12 type code"},{"identity":"rim","map":".participation[typeCode=INF].role"}]},{"id":"Condition.stage","path":"Condition.stage","short":"Stage/grade, usually assessed formally","definition":"Clinical stage or grade of a condition. May include formal severity assessments.","min":0,"max":"*","base":{"path":"Condition.stage","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"con-1","severity":"error","human":"Stage SHALL have summary or assessment","expression":"summary.exists() or assessment.exists()","xpath":"exists(f:summary) or exists(f:assessment)"},{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"./inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"stage/grade\"]"}]},{"id":"Condition.stage.id","path":"Condition.stage.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Condition.stage.extension","path":"Condition.stage.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Condition.stage.modifierExtension","path":"Condition.stage.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Condition.stage.summary","path":"Condition.stage.summary","short":"Simple summary (disease specific)","definition":"A simple summary of the stage such as \"Stage 3\". The determination of the stage is disease-specific.","min":0,"max":"1","base":{"path":"Condition.stage.summary","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["con-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ConditionStage"}],"strength":"example","description":"Codes describing condition stages (e.g. Cancer stages).","valueSet":"http://hl7.org/fhir/ValueSet/condition-stage"},"mapping":[{"identity":"sct-concept","map":"< 254291000 |Staging and scales|"},{"identity":"v2","map":"PRB-14"},{"identity":"rim","map":".value"}]},{"id":"Condition.stage.assessment","path":"Condition.stage.assessment","short":"Formal record of assessment","definition":"Reference to a formal record of the evidence on which the staging assessment is based.","min":0,"max":"*","base":{"path":"Condition.stage.assessment","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/ClinicalImpression","http://hl7.org/fhir/StructureDefinition/DiagnosticReport","http://hl7.org/fhir/StructureDefinition/Observation"]}],"condition":["con-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".self"}]},{"id":"Condition.stage.type","path":"Condition.stage.type","short":"Kind of staging","definition":"The kind of staging, such as pathological or clinical staging.","min":0,"max":"1","base":{"path":"Condition.stage.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ConditionStageType"}],"strength":"example","description":"Codes describing the kind of condition staging (e.g. clinical or pathological).","valueSet":"http://hl7.org/fhir/ValueSet/condition-stage-type"},"mapping":[{"identity":"rim","map":"./inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"stage type\"]"}]},{"id":"Condition.evidence","path":"Condition.evidence","short":"Supporting evidence","definition":"Supporting evidence / manifestations that are the basis of the Condition's verification status, such as evidence that confirmed or refuted the condition.","comment":"The evidence may be a simple list of coded symptoms/manifestations, or references to observations or formal assessments, or both.","min":0,"max":"*","base":{"path":"Condition.evidence","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"con-2","severity":"error","human":"evidence SHALL have code or details","expression":"code.exists() or detail.exists()","xpath":"exists(f:code) or exists(f:detail)"},{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode=SPRT].target[classCode=OBS, moodCode=EVN]"}]},{"id":"Condition.evidence.id","path":"Condition.evidence.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Condition.evidence.extension","path":"Condition.evidence.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Condition.evidence.modifierExtension","path":"Condition.evidence.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Condition.evidence.code","path":"Condition.evidence.code","short":"Manifestation/symptom","definition":"A manifestation or symptom that led to the recording of this condition.","min":0,"max":"*","base":{"path":"Condition.evidence.code","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"condition":["con-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ManifestationOrSymptom"}],"strength":"example","description":"Codes that describe the manifestation or symptoms of a condition.","valueSet":"http://hl7.org/fhir/ValueSet/manifestation-or-symptom"},"mapping":[{"identity":"workflow","map":"Event.reasonCode"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"sct-concept","map":"< 404684003 |Clinical finding|"},{"identity":"rim","map":"[code=\"diagnosis\"].value"}]},{"id":"Condition.evidence.detail","path":"Condition.evidence.detail","short":"Supporting information found elsewhere","definition":"Links to other relevant information, including pathology reports.","min":0,"max":"*","base":{"path":"Condition.evidence.detail","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"condition":["con-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"rim","map":".self"}]},{"id":"Condition.note","path":"Condition.note","short":"Additional information about the Condition","definition":"Additional information about the Condition. This is a general notes/comments entry for description of the Condition, its diagnosis and prognosis.","min":0,"max":"*","base":{"path":"Condition.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.note"},{"identity":"v2","map":"NTE child of PRB"},{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"annotation\"].value"}]}]},"differential":{"element":[{"id":"Condition","path":"Condition","definition":"The US Core Condition Profile is based upon the core FHIR Condition Resource and created to meet the 2015 Edition Common Clinical Data Set 'Problems' and 'Health Concerns' requirements.","constraint":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true}],"key":"us-core-1","severity":"warning","human":"A code in Condition.category SHOULD be from US Core Condition Category Codes value set.","expression":"where(category in 'http://hl7.org/fhir/us/core/ValueSet/us-core-condition-category').exists()","xpath":"(no xpath equivalent)"}],"mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Condition"}]},{"id":"Condition.clinicalStatus","path":"Condition.clinicalStatus","min":0,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/condition-clinical"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Condition.clinicalStatus"}]},{"id":"Condition.verificationStatus","path":"Condition.verificationStatus","min":0,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/condition-ver-status"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Condition.verificationStatus"}]},{"id":"Condition.category","path":"Condition.category","short":"problem-list-item | encounter-diagnosis | health-concern","min":1,"max":"*","type":[{"code":"CodeableConcept"}],"condition":["us-core-1"],"mustSupport":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-condition-category"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Condition.category"}]},{"id":"Condition.code","path":"Condition.code","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","description":"Valueset to describe the actual problem experienced by the patient","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-condition-code"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Condition.code"}]},{"id":"Condition.subject","path":"Condition.subject","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Condition.patient"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-diagnosticreport-lab.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-diagnosticreport-lab.json new file mode 100755 index 000000000..7c653da0d --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-diagnosticreport-lab.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-diagnosticreport-lab","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" DiagnosticReport 0..*
    \".\"\".\"\".\" status S1..1codeBinding: DiagnosticReportStatus (required)
    \".\"\".\"\".\" category S1..*(Slice Definition)Slice: Unordered, Open by pattern:$this
    \".\"\".\"\".\"\".\" category:LaboratorySlice S1..1CodeableConceptRequired Pattern: At least the following
    \".\"\".\"\".\"\".\"\".\" coding1..*CodingCode defined by a terminology system
    Fixed Value: (complex)
    \".\"\".\"\".\"\".\"\".\"\".\" system1..1uriIdentity of the terminology system
    Fixed Value: http://terminology.hl7.org/CodeSystem/v2-0074
    \".\"\".\"\".\"\".\"\".\"\".\" code1..1codeSymbol in syntax defined by the system
    Fixed Value: LAB
    \".\"\".\"\".\" code S1..1CodeableConceptUS Core Laboratory Report Order Code
    Binding: US Core Diagnostic Report Laboratory Codes (extensible)
    \".\"\".\"\".\" subject S1..1Reference(US Core Patient Profile)
    \".\"\".\"\".\" effective[x] S1..1Specimen Collection Datetime or Period
    \".\"\".\"\".\"\".\" effectiveDateTimedateTime
    \".\"\".\"\".\"\".\" effectivePeriodPeriod
    \".\"\".\"\".\" issued S1..1instant
    \".\"\".\"\".\" performer S0..*Reference(US Core Practitioner Profile | US Core Organization Profile)
    \".\"\".\"\".\" result S0..*Reference(US Core Laboratory Result Observation Profile)

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab","version":"3.1.0","name":"USCoreDiagnosticReportProfileLaboratoryReporting","title":"US Core DiagnosticReport Profile for Laboratory Results Reporting","status":"active","experimental":false,"date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the DiagnosticReport resource for the minimal set of data to query and retrieve diagnostic reports associated with laboratory results for a patient","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"}],"kind":"resource","abstract":false,"type":"DiagnosticReport","baseDefinition":"http://hl7.org/fhir/StructureDefinition/DiagnosticReport","derivation":"constraint","snapshot":{"element":[{"id":"DiagnosticReport","path":"DiagnosticReport","short":"A Diagnostic report - a combination of request information, atomic results, images, interpretation, as well as formatted reports","definition":"The US Core Diagnostic Report Profile is based upon the core FHIR DiagnosticReport Resource and created to meet the 2015 Edition Common Clinical Data Set 'Laboratory test(s) and Laboratory value(s)/result(s)' requirements.","comment":"This is intended to capture a single report and is not suitable for use in displaying summary information that covers multiple reports. For example, this resource has not been designed for laboratory cumulative reporting formats nor detailed structured reports for sequencing.","alias":["Report","Test","Result","Results","Labs","Laboratory","Lab Result","Lab Report"],"min":0,"max":"*","base":{"path":"DiagnosticReport","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"v2","map":"ORU -> OBR"},{"identity":"rim","map":"Observation[classCode=OBS, moodCode=EVN]"}]},{"id":"DiagnosticReport.id","path":"DiagnosticReport.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"DiagnosticReport.meta","path":"DiagnosticReport.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"DiagnosticReport.implicitRules","path":"DiagnosticReport.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"DiagnosticReport.language","path":"DiagnosticReport.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"DiagnosticReport.text","path":"DiagnosticReport.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"DiagnosticReport.contained","path":"DiagnosticReport.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DiagnosticReport.extension","path":"DiagnosticReport.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DiagnosticReport.modifierExtension","path":"DiagnosticReport.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DiagnosticReport.identifier","path":"DiagnosticReport.identifier","short":"Business identifier for report","definition":"Identifiers assigned to this report by the performer or other systems.","comment":"Usually assigned by the Information System of the diagnostic service provider (filler id).","requirements":"Need to know what identifier to use when making queries about this report from the source laboratory, and for linking to the report outside FHIR context.","alias":["ReportID","Filler ID","Placer ID"],"min":0,"max":"*","base":{"path":"DiagnosticReport.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"OBR-51/ for globally unique filler ID - OBR-3 , For non-globally unique filler-id the flller/placer number must be combined with the universal service Id - OBR-2(if present)+OBR-3+OBR-4"},{"identity":"rim","map":"id"}]},{"id":"DiagnosticReport.basedOn","path":"DiagnosticReport.basedOn","short":"What was requested","definition":"Details concerning a service requested.","comment":"Note: Usually there is one test request for each result, however in some circumstances multiple test requests may be represented using a single test result resource. Note that there are also cases where one request leads to multiple reports.","requirements":"This allows tracing of authorization for the report and tracking whether proposals/recommendations were acted upon.","alias":["Request"],"min":0,"max":"*","base":{"path":"DiagnosticReport.basedOn","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan","http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation","http://hl7.org/fhir/StructureDefinition/MedicationRequest","http://hl7.org/fhir/StructureDefinition/NutritionOrder","http://hl7.org/fhir/StructureDefinition/ServiceRequest"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.basedOn"},{"identity":"v2","map":"ORC? OBR-2/3?"},{"identity":"rim","map":"outboundRelationship[typeCode=FLFS].target"}]},{"id":"DiagnosticReport.status","path":"DiagnosticReport.status","short":"registered | partial | preliminary | final +","definition":"The status of the diagnostic report.","requirements":"Diagnostic services routinely issue provisional/incomplete reports, and sometimes withdraw previously released reports.","min":1,"max":"1","base":{"path":"DiagnosticReport.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/diagnostic-report-status"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"OBR-25 (not 1:1 mapping)"},{"identity":"rim","map":"statusCode Note: final and amended are distinguished by whether observation is the subject of a ControlAct event of type \"revise\""}]},{"id":"DiagnosticReport.category","path":"DiagnosticReport.category","slicing":{"discriminator":[{"type":"pattern","path":"$this"}],"rules":"open"},"short":"Service category","definition":"A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.","comment":"Multiple categories are allowed using various categorization schemes. The level of granularity is defined by the category concepts in the value set. More fine-grained filtering can be performed using the metadata and/or terminology hierarchy in DiagnosticReport.code.","alias":["Department","Sub-department","Service","Discipline"],"min":1,"max":"*","base":{"path":"DiagnosticReport.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DiagnosticServiceSection"}],"strength":"example","description":"Codes for diagnostic service sections.","valueSet":"http://hl7.org/fhir/ValueSet/diagnostic-service-sections"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"OBR-24"},{"identity":"rim","map":"inboundRelationship[typeCode=COMP].source[classCode=LIST, moodCode=EVN, code < LabService].code"}]},{"id":"DiagnosticReport.category:LaboratorySlice","path":"DiagnosticReport.category","sliceName":"LaboratorySlice","short":"Service category","definition":"A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.","comment":"Multiple categories are allowed using various categorization schemes. The level of granularity is defined by the category concepts in the value set. More fine-grained filtering can be performed using the metadata and/or terminology hierarchy in DiagnosticReport.code.","alias":["Department","Sub-department","Service","Discipline"],"min":1,"max":"1","base":{"path":"DiagnosticReport.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"LAB"}]},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DiagnosticServiceSection"}],"strength":"example","description":"Codes for diagnostic service sections.","valueSet":"http://hl7.org/fhir/ValueSet/diagnostic-service-sections"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"OBR-24"},{"identity":"rim","map":"inboundRelationship[typeCode=COMP].source[classCode=LIST, moodCode=EVN, code < LabService].code"}]},{"id":"DiagnosticReport.code","path":"DiagnosticReport.code","short":"US Core Laboratory Report Order Code","definition":"The test, panel or battery that was ordered.","comment":"UsageNote= The typical patterns for codes are: 1) a LOINC code either as a translation from a \"local\" code or as a primary code, or 2) a local code only if no suitable LOINC exists, or 3) both the local and the LOINC translation. Systems SHALL be capable of sending the local code if one exists.","alias":["Type"],"min":1,"max":"1","base":{"path":"DiagnosticReport.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"LOINC codes","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-lab-codes"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"v2","map":"OBR-4 (HL7 v2 doesn't provide an easy way to indicate both the ordered test and the performed panel)"},{"identity":"rim","map":"code"}]},{"id":"DiagnosticReport.subject","path":"DiagnosticReport.subject","short":"The subject of the report - usually, but not always, the patient","definition":"The subject of the report. Usually, but not always, this is a patient. However, diagnostic services also perform analyses on specimens collected from a variety of other sources.","requirements":"SHALL know the subject context.","alias":["Patient"],"min":1,"max":"1","base":{"path":"DiagnosticReport.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3 (no HL7 v2 mapping for Group or Device)"},{"identity":"rim","map":"participation[typeCode=SBJ]"},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"DiagnosticReport.encounter","path":"DiagnosticReport.encounter","short":"Health care event when test ordered","definition":"The healthcare event (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.","comment":"This will typically be the encounter the event occurred within, but some events may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter (e.g. pre-admission laboratory tests).","requirements":"Links the request to the Encounter context.","alias":["Context"],"min":0,"max":"1","base":{"path":"DiagnosticReport.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.encounter"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1-19"},{"identity":"rim","map":"inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN]"}]},{"id":"DiagnosticReport.effective[x]","path":"DiagnosticReport.effective[x]","short":"Specimen Collection Datetime or Period","definition":"This is the Specimen Collection Datetime or Period which is the physically relevent dateTime for laboratory tests.","comment":"If the diagnostic procedure was performed on the patient, this is the time it was performed. If there are specimens, the diagnostically relevant time can be derived from the specimen collection times, but the specimen information is not always available, and the exact relationship between the specimens and the diagnostically relevant time is not always automatic.","requirements":"Need to know where in the patient history to file/present this report.","alias":["Observation time","Effective Time","Occurrence"],"min":1,"max":"1","base":{"path":"DiagnosticReport.effective[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"OBR-7"},{"identity":"rim","map":"effectiveTime"}]},{"id":"DiagnosticReport.issued","path":"DiagnosticReport.issued","short":"DateTime this version was made","definition":"The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.","comment":"May be different from the update time of the resource itself, because that is the status of the record (potentially a secondary copy), not the actual release time of the report.","requirements":"Clinicians need to be able to check the date that the report was released.","alias":["Date published","Date Issued","Date Verified"],"min":1,"max":"1","base":{"path":"DiagnosticReport.issued","min":0,"max":"1"},"type":[{"code":"instant"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"v2","map":"OBR-22"},{"identity":"rim","map":"participation[typeCode=VRF or AUT].time"}]},{"id":"DiagnosticReport.performer","path":"DiagnosticReport.performer","short":"Responsible Diagnostic Service","definition":"The diagnostic service that is responsible for issuing the report.","comment":"This is not necessarily the source of the atomic data items or the entity that interpreted the results. It is the entity that takes responsibility for the clinical report.","requirements":"Need to know whom to contact if there are queries about the results. Also may need to track the source of reports for secondary data analysis.","alias":["Laboratory","Service","Practitioner","Department","Company","Authorized by","Director"],"min":0,"max":"*","base":{"path":"DiagnosticReport.performer","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"PRT-8 (where this PRT-4-Participation = \"PO\")"},{"identity":"rim","map":".participation[typeCode=PRF]"}]},{"id":"DiagnosticReport.resultsInterpreter","path":"DiagnosticReport.resultsInterpreter","short":"Primary result interpreter","definition":"The practitioner or organization that is responsible for the report's conclusions and interpretations.","comment":"Might not be the same entity that takes responsibility for the clinical report.","requirements":"Need to know whom to contact if there are queries about the results. Also may need to track the source of reports for secondary data analysis.","alias":["Analyzed by","Reported by"],"min":0,"max":"*","base":{"path":"DiagnosticReport.resultsInterpreter","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/CareTeam"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"OBR-32, PRT-8 (where this PRT-4-Participation = \"PI\")"},{"identity":"rim","map":".participation[typeCode=PRF]"}]},{"id":"DiagnosticReport.specimen","path":"DiagnosticReport.specimen","short":"Specimens this report is based on","definition":"Details about the specimens on which this diagnostic report is based.","comment":"If the specimen is sufficiently specified with a code in the test result name, then this additional data may be redundant. If there are multiple specimens, these may be represented per observation or group.","requirements":"Need to be able to report information about the collected specimens on which the report is based.","min":0,"max":"*","base":{"path":"DiagnosticReport.specimen","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Specimen"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"SPM"},{"identity":"rim","map":"participation[typeCode=SBJ]"}]},{"id":"DiagnosticReport.result","path":"DiagnosticReport.result","short":"Observations","definition":"[Observations](http://hl7.org/fhir/R4/observation.html) that are part of this diagnostic report.","comment":"Observations can contain observations.","requirements":"Need to support individual results, or groups of results, where the result grouping is arbitrary, but meaningful.","alias":["Data","Atomic Value","Result","Atomic result","Data","Test","Analyte","Battery","Organizer"],"min":0,"max":"*","base":{"path":"DiagnosticReport.result","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBXs"},{"identity":"rim","map":"outboundRelationship[typeCode=COMP].target"}]},{"id":"DiagnosticReport.imagingStudy","path":"DiagnosticReport.imagingStudy","short":"Reference to full details of imaging associated with the diagnostic report","definition":"One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.","comment":"ImagingStudy and the image element are somewhat overlapping - typically, the list of image references in the image element will also be found in one of the imaging study resources. However, each caters to different types of displays for different types of purposes. Neither, either, or both may be provided.","min":0,"max":"*","base":{"path":"DiagnosticReport.imagingStudy","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/ImagingStudy"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"outboundRelationship[typeCode=COMP].target[classsCode=DGIMG, moodCode=EVN]"}]},{"id":"DiagnosticReport.media","path":"DiagnosticReport.media","short":"Key images associated with this report","definition":"A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).","requirements":"Many diagnostic services include images in the report as part of their service.","alias":["DICOM","Slides","Scans"],"min":0,"max":"*","base":{"path":"DiagnosticReport.media","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"OBX?"},{"identity":"rim","map":"outboundRelationship[typeCode=COMP].target"}]},{"id":"DiagnosticReport.media.id","path":"DiagnosticReport.media.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DiagnosticReport.media.extension","path":"DiagnosticReport.media.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DiagnosticReport.media.modifierExtension","path":"DiagnosticReport.media.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DiagnosticReport.media.comment","path":"DiagnosticReport.media.comment","short":"Comment about the image (e.g. explanation)","definition":"A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.","comment":"The comment should be displayed with the image. It would be common for the report to include additional discussion of the image contents in other sections such as the conclusion.","requirements":"The provider of the report should make a comment about each image included in the report.","min":0,"max":"1","base":{"path":"DiagnosticReport.media.comment","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code=\"annotation\"].value"}]},{"id":"DiagnosticReport.media.link","path":"DiagnosticReport.media.link","short":"Reference to the image source","definition":"Reference to the image source.","min":1,"max":"1","base":{"path":"DiagnosticReport.media.link","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Media"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".value.reference"}]},{"id":"DiagnosticReport.conclusion","path":"DiagnosticReport.conclusion","short":"Clinical conclusion (interpretation) of test results","definition":"Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.","requirements":"Need to be able to provide a conclusion that is not lost among the basic result data.","alias":["Report"],"min":0,"max":"1","base":{"path":"DiagnosticReport.conclusion","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX"},{"identity":"rim","map":"inboundRelationship[typeCode=\"SPRT\"].source[classCode=OBS, moodCode=EVN, code=LOINC:48767-8].value (type=ST)"}]},{"id":"DiagnosticReport.conclusionCode","path":"DiagnosticReport.conclusionCode","short":"Codes for the clinical conclusion of test results","definition":"One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report.","min":0,"max":"*","base":{"path":"DiagnosticReport.conclusionCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdjunctDiagnosis"}],"strength":"example","description":"Diagnosis codes provided as adjuncts to the report.","valueSet":"http://hl7.org/fhir/ValueSet/clinical-findings"},"mapping":[{"identity":"v2","map":"OBX"},{"identity":"rim","map":"inboundRelationship[typeCode=SPRT].source[classCode=OBS, moodCode=EVN, code=LOINC:54531-9].value (type=CD)"}]},{"id":"DiagnosticReport.presentedForm","path":"DiagnosticReport.presentedForm","short":"Entire report as issued","definition":"Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.","comment":"\"application/pdf\" is recommended as the most reliable and interoperable in this context.","requirements":"Gives laboratory the ability to provide its own fully formatted report for clinical fidelity.","min":0,"max":"*","base":{"path":"DiagnosticReport.presentedForm","min":0,"max":"*"},"type":[{"code":"Attachment"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX"},{"identity":"rim","map":"text (type=ED)"}]}]},"differential":{"element":[{"id":"DiagnosticReport","path":"DiagnosticReport","definition":"The US Core Diagnostic Report Profile is based upon the core FHIR DiagnosticReport Resource and created to meet the 2015 Edition Common Clinical Data Set 'Laboratory test(s) and Laboratory value(s)/result(s)' requirements.","alias":["Lab Result","Lab Report"],"mustSupport":false,"isModifier":false},{"id":"DiagnosticReport.status","path":"DiagnosticReport.status","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true,"isModifier":false,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/diagnostic-report-status"}},{"id":"DiagnosticReport.category","path":"DiagnosticReport.category","slicing":{"discriminator":[{"type":"pattern","path":"$this"}],"rules":"open"},"min":1,"max":"*","type":[{"code":"CodeableConcept"}],"mustSupport":true,"isModifier":false},{"id":"DiagnosticReport.category:LaboratorySlice","path":"DiagnosticReport.category","sliceName":"LaboratorySlice","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v2-0074","code":"LAB"}]},"mustSupport":true,"isModifier":false},{"id":"DiagnosticReport.code","path":"DiagnosticReport.code","short":"US Core Laboratory Report Order Code","definition":"The test, panel or battery that was ordered.","comment":"UsageNote= The typical patterns for codes are: 1) a LOINC code either as a translation from a \"local\" code or as a primary code, or 2) a local code only if no suitable LOINC exists, or 3) both the local and the LOINC translation. Systems SHALL be capable of sending the local code if one exists.","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"isModifier":false,"binding":{"strength":"extensible","description":"LOINC codes","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-lab-codes"}},{"id":"DiagnosticReport.subject","path":"DiagnosticReport.subject","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"isModifier":false},{"id":"DiagnosticReport.effective[x]","path":"DiagnosticReport.effective[x]","short":"Specimen Collection Datetime or Period","definition":"This is the Specimen Collection Datetime or Period which is the physically relevent dateTime for laboratory tests.","min":1,"max":"1","type":[{"code":"dateTime"},{"code":"Period"}],"mustSupport":true,"isModifier":false},{"id":"DiagnosticReport.issued","path":"DiagnosticReport.issued","min":1,"max":"1","type":[{"code":"instant"}],"mustSupport":true,"isModifier":false},{"id":"DiagnosticReport.performer","path":"DiagnosticReport.performer","min":0,"max":"*","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"mustSupport":true,"isModifier":false},{"id":"DiagnosticReport.result","path":"DiagnosticReport.result","min":0,"max":"*","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab"]}],"mustSupport":true,"isModifier":false}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-diagnosticreport-note.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-diagnosticreport-note.json new file mode 100755 index 000000000..30356f18a --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-diagnosticreport-note.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-diagnosticreport-note","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" DiagnosticReport 0..*US Core Diagnostic Report Profile for Report and Note exchange
    \".\"\".\"\".\" status S1..1codeBinding: DiagnosticReportStatus (required)
    \".\"\".\"\".\" category S1..*CodeableConceptBinding: US Core DiagnosticReport Category (extensible)
    \".\"\".\"\".\" code S1..1CodeableConceptUS Core Report Code
    Binding: US Core Diagnosticreport Report And Note Codes (extensible)
    \".\"\".\"\".\" subject SΣ1..1Reference(US Core Patient Profile)The subject of the report - usually, but not always, the patient
    \".\"\".\"\".\" encounter S0..1Reference(US Core Encounter Profile)
    \".\"\".\"\".\" effective[x] S1..1Time of the report or note
    \".\"\".\"\".\"\".\" effectiveDateTimedateTime
    \".\"\".\"\".\"\".\" effectivePeriodPeriod
    \".\"\".\"\".\" issued S0..1instant
    \".\"\".\"\".\" performer S0..*Reference(US Core Practitioner Profile | US Core Organization Profile)
    \".\"\".\"\".\" presentedForm S0..*Attachment

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note","version":"3.1.0","name":"USCoreDiagnosticReportProfileNoteExchange","title":"US Core DiagnosticReport Profile for Report and Note exchange","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the DiagnosticReport resource for the minimal set of data to query and retrieve diagnostic reports associated with clinical notes for a patient","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"}],"kind":"resource","abstract":false,"type":"DiagnosticReport","baseDefinition":"http://hl7.org/fhir/StructureDefinition/DiagnosticReport","derivation":"constraint","snapshot":{"element":[{"id":"DiagnosticReport","path":"DiagnosticReport","short":"US Core Diagnostic Report Profile for Report and Note exchange","definition":"The US Core Diagnostic Report Profile for Report and Note exchange is based upon the requirements of the Argonauts to exchang imaginge reports.","comment":"This is intended to capture a single report and is not suitable for use in displaying summary information that covers multiple reports. For example, this resource has not been designed for laboratory cumulative reporting formats nor detailed structured reports for sequencing.","alias":["Report","Test","Result","Results","Labs","Laboratory","Imaging Report","Radiology Report"],"min":0,"max":"*","base":{"path":"DiagnosticReport","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"v2","map":"ORU -> OBR"},{"identity":"rim","map":"Observation[classCode=OBS, moodCode=EVN]"}]},{"id":"DiagnosticReport.id","path":"DiagnosticReport.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"DiagnosticReport.meta","path":"DiagnosticReport.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"DiagnosticReport.implicitRules","path":"DiagnosticReport.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"DiagnosticReport.language","path":"DiagnosticReport.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"DiagnosticReport.text","path":"DiagnosticReport.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"DiagnosticReport.contained","path":"DiagnosticReport.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DiagnosticReport.extension","path":"DiagnosticReport.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DiagnosticReport.modifierExtension","path":"DiagnosticReport.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DiagnosticReport.identifier","path":"DiagnosticReport.identifier","short":"Business identifier for report","definition":"Identifiers assigned to this report by the performer or other systems.","comment":"Usually assigned by the Information System of the diagnostic service provider (filler id).","requirements":"Need to know what identifier to use when making queries about this report from the source laboratory, and for linking to the report outside FHIR context.","alias":["ReportID","Filler ID","Placer ID"],"min":0,"max":"*","base":{"path":"DiagnosticReport.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"OBR-51/ for globally unique filler ID - OBR-3 , For non-globally unique filler-id the flller/placer number must be combined with the universal service Id - OBR-2(if present)+OBR-3+OBR-4"},{"identity":"rim","map":"id"}]},{"id":"DiagnosticReport.basedOn","path":"DiagnosticReport.basedOn","short":"What was requested","definition":"Details concerning a service requested.","comment":"Note: Usually there is one test request for each result, however in some circumstances multiple test requests may be represented using a single test result resource. Note that there are also cases where one request leads to multiple reports.","requirements":"This allows tracing of authorization for the report and tracking whether proposals/recommendations were acted upon.","alias":["Request"],"min":0,"max":"*","base":{"path":"DiagnosticReport.basedOn","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan","http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation","http://hl7.org/fhir/StructureDefinition/MedicationRequest","http://hl7.org/fhir/StructureDefinition/NutritionOrder","http://hl7.org/fhir/StructureDefinition/ServiceRequest"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.basedOn"},{"identity":"v2","map":"ORC? OBR-2/3?"},{"identity":"rim","map":"outboundRelationship[typeCode=FLFS].target"}]},{"id":"DiagnosticReport.status","path":"DiagnosticReport.status","short":"registered | partial | preliminary | final +","definition":"The status of the diagnostic report.","requirements":"Diagnostic services routinely issue provisional/incomplete reports, and sometimes withdraw previously released reports.","min":1,"max":"1","base":{"path":"DiagnosticReport.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/diagnostic-report-status"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"OBR-25 (not 1:1 mapping)"},{"identity":"rim","map":"statusCode Note: final and amended are distinguished by whether observation is the subject of a ControlAct event of type \"revise\""}]},{"id":"DiagnosticReport.category","path":"DiagnosticReport.category","short":"Service category","definition":"A code that classifies the clinical discipline, department or diagnostic service that created the report (e.g. cardiology, biochemistry, hematology, MRI). This is used for searching, sorting and display purposes.","comment":"Multiple categories are allowed using various categorization schemes. The level of granularity is defined by the category concepts in the value set. More fine-grained filtering can be performed using the metadata and/or terminology hierarchy in DiagnosticReport.code.","alias":["Department","Sub-department","Service","Discipline","service","discipline"],"min":1,"max":"*","base":{"path":"DiagnosticReport.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"OBR-24"},{"identity":"rim","map":"inboundRelationship[typeCode=COMP].source[classCode=LIST, moodCode=EVN, code < LabService].code"}]},{"id":"DiagnosticReport.code","path":"DiagnosticReport.code","short":"US Core Report Code","definition":"The test, panel, report, or note that was ordered.","comment":"UsageNote= The typical patterns for codes are: 1) a LOINC code either as a translation from a \"local\" code or as a primary code, or 2) a local code only if no suitable LOINC exists, or 3) both the local and the LOINC translation. Systems SHALL be capable of sending the local code if one exists.","alias":["Type"],"min":1,"max":"1","base":{"path":"DiagnosticReport.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"LOINC codes","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-report-and-note-codes"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"v2","map":"OBR-4 (HL7 v2 doesn't provide an easy way to indicate both the ordered test and the performed panel)"},{"identity":"rim","map":"code"}]},{"id":"DiagnosticReport.subject","path":"DiagnosticReport.subject","short":"The subject of the report - usually, but not always, the patient","definition":"The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.","requirements":"SHALL know the subject context.","alias":["Patient"],"min":1,"max":"1","base":{"path":"DiagnosticReport.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3 (no HL7 v2 mapping for Group or Device)"},{"identity":"rim","map":"participation[typeCode=SBJ]"},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"DiagnosticReport.encounter","path":"DiagnosticReport.encounter","short":"Health care event when test ordered","definition":"The healthcare event (e.g. a patient and healthcare provider interaction) which this DiagnosticReport is about.","comment":"This will typically be the encounter the event occurred within, but some events may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter (e.g. pre-admission laboratory tests).","requirements":"Links the request to the Encounter context.","alias":["Context"],"min":0,"max":"1","base":{"path":"DiagnosticReport.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.encounter"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1-19"},{"identity":"rim","map":"inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN]"}]},{"id":"DiagnosticReport.effective[x]","path":"DiagnosticReport.effective[x]","short":"Time of the report or note","definition":"This is the Datetime or Period when the report or note was written.","comment":"If the diagnostic procedure was performed on the patient, this is the time it was performed. If there are specimens, the diagnostically relevant time can be derived from the specimen collection times, but the specimen information is not always available, and the exact relationship between the specimens and the diagnostically relevant time is not always automatic.","requirements":"Need to know where in the patient history to file/present this report.","alias":["Observation time","Effective Time","Occurrence"],"min":1,"max":"1","base":{"path":"DiagnosticReport.effective[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"OBR-7"},{"identity":"rim","map":"effectiveTime"}]},{"id":"DiagnosticReport.issued","path":"DiagnosticReport.issued","short":"DateTime this version was made","definition":"The date and time that this version of the report was made available to providers, typically after the report was reviewed and verified.","comment":"May be different from the update time of the resource itself, because that is the status of the record (potentially a secondary copy), not the actual release time of the report.","requirements":"Clinicians need to be able to check the date that the report was released.","alias":["Date published","Date Issued","Date Verified"],"min":0,"max":"1","base":{"path":"DiagnosticReport.issued","min":0,"max":"1"},"type":[{"code":"instant"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"v2","map":"OBR-22"},{"identity":"rim","map":"participation[typeCode=VRF or AUT].time"}]},{"id":"DiagnosticReport.performer","path":"DiagnosticReport.performer","short":"Responsible Diagnostic Service","definition":"The diagnostic service that is responsible for issuing the report.","comment":"This is not necessarily the source of the atomic data items or the entity that interpreted the results. It is the entity that takes responsibility for the clinical report.","requirements":"Need to know whom to contact if there are queries about the results. Also may need to track the source of reports for secondary data analysis.","alias":["Laboratory","Service","Practitioner","Department","Company","Authorized by","Director"],"min":0,"max":"*","base":{"path":"DiagnosticReport.performer","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"PRT-8 (where this PRT-4-Participation = \"PO\")"},{"identity":"rim","map":".participation[typeCode=PRF]"}]},{"id":"DiagnosticReport.resultsInterpreter","path":"DiagnosticReport.resultsInterpreter","short":"Primary result interpreter","definition":"The practitioner or organization that is responsible for the report's conclusions and interpretations.","comment":"Might not be the same entity that takes responsibility for the clinical report.","requirements":"Need to know whom to contact if there are queries about the results. Also may need to track the source of reports for secondary data analysis.","alias":["Analyzed by","Reported by"],"min":0,"max":"*","base":{"path":"DiagnosticReport.resultsInterpreter","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/CareTeam"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"OBR-32, PRT-8 (where this PRT-4-Participation = \"PI\")"},{"identity":"rim","map":".participation[typeCode=PRF]"}]},{"id":"DiagnosticReport.specimen","path":"DiagnosticReport.specimen","short":"Specimens this report is based on","definition":"Details about the specimens on which this diagnostic report is based.","comment":"If the specimen is sufficiently specified with a code in the test result name, then this additional data may be redundant. If there are multiple specimens, these may be represented per observation or group.","requirements":"Need to be able to report information about the collected specimens on which the report is based.","min":0,"max":"*","base":{"path":"DiagnosticReport.specimen","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Specimen"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"SPM"},{"identity":"rim","map":"participation[typeCode=SBJ]"}]},{"id":"DiagnosticReport.result","path":"DiagnosticReport.result","short":"Observations","definition":"[Observations](http://hl7.org/fhir/R4/observation.html) that are part of this diagnostic report.","comment":"Observations can contain observations.","requirements":"Need to support individual results, or groups of results, where the result grouping is arbitrary, but meaningful.","alias":["Data","Atomic Value","Result","Atomic result","Data","Test","Analyte","Battery","Organizer"],"min":0,"max":"*","base":{"path":"DiagnosticReport.result","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Observation"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBXs"},{"identity":"rim","map":"outboundRelationship[typeCode=COMP].target"}]},{"id":"DiagnosticReport.imagingStudy","path":"DiagnosticReport.imagingStudy","short":"Reference to full details of imaging associated with the diagnostic report","definition":"One or more links to full details of any imaging performed during the diagnostic investigation. Typically, this is imaging performed by DICOM enabled modalities, but this is not required. A fully enabled PACS viewer can use this information to provide views of the source images.","comment":"ImagingStudy and the image element are somewhat overlapping - typically, the list of image references in the image element will also be found in one of the imaging study resources. However, each caters to different types of displays for different types of purposes. Neither, either, or both may be provided.","min":0,"max":"*","base":{"path":"DiagnosticReport.imagingStudy","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/ImagingStudy"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"outboundRelationship[typeCode=COMP].target[classsCode=DGIMG, moodCode=EVN]"}]},{"id":"DiagnosticReport.media","path":"DiagnosticReport.media","short":"Key images associated with this report","definition":"A list of key images associated with this report. The images are generally created during the diagnostic process, and may be directly of the patient, or of treated specimens (i.e. slides of interest).","requirements":"Many diagnostic services include images in the report as part of their service.","alias":["DICOM","Slides","Scans"],"min":0,"max":"*","base":{"path":"DiagnosticReport.media","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"OBX?"},{"identity":"rim","map":"outboundRelationship[typeCode=COMP].target"}]},{"id":"DiagnosticReport.media.id","path":"DiagnosticReport.media.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DiagnosticReport.media.extension","path":"DiagnosticReport.media.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DiagnosticReport.media.modifierExtension","path":"DiagnosticReport.media.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DiagnosticReport.media.comment","path":"DiagnosticReport.media.comment","short":"Comment about the image (e.g. explanation)","definition":"A comment about the image. Typically, this is used to provide an explanation for why the image is included, or to draw the viewer's attention to important features.","comment":"The comment should be displayed with the image. It would be common for the report to include additional discussion of the image contents in other sections such as the conclusion.","requirements":"The provider of the report should make a comment about each image included in the report.","min":0,"max":"1","base":{"path":"DiagnosticReport.media.comment","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code=\"annotation\"].value"}]},{"id":"DiagnosticReport.media.link","path":"DiagnosticReport.media.link","short":"Reference to the image source","definition":"Reference to the image source.","min":1,"max":"1","base":{"path":"DiagnosticReport.media.link","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Media"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".value.reference"}]},{"id":"DiagnosticReport.conclusion","path":"DiagnosticReport.conclusion","short":"Clinical conclusion (interpretation) of test results","definition":"Concise and clinically contextualized summary conclusion (interpretation/impression) of the diagnostic report.","requirements":"Need to be able to provide a conclusion that is not lost among the basic result data.","alias":["Report"],"min":0,"max":"1","base":{"path":"DiagnosticReport.conclusion","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX"},{"identity":"rim","map":"inboundRelationship[typeCode=\"SPRT\"].source[classCode=OBS, moodCode=EVN, code=LOINC:48767-8].value (type=ST)"}]},{"id":"DiagnosticReport.conclusionCode","path":"DiagnosticReport.conclusionCode","short":"Codes for the clinical conclusion of test results","definition":"One or more codes that represent the summary conclusion (interpretation/impression) of the diagnostic report.","min":0,"max":"*","base":{"path":"DiagnosticReport.conclusionCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdjunctDiagnosis"}],"strength":"example","description":"Diagnosis codes provided as adjuncts to the report.","valueSet":"http://hl7.org/fhir/ValueSet/clinical-findings"},"mapping":[{"identity":"v2","map":"OBX"},{"identity":"rim","map":"inboundRelationship[typeCode=SPRT].source[classCode=OBS, moodCode=EVN, code=LOINC:54531-9].value (type=CD)"}]},{"id":"DiagnosticReport.presentedForm","path":"DiagnosticReport.presentedForm","short":"Entire report as issued","definition":"Rich text representation of the entire result as issued by the diagnostic service. Multiple formats are allowed but they SHALL be semantically equivalent.","comment":"\"application/pdf\" is recommended as the most reliable and interoperable in this context.","requirements":"Gives laboratory the ability to provide its own fully formatted report for clinical fidelity.","min":0,"max":"*","base":{"path":"DiagnosticReport.presentedForm","min":0,"max":"*"},"type":[{"code":"Attachment"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX"},{"identity":"rim","map":"text (type=ED)"}]}]},"differential":{"element":[{"id":"DiagnosticReport","path":"DiagnosticReport","short":"US Core Diagnostic Report Profile for Report and Note exchange","definition":"The US Core Diagnostic Report Profile for Report and Note exchange is based upon the requirements of the Argonauts to exchang imaginge reports.","alias":["Imaging Report","Radiology Report"],"mustSupport":false,"isModifier":false},{"id":"DiagnosticReport.status","path":"DiagnosticReport.status","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true,"isModifier":false,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/diagnostic-report-status"}},{"id":"DiagnosticReport.category","path":"DiagnosticReport.category","alias":["Department","Sub-department","service","discipline"],"min":1,"type":[{"code":"CodeableConcept"}],"mustSupport":true,"isModifier":false,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-category"}},{"id":"DiagnosticReport.code","path":"DiagnosticReport.code","short":"US Core Report Code","definition":"The test, panel, report, or note that was ordered.","comment":"UsageNote= The typical patterns for codes are: 1) a LOINC code either as a translation from a \"local\" code or as a primary code, or 2) a local code only if no suitable LOINC exists, or 3) both the local and the LOINC translation. Systems SHALL be capable of sending the local code if one exists.","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"isModifier":false,"binding":{"strength":"extensible","description":"LOINC codes","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-report-and-note-codes"}},{"id":"DiagnosticReport.subject","path":"DiagnosticReport.subject","short":"The subject of the report - usually, but not always, the patient","definition":"The subject of the report. Usually, but not always, this is a patient. However diagnostic services also perform analyses on specimens collected from a variety of other sources.","requirements":"SHALL know the subject context.","alias":["Patient"],"min":1,"max":"1","base":{"path":"DiagnosticReport.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"isModifier":false,"isSummary":true},{"id":"DiagnosticReport.encounter","path":"DiagnosticReport.encounter","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"]}],"mustSupport":true,"isModifier":false},{"id":"DiagnosticReport.effective[x]","path":"DiagnosticReport.effective[x]","short":"Time of the report or note","definition":"This is the Datetime or Period when the report or note was written.","min":1,"max":"1","type":[{"code":"dateTime"},{"code":"Period"}],"mustSupport":true,"isModifier":false},{"id":"DiagnosticReport.issued","path":"DiagnosticReport.issued","min":0,"max":"1","type":[{"code":"instant"}],"mustSupport":true,"isModifier":false},{"id":"DiagnosticReport.performer","path":"DiagnosticReport.performer","min":0,"max":"*","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"mustSupport":true,"isModifier":false},{"id":"DiagnosticReport.presentedForm","path":"DiagnosticReport.presentedForm","min":0,"max":"*","type":[{"code":"Attachment"}],"mustSupport":true,"isModifier":false}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-direct.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-direct.json new file mode 100755 index 000000000..9f4fc53a3 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-direct.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-direct","text":{"status":"generated","div":"
    \r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Extension 0..1Email is a "direct" email
    \".\"\".\"\".\" url 1..1uri"http://hl7.org/fhir/us/core/StructureDefinition/us-core-direct"
    \".\"\".\"\".\" valueBoolean 0..1boolean

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-direct","version":"3.1.0","name":"USCoreDirectEmailExtension","title":"US Core Direct email Extension","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"This email address is associated with a [direct](http://wiki.directproject.org/Addressing+Specification) service. This extension can only be used on contact points where the system = 'email'","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"complex-type","abstract":false,"context":[{"type":"element","expression":"ContactPoint"}],"type":"Extension","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Extension","derivation":"constraint","snapshot":{"element":[{"id":"Extension","path":"Extension","short":"Email is a \"direct\" email","definition":"This email address is associated with a \"direct\" service - e.g. http://wiki.directproject.org/Addressing+Specification. This extension can only be used on contact points where the system = 'email'","comment":"This extension can only be used on contact points where the system = 'email'.","min":0,"max":"1","base":{"path":"Extension","min":0,"max":"*"},"condition":["ele-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"mapping":[{"identity":"v2","map":"No v2 equivalent"},{"identity":"rim","map":"No RIM equivalent"}]},{"id":"Extension.id","path":"Extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension","path":"Extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.url","path":"Extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"fixedUri":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-direct","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.value[x]","path":"Extension.value[x]","slicing":{"discriminator":[{"type":"type","path":"$this"}],"ordered":false,"rules":"closed"},"short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.value[x]:valueBoolean","path":"Extension.value[x]","sliceName":"valueBoolean","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]}]},"differential":{"element":[{"id":"Extension","path":"Extension","short":"Email is a \"direct\" email","definition":"This email address is associated with a \"direct\" service - e.g. http://wiki.directproject.org/Addressing+Specification. This extension can only be used on contact points where the system = 'email'","comment":"This extension can only be used on contact points where the system = 'email'.","min":0,"max":"1","isModifier":false,"mapping":[{"identity":"v2","map":"No v2 equivalent"},{"identity":"rim","map":"No RIM equivalent"}]},{"id":"Extension.url","path":"Extension.url","fixedUri":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-direct"},{"id":"Extension.valueBoolean","path":"Extension.valueBoolean","min":0,"max":"1","type":[{"code":"boolean"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-documentreference.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-documentreference.json new file mode 100755 index 000000000..7ada6b017 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-documentreference.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-documentreference","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" DocumentReference 0..*
    \".\"\".\"\".\" identifier S0..*Identifier
    \".\"\".\"\".\" status S1..1codeBinding: DocumentReferenceStatus (required)
    \".\"\".\"\".\" type S1..1CodeableConceptBinding: US Core DocumentReference Type (required)
    Min Binding: US Core Clinical Note Type
    \".\"\".\"\".\" category S1..*CodeableConceptBinding: US Core DocumentReference Category (extensible)
    \".\"\".\"\".\" subject S1..1Reference(US Core Patient Profile)
    \".\"\".\"\".\" date S0..1instant
    \".\"\".\"\".\" author S0..*Reference(US Core Practitioner Profile | PractitionerRole | US Core Organization Profile | Device | US Core Patient Profile | RelatedPerson)
    \".\"\".\"\".\" custodian S0..1Reference(US Core Organization Profile)
    \".\"\".\"\".\" content S1..1BackboneElement
    \".\"\".\"\".\"\".\" attachment SI1..1Attachmentus-core-6: DocumentReference.content.attachment.url or DocumentReference.content.attachment.data or both SHALL be present.
    \".\"\".\"\".\"\".\"\".\" contentType S1..1code
    \".\"\".\"\".\"\".\"\".\" data SI0..1base64Binary
    \".\"\".\"\".\"\".\"\".\" url SI0..1url
    \".\"\".\"\".\"\".\" format S0..1CodingBinding: DocumentReferenceFormatCodeSet (extensible)
    \".\"\".\"\".\" context S0..1BackboneElement
    \".\"\".\"\".\"\".\" encounter S0..1Reference(US Core Encounter Profile)
    \".\"\".\"\".\"\".\" period S0..1Period

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference","version":"3.1.0","name":"USCoreDocumentReferenceProfile","title":"US Core DocumentReference Profile","status":"active","experimental":false,"date":"2019-08-11T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"The document reference profile used in US Core.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"fhircomposition","uri":"http://hl7.org/fhir/composition","name":"FHIR Composition"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"cda","uri":"http://hl7.org/v3/cda","name":"CDA (R2)"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"xds","uri":"http://ihe.net/xds","name":"XDS metadata equivalent"}],"kind":"resource","abstract":false,"type":"DocumentReference","baseDefinition":"http://hl7.org/fhir/StructureDefinition/DocumentReference","derivation":"constraint","snapshot":{"element":[{"id":"DocumentReference","path":"DocumentReference","short":"A reference to a document","definition":"This is a basic constraint on DocumentRefernce for use in the US Core IG.","comment":"Usually, this is used for documents other than those defined by FHIR.","min":0,"max":"*","base":{"path":"DocumentReference","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"fhircomposition","map":"when describing a Composition"},{"identity":"rim","map":"Document[classCode=\"DOC\" and moodCode=\"EVN\"]"},{"identity":"cda","map":"when describing a CDA"}]},{"id":"DocumentReference.id","path":"DocumentReference.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"DocumentReference.meta","path":"DocumentReference.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"DocumentReference.implicitRules","path":"DocumentReference.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"DocumentReference.language","path":"DocumentReference.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"DocumentReference.text","path":"DocumentReference.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"DocumentReference.contained","path":"DocumentReference.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DocumentReference.extension","path":"DocumentReference.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DocumentReference.modifierExtension","path":"DocumentReference.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DocumentReference.masterIdentifier","path":"DocumentReference.masterIdentifier","short":"Master Version Specific Identifier","definition":"Document identifier as assigned by the source of the document. This identifier is specific to this version of the document. This unique identifier may be used elsewhere to identify this version of the document.","comment":"CDA Document Id extension and root.","requirements":"The structure and format of this Id shall be consistent with the specification corresponding to the formatCode attribute. (e.g. for a DICOM standard document a 64-character numeric UID, for an HL7 CDA format a serialization of the CDA Document Id extension and root in the form \"oid^extension\", where OID is a 64 digits max, and the Id is a 16 UTF-8 char max. If the OID is coded without the extension then the '^' character shall not be included.).","min":0,"max":"1","base":{"path":"DocumentReference.masterIdentifier","min":0,"max":"1"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"fhircomposition","map":"Composition.identifier"},{"identity":"v2","map":"TXA-12"},{"identity":"rim","map":".id"},{"identity":"xds","map":"DocumentEntry.uniqueId"},{"identity":"cda","map":"ClinicalDocument/id"}]},{"id":"DocumentReference.identifier","path":"DocumentReference.identifier","short":"Other identifiers for the document","definition":"Other identifiers associated with the document, including version independent identifiers.","min":0,"max":"*","base":{"path":"DocumentReference.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"TXA-16?"},{"identity":"rim","map":".id / .setId"},{"identity":"xds","map":"DocumentEntry.entryUUID"}]},{"id":"DocumentReference.status","path":"DocumentReference.status","short":"current | superseded | entered-in-error","definition":"The status of this document reference.","comment":"This is the status of the DocumentReference object, which might be independent from the docStatus element.\n\nThis element is labeled as a modifier because the status contains the codes that mark the document or reference as not currently valid.","min":1,"max":"1","base":{"path":"DocumentReference.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/document-reference-status"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"TXA-19"},{"identity":"rim","map":"interim: .completionCode=\"IN\" & ./statusCode[isNormalDatatype()]=\"active\"; final: .completionCode=\"AU\" && ./statusCode[isNormalDatatype()]=\"complete\" and not(./inboundRelationship[typeCode=\"SUBJ\" and isNormalActRelationship()]/source[subsumesCode(\"ActClass#CACT\") and moodCode=\"EVN\" and domainMember(\"ReviseDocument\", code) and isNormalAct()]); amended: .completionCode=\"AU\" && ./statusCode[isNormalDatatype()]=\"complete\" and ./inboundRelationship[typeCode=\"SUBJ\" and isNormalActRelationship()]/source[subsumesCode(\"ActClass#CACT\") and moodCode=\"EVN\" and domainMember(\"ReviseDocument\", code) and isNormalAct() and statusCode=\"completed\"]; withdrawn : .completionCode=NI && ./statusCode[isNormalDatatype()]=\"obsolete\""},{"identity":"xds","map":"DocumentEntry.availabilityStatus"}]},{"id":"DocumentReference.docStatus","path":"DocumentReference.docStatus","short":"preliminary | final | amended | entered-in-error","definition":"The status of the underlying document.","comment":"The document that is pointed to might be in various lifecycle states.","min":0,"max":"1","base":{"path":"DocumentReference.docStatus","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ReferredDocumentStatus"}],"strength":"required","description":"Status of the underlying document.","valueSet":"http://hl7.org/fhir/ValueSet/composition-status|4.0.1"},"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"fhircomposition","map":"Composition.status"},{"identity":"v2","map":"TXA-17"},{"identity":"rim","map":".statusCode"}]},{"id":"DocumentReference.type","path":"DocumentReference.type","short":"Kind of document (LOINC if possible)","definition":"Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.","comment":"Key metadata element describing the document that describes he exact type of document. Helps humans to assess whether the document is of interest when viewing a list of documents.","min":1,"max":"1","base":{"path":"DocumentReference.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-minValueSet","valueCanonical":"http://hl7.org/fhir/us/core/ValueSet/us-core-clinical-note-type"}],"strength":"required","description":"All LOINC values whose SCALE is DOC in the LOINC database and the HL7 v3 Code System NullFlavor concept 'unknown'","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-type"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.class"},{"identity":"fhircomposition","map":"Composition.type"},{"identity":"v2","map":"TXA-2"},{"identity":"rim","map":"./code"},{"identity":"xds","map":"DocumentEntry.type"},{"identity":"cda","map":"ClinicalDocument/code/@code \n\nThe typeCode should be mapped from the ClinicalDocument/code element to a set of document type codes configured in the affinity domain. One suggested coding system to use for typeCode is LOINC, in which case the mapping step can be omitted."}]},{"id":"DocumentReference.category","path":"DocumentReference.category","short":"Categorization of document","definition":"A categorization for the type of document referenced - helps for indexing and searching. This may be implied by or derived from the code specified in the DocumentReference.type.","comment":"Key metadata element describing the the category or classification of the document. This is a broader perspective that groups similar documents based on how they would be used. This is a primary key used in searching.","alias":["claxs"],"min":1,"max":"*","base":{"path":"DocumentReference.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"The US Core DocumentReferences Type Value Set is a 'starter set' of categories supported for fetching and storing clinical notes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"fhircomposition","map":"Composition.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"},{"identity":"xds","map":"DocumentEntry.class"},{"identity":"cda","map":"Derived from a mapping of /ClinicalDocument/code/@code to an Affinity Domain specified coded value to use and coding system. Affinity Domains are encouraged to use the appropriate value for Type of Service, based on the LOINC Type of Service (see Page 53 of the LOINC User's Manual). Must be consistent with /ClinicalDocument/code/@code"}]},{"id":"DocumentReference.subject","path":"DocumentReference.subject","short":"Who/what is the subject of the document","definition":"Who or what the document is about. The document can be about a person, (patient or healthcare practitioner), a device (e.g. a machine) or even a group of subjects (such as a document about a herd of farm animals, or a set of patients that share a common exposure).","min":1,"max":"1","base":{"path":"DocumentReference.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"fhircomposition","map":"Composition.subject"},{"identity":"v2","map":"PID-3 (No standard way to define a Practitioner or Group subject in HL7 v2 MDM message)"},{"identity":"rim","map":".participation[typeCode=\"SBJ\"].role[typeCode=\"PAT\"]"},{"identity":"xds","map":"DocumentEntry.patientId"},{"identity":"cda","map":"ClinicalDocument/recordTarget/"},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"DocumentReference.date","path":"DocumentReference.date","short":"When this document reference was created","definition":"When the document reference was created.","comment":"Referencing/indexing time is used for tracking, organizing versions and searching.","alias":["indexed"],"min":0,"max":"1","base":{"path":"DocumentReference.date","min":0,"max":"1"},"type":[{"code":"instant"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.recorded"},{"identity":"fhircomposition","map":"Composition.date"},{"identity":"rim","map":".availabilityTime[type=\"TS\"]"}]},{"id":"DocumentReference.author","path":"DocumentReference.author","short":"Who and/or what authored the document","definition":"Identifies who is responsible for adding the information to the document.","comment":"Not necessarily who did the actual data entry (i.e. typist) or who was the source (informant).","min":0,"max":"*","base":{"path":"DocumentReference.author","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"fhircomposition","map":"Composition.author"},{"identity":"v2","map":"TXA-9 (No standard way to indicate a Device in HL7 v2 MDM message)"},{"identity":"rim","map":".participation[typeCode=\"AUT\"].role[classCode=\"ASSIGNED\"]"},{"identity":"xds","map":"DocumentEntry.author"},{"identity":"cda","map":"ClinicalDocument/author"}]},{"id":"DocumentReference.authenticator","path":"DocumentReference.authenticator","short":"Who/what authenticated the document","definition":"Which person or organization authenticates that this document is valid.","comment":"Represents a participant within the author institution who has legally authenticated or attested the document. Legal authentication implies that a document has been signed manually or electronically by the legal Authenticator.","min":0,"max":"1","base":{"path":"DocumentReference.authenticator","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.witness"},{"identity":"fhircomposition","map":"Composition.attester"},{"identity":"v2","map":"TXA-10"},{"identity":"rim","map":".participation[typeCode=\"AUTHEN\"].role[classCode=\"ASSIGNED\"]"},{"identity":"xds","map":"DocumentEntry.legalAuthenticator"},{"identity":"cda","map":"ClinicalDocument/legalAuthenticator"}]},{"id":"DocumentReference.custodian","path":"DocumentReference.custodian","short":"Organization which maintains the document","definition":"Identifies the organization or group who is responsible for ongoing maintenance of and access to the document.","comment":"Identifies the logical organization (software system, vendor, or department) to go to find the current version, where to report issues, etc. This is different from the physical location (URL, disk drive, or server) of the document, which is the technical location of the document, which host may be delegated to the management of some other organization.","min":0,"max":"1","base":{"path":"DocumentReference.custodian","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"fhircomposition","map":"Composition.custodian"},{"identity":"rim","map":".participation[typeCode=\"RCV\"].role[classCode=\"CUST\"].scoper[classCode=\"ORG\" and determinerCode=\"INST\"]"}]},{"id":"DocumentReference.relatesTo","path":"DocumentReference.relatesTo","short":"Relationships to other documents","definition":"Relationships that this document has with other document references that already exist.","comment":"This element is labeled as a modifier because documents that append to other documents are incomplete on their own.","min":0,"max":"*","base":{"path":"DocumentReference.relatesTo","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"fhircomposition","map":"Composition.relatesTo"},{"identity":"rim","map":".outboundRelationship"},{"identity":"xds","map":"DocumentEntry Associations"}]},{"id":"DocumentReference.relatesTo.id","path":"DocumentReference.relatesTo.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DocumentReference.relatesTo.extension","path":"DocumentReference.relatesTo.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DocumentReference.relatesTo.modifierExtension","path":"DocumentReference.relatesTo.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DocumentReference.relatesTo.code","path":"DocumentReference.relatesTo.code","short":"replaces | transforms | signs | appends","definition":"The type of relationship that this document has with anther document.","comment":"If this document appends another document, then the document cannot be fully understood without also accessing the referenced document.","min":1,"max":"1","base":{"path":"DocumentReference.relatesTo.code","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DocumentRelationshipType"}],"strength":"required","description":"The type of relationship between documents.","valueSet":"http://hl7.org/fhir/ValueSet/document-relationship-type|4.0.1"},"mapping":[{"identity":"fhircomposition","map":"Composition.relatesTo.code"},{"identity":"rim","map":".outboundRelationship.typeCode"},{"identity":"xds","map":"DocumentEntry Associations type"}]},{"id":"DocumentReference.relatesTo.target","path":"DocumentReference.relatesTo.target","short":"Target of the relationship","definition":"The target document of this relationship.","min":1,"max":"1","base":{"path":"DocumentReference.relatesTo.target","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/DocumentReference"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"fhircomposition","map":"Composition.relatesTo.target"},{"identity":"rim","map":".target[classCode=\"DOC\", moodCode=\"EVN\"].id"},{"identity":"xds","map":"DocumentEntry Associations reference"}]},{"id":"DocumentReference.description","path":"DocumentReference.description","short":"Human-readable description","definition":"Human-readable description of the source document.","comment":"What the document is about, a terse summary of the document.","requirements":"Helps humans to assess whether the document is of interest.","min":0,"max":"1","base":{"path":"DocumentReference.description","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"TXA-25"},{"identity":"rim","map":".outboundRelationship[typeCode=\"SUBJ\"].target.text"},{"identity":"xds","map":"DocumentEntry.comments"}]},{"id":"DocumentReference.securityLabel","path":"DocumentReference.securityLabel","short":"Document security-tags","definition":"A set of Security-Tag codes specifying the level of privacy/security of the Document. Note that DocumentReference.meta.security contains the security labels of the \"reference\" to the document, while DocumentReference.securityLabel contains a snapshot of the security labels on the document the reference refers to.","comment":"The confidentiality codes can carry multiple vocabulary items. HL7 has developed an understanding of security and privacy tags that might be desirable in a Document Sharing environment, called HL7 Healthcare Privacy and Security Classification System (HCS). The following specification is recommended but not mandated, as the vocabulary bindings are an administrative domain responsibility. The use of this method is up to the policy domain such as the XDS Affinity Domain or other Trust Domain where all parties including sender and recipients are trusted to appropriately tag and enforce. \n\nIn the HL7 Healthcare Privacy and Security Classification (HCS) there are code systems specific to Confidentiality, Sensitivity, Integrity, and Handling Caveats. Some values would come from a local vocabulary as they are related to workflow roles and special projects.","requirements":"Use of the Health Care Privacy/Security Classification (HCS) system of security-tag use is recommended.","min":0,"max":"*","base":{"path":"DocumentReference.securityLabel","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"SecurityLabels"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"extensible","description":"Security Labels from the Healthcare Privacy and Security Classification System.","valueSet":"http://hl7.org/fhir/ValueSet/security-labels"},"mapping":[{"identity":"fhircomposition","map":"Composition.confidentiality, Composition.meta.security"},{"identity":"v2","map":"TXA-18"},{"identity":"rim","map":".confidentialityCode"},{"identity":"xds","map":"DocumentEntry.confidentialityCode"},{"identity":"cda","map":"ClinicalDocument/confidentialityCode/@code"}]},{"id":"DocumentReference.content","path":"DocumentReference.content","short":"Document referenced","definition":"The document and format referenced. There may be multiple content element repetitions, each with a different format.","min":1,"max":"1","base":{"path":"DocumentReference.content","min":1,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"fhircomposition","map":"Bundle(Composition+*)"},{"identity":"rim","map":"document.text"}]},{"id":"DocumentReference.content.id","path":"DocumentReference.content.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DocumentReference.content.extension","path":"DocumentReference.content.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DocumentReference.content.modifierExtension","path":"DocumentReference.content.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DocumentReference.content.attachment","path":"DocumentReference.content.attachment","short":"Where to access the document","definition":"The document or URL of the document along with critical metadata to prove content has integrity.","min":1,"max":"1","base":{"path":"DocumentReference.content.attachment","min":1,"max":"1"},"type":[{"code":"Attachment"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"us-core-6","severity":"error","human":"DocumentReference.content.attachment.url or DocumentReference.content.attachment.data or both SHALL be present.","expression":"url.exists() or data.exists()","xpath":"f:url or f:content"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"fhircomposition","map":"Composition.language, \nComposition.title, \nComposition.date"},{"identity":"v2","map":"TXA-3 for mime type"},{"identity":"rim","map":"document.text"},{"identity":"xds","map":"DocumentEntry.mimeType, DocumentEntry.languageCode, DocumentEntry.URI, DocumentEntry.size, DocumentEntry.hash, DocumentEntry.title, DocumentEntry.creationTime"},{"identity":"cda","map":"ClinicalDocument/languageCode, ClinicalDocument/title, ClinicalDocument/date"}]},{"id":"DocumentReference.content.attachment.id","path":"DocumentReference.content.attachment.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DocumentReference.content.attachment.extension","path":"DocumentReference.content.attachment.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DocumentReference.content.attachment.contentType","path":"DocumentReference.content.attachment.contentType","short":"Mime type of the content, with charset etc.","definition":"Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.","requirements":"Processors of the data need to be able to know how to interpret the data.","min":1,"max":"1","base":{"path":"Attachment.contentType","min":0,"max":"1"},"type":[{"code":"code"}],"example":[{"label":"General","valueCode":"text/plain; charset=UTF-8, image/png"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MimeType"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"required","description":"The mime type of an attachment. Any valid mime type is allowed.","valueSet":"http://hl7.org/fhir/ValueSet/mimetypes|4.0.1"},"mapping":[{"identity":"v2","map":"ED.2+ED.3/RP.2+RP.3. Note conversion may be needed if old style values are being used"},{"identity":"rim","map":"./mediaType, ./charset"}]},{"id":"DocumentReference.content.attachment.language","path":"DocumentReference.content.attachment.language","short":"Human language of the content (BCP-47)","definition":"The human language of the content. The value can be any valid value according to BCP 47.","requirements":"Users need to be able to choose between the languages in a set of attachments.","min":0,"max":"1","base":{"path":"Attachment.language","min":0,"max":"1"},"type":[{"code":"code"}],"example":[{"label":"General","valueCode":"en-AU"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"},"mapping":[{"identity":"rim","map":"./language"}]},{"id":"DocumentReference.content.attachment.data","path":"DocumentReference.content.attachment.data","short":"Data inline, base64ed","definition":"The actual data of the attachment - a sequence of bytes, base64 encoded.","comment":"The base64-encoded data SHALL be expressed in the same character set as the base resource XML or JSON.","requirements":"The data needs to able to be transmitted inline.","min":0,"max":"1","base":{"path":"Attachment.data","min":0,"max":"1"},"type":[{"code":"base64Binary"}],"condition":["us-core-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"ED.5"},{"identity":"rim","map":"./data"}]},{"id":"DocumentReference.content.attachment.url","path":"DocumentReference.content.attachment.url","short":"Uri where the data can be found","definition":"A location where the data can be accessed.","comment":"If both data and url are provided, the url SHALL point to the same content as the data contains. Urls may be relative references or may reference transient locations such as a wrapping envelope using cid: though this has ramifications for using signatures. Relative URLs are interpreted relative to the service url, like a resource reference, rather than relative to the resource itself. If a URL is provided, it SHALL resolve to actual data.","requirements":"The data needs to be transmitted by reference.","min":0,"max":"1","base":{"path":"Attachment.url","min":0,"max":"1"},"type":[{"code":"url"}],"example":[{"label":"General","valueUrl":"http://www.acme.com/logo-small.png"}],"condition":["us-core-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"RP.1+RP.2 - if they refer to a URL (see v2.6)"},{"identity":"rim","map":"./reference/literal"}]},{"id":"DocumentReference.content.attachment.size","path":"DocumentReference.content.attachment.size","short":"Number of bytes of content (if url provided)","definition":"The number of bytes of data that make up this attachment (before base64 encoding, if that is done).","comment":"The number of bytes is redundant if the data is provided as a base64binary, but is useful if the data is provided as a url reference.","requirements":"Representing the size allows applications to determine whether they should fetch the content automatically in advance, or refuse to fetch it at all.","min":0,"max":"1","base":{"path":"Attachment.size","min":0,"max":"1"},"type":[{"code":"unsignedInt"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"N/A (needs data type R3 proposal)"}]},{"id":"DocumentReference.content.attachment.hash","path":"DocumentReference.content.attachment.hash","short":"Hash of the data (sha-1, base64ed)","definition":"The calculated hash of the data using SHA-1. Represented using base64.","comment":"The hash is calculated on the data prior to base64 encoding, if the data is based64 encoded. The hash is not intended to support digital signatures. Where protection against malicious threats a digital signature should be considered, see [Provenance.signature](http://hl7.org/fhir/R4/provenance-definitions.html#Provenance.signature) for mechanism to protect a resource with a digital signature.","requirements":"Included so that applications can verify that the contents of a location have not changed due to technical failures (e.g., storage rot, transport glitch, incorrect version).","min":0,"max":"1","base":{"path":"Attachment.hash","min":0,"max":"1"},"type":[{"code":"base64Binary"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".integrityCheck[parent::ED/integrityCheckAlgorithm=\"SHA-1\"]"}]},{"id":"DocumentReference.content.attachment.title","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"DocumentReference.content.attachment.title","short":"Label to display in place of the data","definition":"A label or set of text to display in place of the data.","requirements":"Applications need a label to display to a human user in place of the actual data if the data cannot be rendered or perceived by the viewer.","min":0,"max":"1","base":{"path":"Attachment.title","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"Official Corporate Logo"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"./title/data"}]},{"id":"DocumentReference.content.attachment.creation","path":"DocumentReference.content.attachment.creation","short":"Date attachment was first created","definition":"The date that the attachment was first created.","requirements":"This is often tracked as an integrity issue for use of the attachment.","min":0,"max":"1","base":{"path":"Attachment.creation","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"N/A (needs data type R3 proposal)"}]},{"id":"DocumentReference.content.format","path":"DocumentReference.content.format","short":"Format/content rules for the document","definition":"An identifier of the document encoding, structure, and template that the document conforms to beyond the base format indicated in the mimeType.","comment":"Note that while IHE mostly issues URNs for format types, not all documents can be identified by a URI.","min":0,"max":"1","base":{"path":"DocumentReference.content.format","min":0,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/ValueSet/formatcodes"},"mapping":[{"identity":"fhircomposition","map":"Composition.meta.profile"},{"identity":"rim","map":"document.text"},{"identity":"xds","map":"DocumentEntry.formatCode"},{"identity":"cda","map":"derived from the IHE Profile or Implementation Guide templateID"}]},{"id":"DocumentReference.context","path":"DocumentReference.context","short":"Clinical context of document","definition":"The clinical context in which the document was prepared.","comment":"These values are primarily added to help with searching for interesting/relevant documents.","min":0,"max":"1","base":{"path":"DocumentReference.context","min":0,"max":"1"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"outboundRelationship[typeCode=\"SUBJ\"].target[classCode<'ACT']"}]},{"id":"DocumentReference.context.id","path":"DocumentReference.context.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DocumentReference.context.extension","path":"DocumentReference.context.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"DocumentReference.context.modifierExtension","path":"DocumentReference.context.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"DocumentReference.context.encounter","path":"DocumentReference.context.encounter","short":"Context of the document content","definition":"Describes the clinical encounter or type of care that the document content is associated with.","min":0,"max":"1","base":{"path":"DocumentReference.context.encounter","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"fhircomposition","map":"Composition.encounter"},{"identity":"rim","map":"unique(highest(./outboundRelationship[typeCode=\"SUBJ\" and isNormalActRelationship()], priorityNumber)/target[moodCode=\"EVN\" and classCode=(\"ENC\", \"PCPR\") and isNormalAct])"}]},{"id":"DocumentReference.context.event","path":"DocumentReference.context.event","short":"Main clinical acts documented","definition":"This list of codes represents the main clinical acts, such as a colonoscopy or an appendectomy, being documented. In some cases, the event is inherent in the type Code, such as a \"History and Physical Report\" in which the procedure being documented is necessarily a \"History and Physical\" act.","comment":"An event can further specialize the act inherent in the type, such as where it is simply \"Procedure Report\" and the procedure was a \"colonoscopy\". If one or more event codes are included, they shall not conflict with the values inherent in the class or type elements as such a conflict would create an ambiguous situation.","min":0,"max":"*","base":{"path":"DocumentReference.context.event","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DocumentEventType"}],"strength":"example","description":"This list of codes represents the main clinical acts being documented.","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActCode"},"mapping":[{"identity":"fhircomposition","map":"Composition.event.code"},{"identity":"rim","map":".code"},{"identity":"xds","map":"DocumentEntry.eventCodeList"}]},{"id":"DocumentReference.context.period","path":"DocumentReference.context.period","short":"Time of service that is being documented","definition":"The time period over which the service that is described by the document was provided.","min":0,"max":"1","base":{"path":"DocumentReference.context.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"fhircomposition","map":"Composition.event.period"},{"identity":"rim","map":".effectiveTime"},{"identity":"xds","map":"DocumentEntry.serviceStartTime, DocumentEntry.serviceStopTime"},{"identity":"cda","map":"ClinicalDocument/documentationOf/\nserviceEvent/effectiveTime/low/\n@value --> ClinicalDocument/documentationOf/\nserviceEvent/effectiveTime/high/\n@value"}]},{"id":"DocumentReference.context.facilityType","path":"DocumentReference.context.facilityType","short":"Kind of facility where patient was seen","definition":"The kind of facility where the patient was seen.","min":0,"max":"1","base":{"path":"DocumentReference.context.facilityType","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DocumentC80FacilityType"}],"strength":"example","description":"XDS Facility Type.","valueSet":"http://hl7.org/fhir/ValueSet/c80-facilitycodes"},"mapping":[{"identity":"fhircomposition","map":"usually from a mapping to a local ValueSet"},{"identity":"rim","map":".participation[typeCode=\"LOC\"].role[classCode=\"DSDLOC\"].code"},{"identity":"xds","map":"DocumentEntry.healthcareFacilityTypeCode"},{"identity":"cda","map":"usually a mapping to a local ValueSet. Must be consistent with /clinicalDocument/code"}]},{"id":"DocumentReference.context.practiceSetting","path":"DocumentReference.context.practiceSetting","short":"Additional details about where the content was created (e.g. clinical specialty)","definition":"This property may convey specifics about the practice setting where the content was created, often reflecting the clinical specialty.","comment":"This element should be based on a coarse classification system for the class of specialty practice. Recommend the use of the classification system for Practice Setting, such as that described by the Subject Matter Domain in LOINC.","requirements":"This is an important piece of metadata that providers often rely upon to quickly sort and/or filter out to find specific content.","min":0,"max":"1","base":{"path":"DocumentReference.context.practiceSetting","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DocumentC80PracticeSetting"}],"strength":"example","description":"Additional details about where the content was created (e.g. clinical specialty).","valueSet":"http://hl7.org/fhir/ValueSet/c80-practice-codes"},"mapping":[{"identity":"fhircomposition","map":"usually from a mapping to a local ValueSet"},{"identity":"rim","map":".participation[typeCode=\"LOC\"].role[classCode=\"DSDLOC\"].code"},{"identity":"xds","map":"DocumentEntry.practiceSettingCode"},{"identity":"cda","map":"usually from a mapping to a local ValueSet"}]},{"id":"DocumentReference.context.sourcePatientInfo","path":"DocumentReference.context.sourcePatientInfo","short":"Patient demographics from source","definition":"The Patient Information as known when the document was published. May be a reference to a version specific, or contained.","min":0,"max":"1","base":{"path":"DocumentReference.context.sourcePatientInfo","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"fhircomposition","map":"Composition.subject"},{"identity":"rim","map":".participation[typeCode=\"SBJ\"].role[typeCode=\"PAT\"]"},{"identity":"xds","map":"DocumentEntry.sourcePatientInfo, DocumentEntry.sourcePatientId"},{"identity":"cda","map":"ClinicalDocument/recordTarget/"}]},{"id":"DocumentReference.context.related","path":"DocumentReference.context.related","short":"Related identifiers or resources","definition":"Related identifiers or resources associated with the DocumentReference.","comment":"May be identifiers or resources that caused the DocumentReference or referenced Document to be created.","min":0,"max":"*","base":{"path":"DocumentReference.context.related","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"fhircomposition","map":"Composition.event.detail"},{"identity":"rim","map":"./outboundRelationship[typeCode=\"PERT\" and isNormalActRelationship()] / target[isNormalAct]"},{"identity":"xds","map":"DocumentEntry.referenceIdList"},{"identity":"cda","map":"ClinicalDocument/relatedDocument"}]}]},"differential":{"element":[{"id":"DocumentReference","path":"DocumentReference","definition":"This is a basic constraint on DocumentRefernce for use in the US Core IG.","mustSupport":false},{"id":"DocumentReference.identifier","path":"DocumentReference.identifier","min":0,"max":"*","mustSupport":true},{"id":"DocumentReference.status","path":"DocumentReference.status","min":1,"max":"1","mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/document-reference-status"}},{"id":"DocumentReference.type","path":"DocumentReference.type","min":1,"max":"1","mustSupport":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-minValueSet","valueCanonical":"http://hl7.org/fhir/us/core/ValueSet/us-core-clinical-note-type"}],"strength":"required","description":"All LOINC values whose SCALE is DOC in the LOINC database and the HL7 v3 Code System NullFlavor concept 'unknown'","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-type"}},{"id":"DocumentReference.category","path":"DocumentReference.category","min":1,"max":"*","mustSupport":true,"binding":{"strength":"extensible","description":"The US Core DocumentReferences Type Value Set is a 'starter set' of categories supported for fetching and storing clinical notes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-category"}},{"id":"DocumentReference.subject","path":"DocumentReference.subject","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true},{"id":"DocumentReference.date","path":"DocumentReference.date","min":0,"max":"1","mustSupport":true},{"id":"DocumentReference.author","path":"DocumentReference.author","min":0,"max":"*","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"mustSupport":true},{"id":"DocumentReference.custodian","path":"DocumentReference.custodian","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"mustSupport":true},{"id":"DocumentReference.content","path":"DocumentReference.content","min":1,"max":"1","mustSupport":true},{"id":"DocumentReference.content.attachment","path":"DocumentReference.content.attachment","min":1,"max":"1","constraint":[{"key":"us-core-6","severity":"error","human":"DocumentReference.content.attachment.url or DocumentReference.content.attachment.data or both SHALL be present.","expression":"url.exists() or data.exists()","xpath":"f:url or f:content"}],"mustSupport":true},{"id":"DocumentReference.content.attachment.contentType","path":"DocumentReference.content.attachment.contentType","min":1,"max":"1","mustSupport":true},{"id":"DocumentReference.content.attachment.data","path":"DocumentReference.content.attachment.data","min":0,"max":"1","condition":["us-core-6"],"mustSupport":true},{"id":"DocumentReference.content.attachment.url","path":"DocumentReference.content.attachment.url","min":0,"max":"1","condition":["us-core-6"],"mustSupport":true},{"id":"DocumentReference.content.format","path":"DocumentReference.content.format","min":0,"max":"1","mustSupport":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/ValueSet/formatcodes"}},{"id":"DocumentReference.context","path":"DocumentReference.context","min":0,"max":"1","mustSupport":true},{"id":"DocumentReference.context.encounter","path":"DocumentReference.context.encounter","min":0,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter"]}],"mustSupport":true},{"id":"DocumentReference.context.period","path":"DocumentReference.context.period","mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-encounter.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-encounter.json new file mode 100755 index 000000000..4f832e210 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-encounter.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-encounter","text":{"status":"generated","div":""},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter","version":"3.1.0","name":"USCoreEncounterProfile","title":"US Core Encounter Profile","status":"active","experimental":false,"date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"The Encounter referenced in the US Core profiles.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"}],"kind":"resource","abstract":false,"type":"Encounter","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Encounter","derivation":"constraint","snapshot":{"element":[{"id":"Encounter","path":"Encounter","short":"An interaction during which services are provided to the patient","definition":"This is basic constraint on Encounter for use in US Core resources.","alias":["Visit"],"min":0,"max":"*","base":{"path":"Encounter","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"rim","map":"Encounter[@moodCode='EVN']"}]},{"id":"Encounter.id","path":"Encounter.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Encounter.meta","path":"Encounter.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Encounter.implicitRules","path":"Encounter.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Encounter.language","path":"Encounter.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Encounter.text","path":"Encounter.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Encounter.contained","path":"Encounter.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Encounter.extension","path":"Encounter.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Encounter.modifierExtension","path":"Encounter.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Encounter.identifier","path":"Encounter.identifier","short":"Identifier(s) by which this encounter is known","definition":"Identifier(s) by which this encounter is known.","min":0,"max":"*","base":{"path":"Encounter.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PV1-19"},{"identity":"rim","map":".id"}]},{"id":"Encounter.identifier.id","path":"Encounter.identifier.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.identifier.extension","path":"Encounter.identifier.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.identifier.use","path":"Encounter.identifier.use","short":"usual | official | temp | secondary | old (If known)","definition":"The purpose of this identifier.","comment":"Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.","requirements":"Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.","min":0,"max":"1","base":{"path":"Identifier.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary id for a permanent one.","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"IdentifierUse"}],"strength":"required","description":"Identifies the purpose for this identifier, if known .","valueSet":"http://hl7.org/fhir/ValueSet/identifier-use|4.0.1"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"Role.code or implied by context"}]},{"id":"Encounter.identifier.type","path":"Encounter.identifier.type","short":"Description of identifier","definition":"A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.","comment":"This element deals only with general categories of identifiers. It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.","requirements":"Allows users to make use of identifiers when the identifier system is not known.","min":0,"max":"1","base":{"path":"Identifier.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"IdentifierType"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"extensible","description":"A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.","valueSet":"http://hl7.org/fhir/ValueSet/identifier-type"},"mapping":[{"identity":"v2","map":"CX.5"},{"identity":"rim","map":"Role.code or implied by context"}]},{"id":"Encounter.identifier.system","path":"Encounter.identifier.system","short":"The namespace for the identifier value","definition":"Establishes the namespace for the value - that is, a URL that describes a set values that are unique.","comment":"Identifier.system is always case sensitive.","requirements":"There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.","min":1,"max":"1","base":{"path":"Identifier.system","min":0,"max":"1"},"type":[{"code":"uri"}],"example":[{"label":"General","valueUri":"http://www.acme.com/identifiers/patient"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.4 / EI-2-4"},{"identity":"rim","map":"II.root or Role.id.root"},{"identity":"servd","map":"./IdentifierType"}]},{"id":"Encounter.identifier.value","path":"Encounter.identifier.value","short":"The value that is unique","definition":"The portion of the identifier typically relevant to the user and which is unique within the context of the system.","comment":"If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the [Rendered Value extension](http://hl7.org/fhir/R4/extension-rendered-value.html). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe.","min":1,"max":"1","base":{"path":"Identifier.value","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"123456"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.1 / EI.1"},{"identity":"rim","map":"II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)"},{"identity":"servd","map":"./Value"}]},{"id":"Encounter.identifier.period","path":"Encounter.identifier.period","short":"Time period when id is/was valid for use","definition":"Time period during which identifier is/was valid for use.","min":0,"max":"1","base":{"path":"Identifier.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.7 + CX.8"},{"identity":"rim","map":"Role.effectiveTime or implied by context"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Encounter.identifier.assigner","path":"Encounter.identifier.assigner","short":"Organization that issued id (may be just text)","definition":"Organization that issued/manages the identifier.","comment":"The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization.","min":0,"max":"1","base":{"path":"Identifier.assigner","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.4 / (CX.4,CX.9,CX.10)"},{"identity":"rim","map":"II.assigningAuthorityName but note that this is an improper use by the definition of the field. Also Role.scoper"},{"identity":"servd","map":"./IdentifierIssuingAuthority"}]},{"id":"Encounter.status","path":"Encounter.status","short":"planned | arrived | triaged | in-progress | onleave | finished | cancelled +","definition":"planned | arrived | triaged | in-progress | onleave | finished | cancelled +.","comment":"Note that internal business rules will determine the appropriate transitions that may occur between statuses (and also classes).","min":1,"max":"1","base":{"path":"Encounter.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"EncounterStatus"}],"strength":"required","description":"Current state of the encounter.","valueSet":"http://hl7.org/fhir/ValueSet/encounter-status|4.0.1"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"No clear equivalent in HL7 v2; active/finished could be inferred from PV1-44, PV1-45, PV2-24; inactive could be inferred from PV2-16"},{"identity":"rim","map":".statusCode"}]},{"id":"Encounter.statusHistory","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name","valueString":"StatusHistory"}],"path":"Encounter.statusHistory","short":"List of past encounter statuses","definition":"The status history permits the encounter resource to contain the status history without needing to read through the historical versions of the resource, or even have the server store them.","comment":"The current status is always found in the current version of the resource, not the status history.","min":0,"max":"*","base":{"path":"Encounter.statusHistory","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.statusHistory.id","path":"Encounter.statusHistory.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.statusHistory.extension","path":"Encounter.statusHistory.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.statusHistory.modifierExtension","path":"Encounter.statusHistory.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Encounter.statusHistory.status","path":"Encounter.statusHistory.status","short":"planned | arrived | triaged | in-progress | onleave | finished | cancelled +","definition":"planned | arrived | triaged | in-progress | onleave | finished | cancelled +.","min":1,"max":"1","base":{"path":"Encounter.statusHistory.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"EncounterStatus"}],"strength":"required","description":"Current state of the encounter.","valueSet":"http://hl7.org/fhir/ValueSet/encounter-status|4.0.1"},"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.statusHistory.period","path":"Encounter.statusHistory.period","short":"The time that the episode was in the specified status","definition":"The time that the episode was in the specified status.","min":1,"max":"1","base":{"path":"Encounter.statusHistory.period","min":1,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.class","path":"Encounter.class","short":"Classification of patient encounter","definition":"Concepts representing classification of patient encounter such as ambulatory (outpatient), inpatient, emergency, home health or others due to local variations.","min":1,"max":"1","base":{"path":"Encounter.class","min":1,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"EncounterClass"}],"strength":"extensible","description":"Classification of the encounter.","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActEncounterCode"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"PV1-2"},{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ].source[classCode=LIST].code"}]},{"id":"Encounter.classHistory","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name","valueString":"ClassHistory"}],"path":"Encounter.classHistory","short":"List of past encounter classes","definition":"The class history permits the tracking of the encounters transitions without needing to go through the resource history. This would be used for a case where an admission starts of as an emergency encounter, then transitions into an inpatient scenario. Doing this and not restarting a new encounter ensures that any lab/diagnostic results can more easily follow the patient and not require re-processing and not get lost or cancelled during a kind of discharge from emergency to inpatient.","min":0,"max":"*","base":{"path":"Encounter.classHistory","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.classHistory.id","path":"Encounter.classHistory.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.classHistory.extension","path":"Encounter.classHistory.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.classHistory.modifierExtension","path":"Encounter.classHistory.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Encounter.classHistory.class","path":"Encounter.classHistory.class","short":"inpatient | outpatient | ambulatory | emergency +","definition":"inpatient | outpatient | ambulatory | emergency +.","min":1,"max":"1","base":{"path":"Encounter.classHistory.class","min":1,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"EncounterClass"}],"strength":"extensible","description":"Classification of the encounter.","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActEncounterCode"},"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.classHistory.period","path":"Encounter.classHistory.period","short":"The time that the episode was in the specified class","definition":"The time that the episode was in the specified class.","min":1,"max":"1","base":{"path":"Encounter.classHistory.period","min":1,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.type","path":"Encounter.type","short":"Specific type of encounter","definition":"Specific type of encounter (e.g. e-mail consultation, surgical day-care, skilled nursing, rehabilitation).","comment":"Since there are many ways to further classify encounters, this element is 0..*.","min":1,"max":"*","base":{"path":"Encounter.type","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Valueset to describe the Encounter Type","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-encounter-type"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"PV1-4 / PV1-18"},{"identity":"rim","map":".code"}]},{"id":"Encounter.serviceType","path":"Encounter.serviceType","short":"Specific type of service","definition":"Broad categorization of the service that is to be provided (e.g. cardiology).","min":0,"max":"1","base":{"path":"Encounter.serviceType","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"EncounterServiceType"}],"strength":"example","description":"Broad categorization of the service that is to be provided.","valueSet":"http://hl7.org/fhir/ValueSet/service-type"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"v2","map":"PV1-10"},{"identity":"rim","map":"n/a"}]},{"id":"Encounter.priority","path":"Encounter.priority","short":"Indicates the urgency of the encounter","definition":"Indicates the urgency of the encounter.","min":0,"max":"1","base":{"path":"Encounter.priority","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Priority"}],"strength":"example","description":"Indicates the urgency of the encounter.","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActPriority"},"mapping":[{"identity":"w5","map":"FiveWs.grade"},{"identity":"v2","map":"PV2-25"},{"identity":"rim","map":".priorityCode"}]},{"id":"Encounter.subject","path":"Encounter.subject","short":"The patient or group present at the encounter","definition":"The patient or group present at the encounter.","comment":"While the encounter is always about the patient, the patient might not actually be known in all contexts of use, and there may be a group of patients that could be anonymous (such as in a group therapy for Alcoholics Anonymous - where the recording of the encounter could be used for billing on the number of people/staff and not important to the context of the specific patients) or alternately in veterinary care a herd of sheep receiving treatment (where the animals are not individually tracked).","alias":["patient"],"min":1,"max":"1","base":{"path":"Encounter.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":".participation[typeCode=SBJ]/role[classCode=PAT]"},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"Encounter.episodeOfCare","path":"Encounter.episodeOfCare","short":"Episode(s) of care that this encounter should be recorded against","definition":"Where a specific encounter should be classified as a part of a specific episode(s) of care this field should be used. This association can facilitate grouping of related encounters together for a specific purpose, such as government reporting, issue tracking, association via a common problem. The association is recorded on the encounter as these are typically created after the episode of care and grouped on entry rather than editing the episode of care to append another encounter to it (the episode of care could span years).","min":0,"max":"*","base":{"path":"Encounter.episodeOfCare","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1-54, PV1-53"},{"identity":"rim","map":"n/a"}]},{"id":"Encounter.basedOn","path":"Encounter.basedOn","short":"The ServiceRequest that initiated this encounter","definition":"The request this encounter satisfies (e.g. incoming referral or procedure request).","alias":["incomingReferral"],"min":0,"max":"*","base":{"path":"Encounter.basedOn","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/ServiceRequest"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.basedOn"},{"identity":"rim","map":".reason.ClinicalDocument"}]},{"id":"Encounter.participant","path":"Encounter.participant","short":"List of participants involved in the encounter","definition":"The list of people responsible for providing the service.","min":0,"max":"*","base":{"path":"Encounter.participant","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer"},{"identity":"v2","map":"ROL"},{"identity":"rim","map":".participation[typeCode=PFM]"}]},{"id":"Encounter.participant.id","path":"Encounter.participant.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.participant.extension","path":"Encounter.participant.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.participant.modifierExtension","path":"Encounter.participant.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Encounter.participant.type","path":"Encounter.participant.type","short":"Role of participant in encounter","definition":"Role of participant in encounter.","comment":"The participant type indicates how an individual participates in an encounter. It includes non-practitioner participants, and for practitioners this is to describe the action type in the context of this encounter (e.g. Admitting Dr, Attending Dr, Translator, Consulting Dr). This is different to the practitioner roles which are functional roles, derived from terms of employment, education, licensing, etc.","min":0,"max":"*","base":{"path":"Encounter.participant.type","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ParticipantType"}],"strength":"extensible","description":"Role of participant in encounter.","valueSet":"http://hl7.org/fhir/ValueSet/encounter-participant-type"},"mapping":[{"identity":"workflow","map":"Event.performer.function"},{"identity":"v2","map":"ROL-3 (or maybe PRT-4)"},{"identity":"rim","map":".functionCode"}]},{"id":"Encounter.participant.period","path":"Encounter.participant.period","short":"Period of time during the encounter that the participant participated","definition":"The period of time that the specified participant participated in the encounter. These can overlap or be sub-sets of the overall encounter's period.","min":0,"max":"1","base":{"path":"Encounter.participant.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"ROL-5, ROL-6 (or maybe PRT-5)"},{"identity":"rim","map":".time"}]},{"id":"Encounter.participant.individual","path":"Encounter.participant.individual","short":"Persons involved in the encounter other than the patient","definition":"Persons involved in the encounter other than the patient.","min":0,"max":"1","base":{"path":"Encounter.participant.individual","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.who"},{"identity":"v2","map":"ROL-4"},{"identity":"rim","map":".role"}]},{"id":"Encounter.appointment","path":"Encounter.appointment","short":"The appointment that scheduled this encounter","definition":"The appointment that scheduled this encounter.","min":0,"max":"*","base":{"path":"Encounter.appointment","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Appointment"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.basedOn"},{"identity":"v2","map":"SCH-1 / SCH-2"},{"identity":"rim","map":".outboundRelationship[typeCode=FLFS].target[classCode=ENC, moodCode=APT]"}]},{"id":"Encounter.period","path":"Encounter.period","short":"The start and end time of the encounter","definition":"The start and end time of the encounter.","comment":"If not (yet) known, the end of the Period may be omitted.","min":0,"max":"1","base":{"path":"Encounter.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"PV1-44, PV1-45"},{"identity":"rim","map":".effectiveTime (low & high)"}]},{"id":"Encounter.length","path":"Encounter.length","short":"Quantity of time the encounter lasted (less time absent)","definition":"Quantity of time the encounter lasted. This excludes the time during leaves of absence.","comment":"May differ from the time the Encounter.period lasted because of leave of absence.","min":0,"max":"1","base":{"path":"Encounter.length","min":0,"max":"1"},"type":[{"code":"Duration"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"v2","map":"(PV1-45 less PV1-44) iff ( (PV1-44 not empty) and (PV1-45 not empty) ); units in minutes"},{"identity":"rim","map":".lengthOfStayQuantity"}]},{"id":"Encounter.reasonCode","path":"Encounter.reasonCode","short":"Coded reason the encounter takes place","definition":"Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.","comment":"For systems that need to know which was the primary diagnosis, these will be marked with the standard extension primaryDiagnosis (which is a sequence value rather than a flag, 1 = primary diagnosis).","alias":["Indication","Admission diagnosis"],"min":0,"max":"*","base":{"path":"Encounter.reasonCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"EncounterReason"}],"strength":"preferred","description":"Reason why the encounter takes place.","valueSet":"http://hl7.org/fhir/ValueSet/encounter-reason"},"mapping":[{"identity":"workflow","map":"Event.reasonCode"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"v2","map":"EVN-4 / PV2-3 (note: PV2-3 is nominally constrained to inpatient admissions; HL7 v2 makes no vocabulary suggestions for PV2-3; would not expect PV2 segment or PV2-3 to be in use in all implementations )"},{"identity":"rim","map":".reasonCode"}]},{"id":"Encounter.reasonReference","path":"Encounter.reasonReference","short":"Reason the encounter takes place (reference)","definition":"Reason the encounter takes place, expressed as a code. For admissions, this can be used for a coded admission diagnosis.","comment":"For systems that need to know which was the primary diagnosis, these will be marked with the standard extension primaryDiagnosis (which is a sequence value rather than a flag, 1 = primary diagnosis).","alias":["Indication","Admission diagnosis"],"min":0,"max":"*","base":{"path":"Encounter.reasonReference","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Condition","http://hl7.org/fhir/StructureDefinition/Procedure","http://hl7.org/fhir/StructureDefinition/Observation","http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.reasonCode"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"v2","map":"EVN-4 / PV2-3 (note: PV2-3 is nominally constrained to inpatient admissions; HL7 v2 makes no vocabulary suggestions for PV2-3; would not expect PV2 segment or PV2-3 to be in use in all implementations )"},{"identity":"rim","map":".reasonCode"}]},{"id":"Encounter.diagnosis","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name","valueString":"Diagnosis"}],"path":"Encounter.diagnosis","short":"The list of diagnosis relevant to this encounter","definition":"The list of diagnosis relevant to this encounter.","min":0,"max":"*","base":{"path":"Encounter.diagnosis","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode=RSON]"}]},{"id":"Encounter.diagnosis.id","path":"Encounter.diagnosis.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.diagnosis.extension","path":"Encounter.diagnosis.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.diagnosis.modifierExtension","path":"Encounter.diagnosis.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Encounter.diagnosis.condition","path":"Encounter.diagnosis.condition","short":"The diagnosis or procedure relevant to the encounter","definition":"Reason the encounter takes place, as specified using information from another resource. For admissions, this is the admission diagnosis. The indication will typically be a Condition (with other resources referenced in the evidence.detail), or a Procedure.","comment":"For systems that need to know which was the primary diagnosis, these will be marked with the standard extension primaryDiagnosis (which is a sequence value rather than a flag, 1 = primary diagnosis).","alias":["Admission diagnosis","discharge diagnosis","indication"],"min":1,"max":"1","base":{"path":"Encounter.diagnosis.condition","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Condition","http://hl7.org/fhir/StructureDefinition/Procedure"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.reasonReference"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"v2","map":"Resources that would commonly referenced at Encounter.indication would be Condition and/or Procedure. These most closely align with DG1/PRB and PR1 respectively."},{"identity":"rim","map":".outboundRelationship[typeCode=RSON].target"}]},{"id":"Encounter.diagnosis.use","path":"Encounter.diagnosis.use","short":"Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …)","definition":"Role that this diagnosis has within the encounter (e.g. admission, billing, discharge …).","min":0,"max":"1","base":{"path":"Encounter.diagnosis.use","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DiagnosisRole"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"The type of diagnosis this condition represents.","valueSet":"http://hl7.org/fhir/ValueSet/diagnosis-role"},"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.diagnosis.rank","path":"Encounter.diagnosis.rank","short":"Ranking of the diagnosis (for each role type)","definition":"Ranking of the diagnosis (for each role type).","min":0,"max":"1","base":{"path":"Encounter.diagnosis.rank","min":0,"max":"1"},"type":[{"code":"positiveInt"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode=RSON].priority"}]},{"id":"Encounter.account","path":"Encounter.account","short":"The set of accounts that may be used for billing for this Encounter","definition":"The set of accounts that may be used for billing for this Encounter.","comment":"The billing system may choose to allocate billable items associated with the Encounter to different referenced Accounts based on internal business rules.","min":0,"max":"*","base":{"path":"Encounter.account","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Account"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".pertains.A_Account"}]},{"id":"Encounter.hospitalization","path":"Encounter.hospitalization","short":"Details about the admission to a healthcare service","definition":"Details about the admission to a healthcare service.","comment":"An Encounter may cover more than just the inpatient stay. Contexts such as outpatients, community clinics, and aged care facilities are also included.\r\rThe duration recorded in the period of this encounter covers the entire scope of this hospitalization record.","min":0,"max":"1","base":{"path":"Encounter.hospitalization","min":0,"max":"1"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode=COMP].target[classCode=ENC, moodCode=EVN]"}]},{"id":"Encounter.hospitalization.id","path":"Encounter.hospitalization.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.hospitalization.extension","path":"Encounter.hospitalization.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.hospitalization.modifierExtension","path":"Encounter.hospitalization.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Encounter.hospitalization.preAdmissionIdentifier","path":"Encounter.hospitalization.preAdmissionIdentifier","short":"Pre-admission identifier","definition":"Pre-admission identifier.","min":0,"max":"1","base":{"path":"Encounter.hospitalization.preAdmissionIdentifier","min":0,"max":"1"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PV1-5"},{"identity":"rim","map":".id"}]},{"id":"Encounter.hospitalization.origin","path":"Encounter.hospitalization.origin","short":"The location/organization from which the patient came before admission","definition":"The location/organization from which the patient came before admission.","min":0,"max":"1","base":{"path":"Encounter.hospitalization.origin","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location","http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".participation[typeCode=ORG].role"}]},{"id":"Encounter.hospitalization.admitSource","path":"Encounter.hospitalization.admitSource","short":"From where patient was admitted (physician referral, transfer)","definition":"From where patient was admitted (physician referral, transfer).","min":0,"max":"1","base":{"path":"Encounter.hospitalization.admitSource","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdmitSource"}],"strength":"preferred","description":"From where the patient was admitted.","valueSet":"http://hl7.org/fhir/ValueSet/encounter-admit-source"},"mapping":[{"identity":"v2","map":"PV1-14"},{"identity":"rim","map":".admissionReferralSourceCode"}]},{"id":"Encounter.hospitalization.reAdmission","path":"Encounter.hospitalization.reAdmission","short":"The type of hospital re-admission that has occurred (if any). If the value is absent, then this is not identified as a readmission","definition":"Whether this hospitalization is a readmission and why if known.","min":0,"max":"1","base":{"path":"Encounter.hospitalization.reAdmission","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ReAdmissionType"}],"strength":"example","description":"The reason for re-admission of this hospitalization encounter.","valueSet":"http://terminology.hl7.org/ValueSet/v2-0092"},"mapping":[{"identity":"v2","map":"PV1-13"},{"identity":"rim","map":"n/a"}]},{"id":"Encounter.hospitalization.dietPreference","path":"Encounter.hospitalization.dietPreference","short":"Diet preferences reported by the patient","definition":"Diet preferences reported by the patient.","comment":"For example, a patient may request both a dairy-free and nut-free diet preference (not mutually exclusive).","requirements":"Used to track patient's diet restrictions and/or preference. For a complete description of the nutrition needs of a patient during their stay, one should use the nutritionOrder resource which links to Encounter.","min":0,"max":"*","base":{"path":"Encounter.hospitalization.dietPreference","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"PatientDiet"}],"strength":"example","description":"Medical, cultural or ethical food preferences to help with catering requirements.","valueSet":"http://hl7.org/fhir/ValueSet/encounter-diet"},"mapping":[{"identity":"v2","map":"PV1-38"},{"identity":"rim","map":".outboundRelationship[typeCode=COMP].target[classCode=SBADM, moodCode=EVN, code=\"diet\"]"}]},{"id":"Encounter.hospitalization.specialCourtesy","path":"Encounter.hospitalization.specialCourtesy","short":"Special courtesies (VIP, board member)","definition":"Special courtesies (VIP, board member).","min":0,"max":"*","base":{"path":"Encounter.hospitalization.specialCourtesy","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Courtesies"}],"strength":"preferred","description":"Special courtesies.","valueSet":"http://hl7.org/fhir/ValueSet/encounter-special-courtesy"},"mapping":[{"identity":"v2","map":"PV1-16"},{"identity":"rim","map":".specialCourtesiesCode"}]},{"id":"Encounter.hospitalization.specialArrangement","path":"Encounter.hospitalization.specialArrangement","short":"Wheelchair, translator, stretcher, etc.","definition":"Any special requests that have been made for this hospitalization encounter, such as the provision of specific equipment or other things.","min":0,"max":"*","base":{"path":"Encounter.hospitalization.specialArrangement","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Arrangements"}],"strength":"preferred","description":"Special arrangements.","valueSet":"http://hl7.org/fhir/ValueSet/encounter-special-arrangements"},"mapping":[{"identity":"v2","map":"PV1-15 / OBR-30 / OBR-43"},{"identity":"rim","map":".specialArrangementCode"}]},{"id":"Encounter.hospitalization.destination","path":"Encounter.hospitalization.destination","short":"Location/organization to which the patient is discharged","definition":"Location/organization to which the patient is discharged.","min":0,"max":"1","base":{"path":"Encounter.hospitalization.destination","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location","http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PV1-37"},{"identity":"rim","map":".participation[typeCode=DST]"}]},{"id":"Encounter.hospitalization.dischargeDisposition","path":"Encounter.hospitalization.dischargeDisposition","short":"Category or kind of location after discharge","definition":"Category or kind of location after discharge.","min":0,"max":"1","base":{"path":"Encounter.hospitalization.dischargeDisposition","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DischargeDisp"}],"strength":"example","description":"Discharge Disposition.","valueSet":"http://hl7.org/fhir/ValueSet/encounter-discharge-disposition"},"mapping":[{"identity":"v2","map":"PV1-36"},{"identity":"rim","map":".dischargeDispositionCode"}]},{"id":"Encounter.location","path":"Encounter.location","short":"List of locations where the patient has been","definition":"List of locations where the patient has been during this encounter.","comment":"Virtual encounters can be recorded in the Encounter by specifying a location reference to a location of type \"kind\" such as \"client's home\" and an encounter.class = \"virtual\".","min":0,"max":"*","base":{"path":"Encounter.location","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".participation[typeCode=LOC]"}]},{"id":"Encounter.location.id","path":"Encounter.location.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.location.extension","path":"Encounter.location.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Encounter.location.modifierExtension","path":"Encounter.location.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Encounter.location.location","path":"Encounter.location.location","short":"Location the encounter takes place","definition":"The location where the encounter takes place.","min":1,"max":"1","base":{"path":"Encounter.location.location","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.location"},{"identity":"w5","map":"FiveWs.where[x]"},{"identity":"v2","map":"PV1-3 / PV1-6 / PV1-11 / PV1-42 / PV1-43"},{"identity":"rim","map":".role"}]},{"id":"Encounter.location.status","path":"Encounter.location.status","short":"planned | active | reserved | completed","definition":"The status of the participants' presence at the specified location during the period specified. If the participant is no longer at the location, then the period will have an end date/time.","comment":"When the patient is no longer active at a location, then the period end date is entered, and the status may be changed to completed.","min":0,"max":"1","base":{"path":"Encounter.location.status","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"EncounterLocationStatus"}],"strength":"required","description":"The status of the location.","valueSet":"http://hl7.org/fhir/ValueSet/encounter-location-status|4.0.1"},"mapping":[{"identity":"rim","map":".role.statusCode"}]},{"id":"Encounter.location.physicalType","path":"Encounter.location.physicalType","short":"The physical type of the location (usually the level in the location hierachy - bed room ward etc.)","definition":"This will be used to specify the required levels (bed/ward/room/etc.) desired to be recorded to simplify either messaging or query.","comment":"This information is de-normalized from the Location resource to support the easier understanding of the encounter resource and processing in messaging or query.\n\nThere may be many levels in the hierachy, and this may only pic specific levels that are required for a specific usage scenario.","min":0,"max":"1","base":{"path":"Encounter.location.physicalType","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"PhysicalType"}],"strength":"example","description":"Physical form of the location.","valueSet":"http://hl7.org/fhir/ValueSet/location-physical-type"}},{"id":"Encounter.location.period","path":"Encounter.location.period","short":"Time period during which the patient was present at the location","definition":"Time period during which the patient was present at the location.","min":0,"max":"1","base":{"path":"Encounter.location.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".time"}]},{"id":"Encounter.serviceProvider","path":"Encounter.serviceProvider","short":"The organization (facility) responsible for this encounter","definition":"The organization that is primarily responsible for this Encounter's services. This MAY be the same as the organization on the Patient record, however it could be different, such as if the actor performing the services was from an external organization (which may be billed seperately) for an external consultation. Refer to the example bundle showing an abbreviated set of Encounters for a colonoscopy.","min":0,"max":"1","base":{"path":"Encounter.serviceProvider","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"v2","map":"PL.6 & PL.1"},{"identity":"rim","map":".particiaption[typeCode=PFM].role"}]},{"id":"Encounter.partOf","path":"Encounter.partOf","short":"Another Encounter this encounter is part of","definition":"Another Encounter of which this encounter is a part of (administratively or in time).","comment":"This is also used for associating a child's encounter back to the mother's encounter.\r\rRefer to the Notes section in the Patient resource for further details.","min":0,"max":"1","base":{"path":"Encounter.partOf","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.partOf"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[classCode=COMP, moodCode=EVN]"}]}]},"differential":{"element":[{"id":"Encounter","path":"Encounter","definition":"This is basic constraint on Encounter for use in US Core resources.","alias":["Visit"],"mustSupport":false},{"id":"Encounter.identifier","path":"Encounter.identifier","min":0,"max":"*","type":[{"code":"Identifier"}],"mustSupport":true},{"id":"Encounter.identifier.system","path":"Encounter.identifier.system","min":1,"max":"1","type":[{"code":"uri"}],"mustSupport":true},{"id":"Encounter.identifier.value","path":"Encounter.identifier.value","min":1,"max":"1","type":[{"code":"string"}],"mustSupport":true},{"id":"Encounter.status","path":"Encounter.status","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true},{"id":"Encounter.class","path":"Encounter.class","min":1,"max":"1","type":[{"code":"Coding"}],"mustSupport":true},{"id":"Encounter.type","path":"Encounter.type","min":1,"max":"*","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","description":"Valueset to describe the Encounter Type","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-encounter-type"}},{"id":"Encounter.subject","path":"Encounter.subject","alias":["patient"],"min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true},{"id":"Encounter.participant","path":"Encounter.participant","min":0,"max":"*","mustSupport":true},{"id":"Encounter.participant.type","path":"Encounter.participant.type","min":0,"max":"*","type":[{"code":"CodeableConcept"}],"mustSupport":true},{"id":"Encounter.participant.period","path":"Encounter.participant.period","min":0,"max":"1","type":[{"code":"Period"}],"mustSupport":true},{"id":"Encounter.participant.individual","path":"Encounter.participant.individual","min":0,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner"]}],"mustSupport":true},{"id":"Encounter.period","path":"Encounter.period","min":0,"max":"1","type":[{"code":"Period"}],"mustSupport":true},{"id":"Encounter.reasonCode","path":"Encounter.reasonCode","alias":["Indication","Admission diagnosis"],"min":0,"max":"*","type":[{"code":"CodeableConcept"}],"mustSupport":true},{"id":"Encounter.hospitalization","path":"Encounter.hospitalization","min":0,"max":"1","mustSupport":true},{"id":"Encounter.hospitalization.dischargeDisposition","path":"Encounter.hospitalization.dischargeDisposition","min":0,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true},{"id":"Encounter.location","path":"Encounter.location","min":0,"max":"*","mustSupport":true},{"id":"Encounter.location.location","path":"Encounter.location.location","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-ethnicity.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-ethnicity.json new file mode 100755 index 000000000..309e42065 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-ethnicity.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-ethnicity","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Extension 0..1US Core ethnicity Extension
    \".\"\".\"\".\" extension:ombCategory S0..1ExtensionHispanic or Latino|Not Hispanic or Latino
    \".\"\".\"\".\"\".\" url 1..1uri"ombCategory"
    \".\"\".\"\".\"\".\" value[x] 1..1CodingBinding: OMB Ethnicity Categories (required)
    \".\"\".\"\".\" extension:detailed 0..*ExtensionExtended ethnicity codes
    \".\"\".\"\".\"\".\" url 1..1uri"detailed"
    \".\"\".\"\".\"\".\" value[x] 1..1CodingBinding: Detailed ethnicity (required)
    \".\"\".\"\".\" extension:text S1..1Extensionethnicity Text
    \".\"\".\"\".\"\".\" url 1..1uri"text"
    \".\"\".\"\".\"\".\" value[x] 1..1string
    \".\"\".\"\".\" url 1..1uri"http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"
    \".\"\".\"\".\" value[x] 0..0

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity","version":"3.1.0","name":"USCoreEthnicityExtension","title":"US Core Ethnicity Extension","status":"active","date":"2019-05-21T14:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The ethnicity codes used to represent these concepts are based upon the [CDC ethnicity and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 43 reference ethnicity. The ethnicity concepts are grouped by and pre-mapped to the 2 OMB ethnicity categories: - Hispanic or Latino - Not Hispanic or Latino.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"purpose":"Complies with 2015 Edition Common Clinical Data Set for patient race.","fhirVersion":"4.0.1","mapping":[{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"complex-type","abstract":false,"context":[{"type":"element","expression":"Patient"}],"type":"Extension","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Extension","derivation":"constraint","snapshot":{"element":[{"id":"Extension","path":"Extension","short":"US Core ethnicity Extension","definition":"Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The ethnicity codes used to represent these concepts are based upon the [CDC ethnicity and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 43 reference ethnicity. The ethnicity concepts are grouped by and pre-mapped to the 2 OMB ethnicity categories: - Hispanic or Latino - Not Hispanic or Latino.","min":0,"max":"1","base":{"path":"Extension","min":0,"max":"*"},"condition":["ele-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false},{"id":"Extension.id","path":"Extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension","path":"Extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:ombCategory","path":"Extension.extension","sliceName":"ombCategory","short":"Hispanic or Latino|Not Hispanic or Latino","definition":"The 2 ethnicity category codes according to the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","min":0,"max":"1","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"iso11179","map":"/ClinicalDocument/recordTarget/patientRole/patient/ethnicGroupCode"}]},{"id":"Extension.extension:ombCategory.id","path":"Extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:ombCategory.extension","path":"Extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:ombCategory.extension.id","path":"Extension.extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:ombCategory.extension.extension","path":"Extension.extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:ombCategory.extension.url","path":"Extension.extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:ombCategory.extension.value[x]","path":"Extension.extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"base64Binary"},{"code":"boolean"},{"code":"canonical"},{"code":"code"},{"code":"date"},{"code":"dateTime"},{"code":"decimal"},{"code":"id"},{"code":"instant"},{"code":"integer"},{"code":"markdown"},{"code":"oid"},{"code":"positiveInt"},{"code":"string"},{"code":"time"},{"code":"unsignedInt"},{"code":"uri"},{"code":"url"},{"code":"uuid"},{"code":"Address"},{"code":"Age"},{"code":"Annotation"},{"code":"Attachment"},{"code":"CodeableConcept"},{"code":"Coding"},{"code":"ContactPoint"},{"code":"Count"},{"code":"Distance"},{"code":"Duration"},{"code":"HumanName"},{"code":"Identifier"},{"code":"Money"},{"code":"Period"},{"code":"Quantity"},{"code":"Range"},{"code":"Ratio"},{"code":"Reference"},{"code":"SampledData"},{"code":"Signature"},{"code":"Timing"},{"code":"ContactDetail"},{"code":"Contributor"},{"code":"DataRequirement"},{"code":"Expression"},{"code":"ParameterDefinition"},{"code":"RelatedArtifact"},{"code":"TriggerDefinition"},{"code":"UsageContext"},{"code":"Dosage"},{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:ombCategory.url","path":"Extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"ombCategory","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:ombCategory.value[x]","path":"Extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"strength":"required","description":"The 2 ethnicity category codes according to the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","valueSet":"http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:detailed","path":"Extension.extension","sliceName":"detailed","short":"Extended ethnicity codes","definition":"The 41 CDC ethnicity codes that are grouped under one of the 2 OMB ethnicity category codes.","min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"iso11179","map":"/ClinicalDocument/recordTarget/patientRole/patient/sdtc:ethnicGroupCode"}]},{"id":"Extension.extension:detailed.id","path":"Extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:detailed.extension","path":"Extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:detailed.extension.id","path":"Extension.extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:detailed.extension.extension","path":"Extension.extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:detailed.extension.url","path":"Extension.extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:detailed.extension.value[x]","path":"Extension.extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"base64Binary"},{"code":"boolean"},{"code":"canonical"},{"code":"code"},{"code":"date"},{"code":"dateTime"},{"code":"decimal"},{"code":"id"},{"code":"instant"},{"code":"integer"},{"code":"markdown"},{"code":"oid"},{"code":"positiveInt"},{"code":"string"},{"code":"time"},{"code":"unsignedInt"},{"code":"uri"},{"code":"url"},{"code":"uuid"},{"code":"Address"},{"code":"Age"},{"code":"Annotation"},{"code":"Attachment"},{"code":"CodeableConcept"},{"code":"Coding"},{"code":"ContactPoint"},{"code":"Count"},{"code":"Distance"},{"code":"Duration"},{"code":"HumanName"},{"code":"Identifier"},{"code":"Money"},{"code":"Period"},{"code":"Quantity"},{"code":"Range"},{"code":"Ratio"},{"code":"Reference"},{"code":"SampledData"},{"code":"Signature"},{"code":"Timing"},{"code":"ContactDetail"},{"code":"Contributor"},{"code":"DataRequirement"},{"code":"Expression"},{"code":"ParameterDefinition"},{"code":"RelatedArtifact"},{"code":"TriggerDefinition"},{"code":"UsageContext"},{"code":"Dosage"},{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:detailed.url","path":"Extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"detailed","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:detailed.value[x]","path":"Extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"strength":"required","description":"The 41 [CDC ethnicity codes](http://www.cdc.gov/phin/resources/vocabulary/index.html) that are grouped under one of the 2 OMB ethnicity category codes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:text","path":"Extension.extension","sliceName":"text","short":"ethnicity Text","definition":"Plain text representation of the ethnicity concept(s).","min":1,"max":"1","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":true,"isModifier":false,"isSummary":false},{"id":"Extension.extension:text.id","path":"Extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:text.extension","path":"Extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:text.extension.id","path":"Extension.extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:text.extension.extension","path":"Extension.extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:text.extension.url","path":"Extension.extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:text.extension.value[x]","path":"Extension.extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"base64Binary"},{"code":"boolean"},{"code":"canonical"},{"code":"code"},{"code":"date"},{"code":"dateTime"},{"code":"decimal"},{"code":"id"},{"code":"instant"},{"code":"integer"},{"code":"markdown"},{"code":"oid"},{"code":"positiveInt"},{"code":"string"},{"code":"time"},{"code":"unsignedInt"},{"code":"uri"},{"code":"url"},{"code":"uuid"},{"code":"Address"},{"code":"Age"},{"code":"Annotation"},{"code":"Attachment"},{"code":"CodeableConcept"},{"code":"Coding"},{"code":"ContactPoint"},{"code":"Count"},{"code":"Distance"},{"code":"Duration"},{"code":"HumanName"},{"code":"Identifier"},{"code":"Money"},{"code":"Period"},{"code":"Quantity"},{"code":"Range"},{"code":"Ratio"},{"code":"Reference"},{"code":"SampledData"},{"code":"Signature"},{"code":"Timing"},{"code":"ContactDetail"},{"code":"Contributor"},{"code":"DataRequirement"},{"code":"Expression"},{"code":"ParameterDefinition"},{"code":"RelatedArtifact"},{"code":"TriggerDefinition"},{"code":"UsageContext"},{"code":"Dosage"},{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:text.url","path":"Extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"text","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:text.value[x]","path":"Extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.url","path":"Extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"fixedUri":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.value[x]","path":"Extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"0","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"base64Binary"},{"code":"boolean"},{"code":"canonical"},{"code":"code"},{"code":"date"},{"code":"dateTime"},{"code":"decimal"},{"code":"id"},{"code":"instant"},{"code":"integer"},{"code":"markdown"},{"code":"oid"},{"code":"positiveInt"},{"code":"string"},{"code":"time"},{"code":"unsignedInt"},{"code":"uri"},{"code":"url"},{"code":"uuid"},{"code":"Address"},{"code":"Age"},{"code":"Annotation"},{"code":"Attachment"},{"code":"CodeableConcept"},{"code":"Coding"},{"code":"ContactPoint"},{"code":"Count"},{"code":"Distance"},{"code":"Duration"},{"code":"HumanName"},{"code":"Identifier"},{"code":"Money"},{"code":"Period"},{"code":"Quantity"},{"code":"Range"},{"code":"Ratio"},{"code":"Reference"},{"code":"SampledData"},{"code":"Signature"},{"code":"Timing"},{"code":"ContactDetail"},{"code":"Contributor"},{"code":"DataRequirement"},{"code":"Expression"},{"code":"ParameterDefinition"},{"code":"RelatedArtifact"},{"code":"TriggerDefinition"},{"code":"UsageContext"},{"code":"Dosage"},{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]}]},"differential":{"element":[{"id":"Extension","path":"Extension","short":"US Core ethnicity Extension","definition":"Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The ethnicity codes used to represent these concepts are based upon the [CDC ethnicity and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 43 reference ethnicity. The ethnicity concepts are grouped by and pre-mapped to the 2 OMB ethnicity categories: - Hispanic or Latino - Not Hispanic or Latino.","min":0,"max":"1"},{"id":"Extension.extension:ombCategory","path":"Extension.extension","sliceName":"ombCategory","short":"Hispanic or Latino|Not Hispanic or Latino","definition":"The 2 ethnicity category codes according to the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","min":0,"max":"1","type":[{"code":"Extension"}],"mustSupport":true,"mapping":[{"identity":"iso11179","map":"/ClinicalDocument/recordTarget/patientRole/patient/ethnicGroupCode"}]},{"id":"Extension.extension:ombCategory.url","path":"Extension.extension.url","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"ombCategory"},{"id":"Extension.extension:ombCategory.value[x]","path":"Extension.extension.value[x]","min":1,"max":"1","type":[{"code":"Coding"}],"binding":{"strength":"required","description":"The 2 ethnicity category codes according to the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","valueSet":"http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category"}},{"id":"Extension.extension:detailed","path":"Extension.extension","sliceName":"detailed","short":"Extended ethnicity codes","definition":"The 41 CDC ethnicity codes that are grouped under one of the 2 OMB ethnicity category codes.","min":0,"max":"*","type":[{"code":"Extension"}],"mapping":[{"identity":"iso11179","map":"/ClinicalDocument/recordTarget/patientRole/patient/sdtc:ethnicGroupCode"}]},{"id":"Extension.extension:detailed.url","path":"Extension.extension.url","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"detailed"},{"id":"Extension.extension:detailed.value[x]","path":"Extension.extension.value[x]","min":1,"max":"1","type":[{"code":"Coding"}],"binding":{"strength":"required","description":"The 41 [CDC ethnicity codes](http://www.cdc.gov/phin/resources/vocabulary/index.html) that are grouped under one of the 2 OMB ethnicity category codes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity"}},{"id":"Extension.extension:text","path":"Extension.extension","sliceName":"text","short":"ethnicity Text","definition":"Plain text representation of the ethnicity concept(s).","min":1,"max":"1","type":[{"code":"Extension"}],"mustSupport":true},{"id":"Extension.extension:text.url","path":"Extension.extension.url","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"text"},{"id":"Extension.extension:text.value[x]","path":"Extension.extension.value[x]","min":1,"max":"1","type":[{"code":"string"}]},{"id":"Extension.url","path":"Extension.url","min":1,"max":"1","fixedUri":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"},{"id":"Extension.value[x]","path":"Extension.value[x]","min":0,"max":"0"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-goal.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-goal.json new file mode 100755 index 000000000..97f48c185 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-goal.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-goal","text":{"status":"generated","div":""},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal","version":"3.1.0","name":"USCoreGoalProfile","title":"US Core Goal Profile","status":"active","experimental":false,"date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Goal resource for the minimal set of data to query and retrieve a patient's goal(s).","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"}],"kind":"resource","abstract":false,"type":"Goal","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Goal","derivation":"constraint","snapshot":{"element":[{"id":"Goal","path":"Goal","short":"Describes the intended objective(s) for a patient, group or organization","definition":"The US Core Goal Profile is based upon the core FHIR Goal Resource and created to meet the 2015 Edition Common Clinical Data Set 'Goals' requirements.","comment":"Goal can be achieving a particular change or merely maintaining a current state or even slowing a decline.","min":0,"max":"*","base":{"path":"Goal","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"v2","map":"GOL.1"},{"identity":"rim","map":".outboundRelationship[typeCode<=OBJ]."},{"identity":"argonaut-dq-dstu2","map":"Goal"}]},{"id":"Goal.id","path":"Goal.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Goal.meta","path":"Goal.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Goal.implicitRules","path":"Goal.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Goal.language","path":"Goal.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Goal.text","path":"Goal.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Goal.contained","path":"Goal.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Goal.extension","path":"Goal.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Goal.modifierExtension","path":"Goal.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Goal.identifier","path":"Goal.identifier","short":"External Ids for this goal","definition":"Business identifiers assigned to this goal by the performer or other systems which remain constant as the resource is updated and propagates from server to server.","comment":"This is a business identifier, not a resource identifier (see [discussion](http://hl7.org/fhir/R4/resource.html#identifiers)). It is best practice for the identifier to only appear on a single resource instance, however business practices may occasionally dictate that multiple resource instances with the same identifier can exist - possibly even with different resource types. For example, multiple Patient and a Person resource instance might share the same social insurance number.","requirements":"Allows identification of the goal as it is known by various participating systems and in a way that remains consistent across servers.","min":0,"max":"*","base":{"path":"Goal.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"rim","map":".id"}]},{"id":"Goal.lifecycleStatus","path":"Goal.lifecycleStatus","short":"proposed | planned | accepted | active | on-hold | completed | cancelled | entered-in-error | rejected","definition":"Type of plan.","comment":"This element is labeled as a modifier because the lifecycleStatus contains codes that mark the resource as not currently valid.","requirements":"Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.","min":1,"max":"1","base":{"path":"Goal.lifecycleStatus","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/goal-status"},"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"GOL-18-goal life cycle status"},{"identity":"rim","map":".statusCode in-progress = active (classCode = OBJ) cancelled = aborted"},{"identity":"argonaut-dq-dstu2","map":"Goal.status"}]},{"id":"Goal.achievementStatus","path":"Goal.achievementStatus","short":"in-progress | improving | worsening | no-change | achieved | sustaining | not-achieved | no-progress | not-attainable","definition":"Describes the progression, or lack thereof, towards the goal against the target.","min":0,"max":"1","base":{"path":"Goal.achievementStatus","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"GoalAchievementStatus"}],"strength":"preferred","description":"Indicates the progression, or lack thereof, towards the goal against the target.","valueSet":"http://hl7.org/fhir/ValueSet/goal-achievement"},"mapping":[{"identity":"rim","map":".statusCode achieved = complete sustaining = active"}]},{"id":"Goal.category","path":"Goal.category","short":"E.g. Treatment, dietary, behavioral, etc.","definition":"Indicates a category the goal falls within.","requirements":"Allows goals to be filtered and sorted.","min":0,"max":"*","base":{"path":"Goal.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"GoalCategory"}],"strength":"example","description":"Codes for grouping and sorting goals.","valueSet":"http://hl7.org/fhir/ValueSet/goal-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"}]},{"id":"Goal.priority","path":"Goal.priority","short":"high-priority | medium-priority | low-priority","definition":"Identifies the mutually agreed level of importance associated with reaching/sustaining the goal.","comment":"Extensions are available to track priorities as established by each participant (i.e. Priority from the patient's perspective, different practitioners' perspectives, family member's perspectives)\r\rThe ordinal extension on Coding can be used to convey a numerically comparable ranking to priority. (Keep in mind that different coding systems may use a \"low value=important\".","requirements":"Used for sorting and presenting goals.","min":0,"max":"1","base":{"path":"Goal.priority","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"GoalPriority"}],"strength":"preferred","description":"The level of importance associated with a goal.","valueSet":"http://hl7.org/fhir/ValueSet/goal-priority"},"mapping":[{"identity":"w5","map":"FiveWs.grade"},{"identity":"rim","map":".priorityCode"}]},{"id":"Goal.description","path":"Goal.description","short":"Code or text describing goal","definition":"proposed | draft | active | completed | cancelled.","comment":"If no code is available, use CodeableConcept.text.","requirements":"Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.","min":1,"max":"1","base":{"path":"Goal.description","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"GoalDescription"}],"strength":"example","description":"Codes providing the details of a particular goal. This will generally be system or implementation guide-specific. In many systems, only the text element will be used.","valueSet":"http://hl7.org/fhir/ValueSet/clinical-findings"},"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"v2","map":"GOL-3.2-goal ID.text"},{"identity":"rim","map":".text"},{"identity":"argonaut-dq-dstu2","map":"Goal.description"}]},{"id":"Goal.subject","path":"Goal.subject","short":"Who this goal is intended for","definition":"Who care plan is for.","requirements":"Identifies the patient or group whose intended care is described by the plan.","min":1,"max":"1","base":{"path":"Goal.subject","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3-patient ID list"},{"identity":"rim","map":".participation[typeCode=PAT].role[classCode=PAT]"},{"identity":"w5","map":"FiveWs.subject"},{"identity":"argonaut-dq-dstu2","map":"Goal.subject"}]},{"id":"Goal.start[x]","path":"Goal.start[x]","short":"When goal pursuit begins","definition":"The date or event after which the goal should begin being pursued.","requirements":"Goals can be established prior to there being an intention to start pursuing them; e.g. Goals for post-surgical recovery established prior to surgery.","min":0,"max":"1","base":{"path":"Goal.start[x]","min":0,"max":"1"},"type":[{"code":"date"},{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"GoalStartEvent"}],"strength":"example","description":"Codes describing events that can trigger the initiation of a goal.","valueSet":"http://hl7.org/fhir/ValueSet/goal-start-event"},"mapping":[{"identity":"w5","map":"FiveWs.planned"}]},{"id":"Goal.target","path":"Goal.target","short":"Target outcome for the goal","definition":"Indicates what should be done by when.","comment":"When multiple targets are present for a single goal instance, all targets must be met for the overall goal to be met.","requirements":"Allows the progress of the goal to be monitored against an observation or due date. Target is 0..* to support Observations with multiple components, such as blood pressure goals with both a systolic and diastolic target.","min":0,"max":"*","base":{"path":"Goal.target","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"condition":["gol-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"gol-1","severity":"error","human":"Goal.target.measure is required if Goal.target.detail is populated","expression":"(detail.exists() and measure.exists()) or detail.exists().not()","xpath":"(exists(f:*[starts-with(local-name(.), 'detail')]) and exists(f:measure)) or not(exists(f:*[starts-with(local-name(.), 'detail')]))","source":"http://hl7.org/fhir/StructureDefinition/Goal"}],"mustSupport":true,"isModifier":false,"isSummary":false},{"id":"Goal.target.id","path":"Goal.target.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Goal.target.extension","path":"Goal.target.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Goal.target.modifierExtension","path":"Goal.target.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Goal.target.measure","path":"Goal.target.measure","short":"The parameter whose value is being tracked","definition":"The parameter whose value is being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.","min":0,"max":"1","base":{"path":"Goal.target.measure","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["gol-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"GoalTargetMeasure"}],"strength":"example","description":"Codes to identify the value being tracked, e.g. body weight, blood pressure, or hemoglobin A1c level.","valueSet":"http://hl7.org/fhir/ValueSet/observation-codes"}},{"id":"Goal.target.detail[x]","path":"Goal.target.detail[x]","short":"The target value to be achieved","definition":"The target value of the focus to be achieved to signify the fulfillment of the goal, e.g. 150 pounds, 7.0%. Either the high or low or both values of the range can be specified. When a low value is missing, it indicates that the goal is achieved at any focus value at or below the high value. Similarly, if the high value is missing, it indicates that the goal is achieved at any focus value at or above the low value.","comment":"A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Goal.target.measure defines a coded value.","min":0,"max":"1","base":{"path":"Goal.target.detail[x]","min":0,"max":"1"},"type":[{"code":"Quantity"},{"code":"Range"},{"code":"CodeableConcept"},{"code":"string"},{"code":"boolean"},{"code":"integer"},{"code":"Ratio"}],"condition":["gol-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"GoalTargetDetail"}],"strength":"example","description":"Codes to identify the target value of the focus to be achieved to signify the fulfillment of the goal."}},{"id":"Goal.target.due[x]","path":"Goal.target.due[x]","slicing":{"discriminator":[{"type":"type","path":"$this"}],"ordered":false,"rules":"closed"},"short":"Reach goal on or before","definition":"Indicates either the date or the duration after start by which the goal should be met.","requirements":"Identifies when the goal should be evaluated.","min":0,"max":"1","base":{"path":"Goal.target.due[x]","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.done[x]"}]},{"id":"Goal.target.due[x]:dueDate","path":"Goal.target.due[x]","sliceName":"dueDate","short":"Reach goal on or before","definition":"Indicates either the date or the duration after start by which the goal should be met.","requirements":"Identifies when the goal should be evaluated.","min":0,"max":"1","base":{"path":"Goal.target.due[x]","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.done[x]"}]},{"id":"Goal.statusDate","path":"Goal.statusDate","short":"When goal status took effect","definition":"Identifies when the current status. I.e. When initially created, when achieved, when cancelled, etc.","comment":"To see the date for past statuses, query history.","min":0,"max":"1","base":{"path":"Goal.statusDate","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.recorded"}]},{"id":"Goal.statusReason","path":"Goal.statusReason","short":"Reason for current status","definition":"Captures the reason for the current status.","comment":"This will typically be captured for statuses such as rejected, on-hold or cancelled, but could be present for others.","min":0,"max":"1","base":{"path":"Goal.statusReason","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Goal.expressedBy","path":"Goal.expressedBy","short":"Who's responsible for creating Goal?","definition":"Indicates whose goal this is - patient goal, practitioner goal, etc.","comment":"This is the individual responsible for establishing the goal, not necessarily who recorded it. (For that, use the Provenance resource.).","min":0,"max":"1","base":{"path":"Goal.expressedBy","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.source"}]},{"id":"Goal.addresses","path":"Goal.addresses","short":"Issues addressed by this goal","definition":"The identified conditions and other health record elements that are intended to be addressed by the goal.","requirements":"Allows specific goals to explicitly linked to the concerns they're dealing with - makes the goal more understandable.","min":0,"max":"*","base":{"path":"Goal.addresses","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Condition","http://hl7.org/fhir/StructureDefinition/Observation","http://hl7.org/fhir/StructureDefinition/MedicationStatement","http://hl7.org/fhir/StructureDefinition/NutritionOrder","http://hl7.org/fhir/StructureDefinition/ServiceRequest","http://hl7.org/fhir/StructureDefinition/RiskAssessment"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"rim","map":".outboundRelationship[typeCode=SUBJ].target[classCode=CONC]"}]},{"id":"Goal.note","path":"Goal.note","short":"Comments about the goal","definition":"Any comments related to the goal.","comment":"May be used for progress notes, concerns or other related information that doesn't actually describe the goal itself.","requirements":"There's a need to capture information about the goal that doesn't actually describe the goal.","min":0,"max":"*","base":{"path":"Goal.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"GOL-16-goal evaluation + NTE?"},{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"annotation\"].value"}]},{"id":"Goal.outcomeCode","path":"Goal.outcomeCode","short":"What result was achieved regarding the goal?","definition":"Identifies the change (or lack of change) at the point when the status of the goal is assessed.","comment":"Note that this should not duplicate the goal status.","requirements":"Outcome tracking is a key aspect of care planning.","min":0,"max":"*","base":{"path":"Goal.outcomeCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"GoalOutcome"}],"strength":"example","description":"The result of the goal; e.g. \"25% increase in shoulder mobility\", \"Anxiety reduced to moderate levels\". \"15 kg weight loss sustained over 6 months\".","valueSet":"http://hl7.org/fhir/ValueSet/clinical-findings"}},{"id":"Goal.outcomeReference","path":"Goal.outcomeReference","short":"Observation that resulted from goal","definition":"Details of what's changed (or not changed).","comment":"The goal outcome is independent of the outcome of the related activities. For example, if the Goal is to achieve a target body weight of 150 lb and a care plan activity is defined to diet, then the care plan’s activity outcome could be calories consumed whereas goal outcome is an observation for the actual body weight measured.","requirements":"Outcome tracking is a key aspect of care planning.","min":0,"max":"*","base":{"path":"Goal.outcomeReference","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Observation"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false}]},"differential":{"element":[{"id":"Goal","path":"Goal","definition":"The US Core Goal Profile is based upon the core FHIR Goal Resource and created to meet the 2015 Edition Common Clinical Data Set 'Goals' requirements.","mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Goal"}]},{"id":"Goal.lifecycleStatus","path":"Goal.lifecycleStatus","definition":"Type of plan.","requirements":"Identifies what \"kind\" of plan this is to support differentiation between multiple co-existing plans; e.g. \"Home health\", \"psychiatric\", \"asthma\", \"disease management\", \"wellness plan\", etc.","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/goal-status"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Goal.status"}]},{"id":"Goal.description","path":"Goal.description","definition":"proposed | draft | active | completed | cancelled.","requirements":"Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record.","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Goal.description"}]},{"id":"Goal.subject","path":"Goal.subject","definition":"Who care plan is for.","requirements":"Identifies the patient or group whose intended care is described by the plan.","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Goal.subject"}]},{"id":"Goal.target","path":"Goal.target","min":0,"max":"*","mustSupport":true},{"id":"Goal.target.dueDate","path":"Goal.target.dueDate","min":0,"max":"1","mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-immunization.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-immunization.json new file mode 100755 index 000000000..bcb83a61e --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-immunization.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-immunization","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Immunization 0..*
    \".\"\".\"\".\" status S1..1codeBinding: ImmunizationStatusCodes (required)
    \".\"\".\"\".\" statusReason S0..1CodeableConceptBinding: ImmunizationStatusReasonCodes (example)
    \".\"\".\"\".\" vaccineCode SI1..1CodeableConceptVaccine Product Type (bind to CVX)
    Binding: US Core Vaccine Administered Value Set (CVX) (extensible)
    us-core-1: SHOULD have a translation to the NDC value set
    \".\"\".\"\".\" patient S1..1Reference(US Core Patient Profile)
    \".\"\".\"\".\" occurrence[x] S1..1
    \".\"\".\"\".\"\".\" occurrenceDateTimedateTime
    \".\"\".\"\".\"\".\" occurrenceStringstring
    \".\"\".\"\".\" primarySource S1..1boolean

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization","version":"3.1.0","name":"USCoreImmunizationProfile","title":"US Core Immunization Profile","status":"active","experimental":false,"date":"2019-08-26T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Immunization resource for the minimal set of data to query and retrieve patient's immunization information.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"quick","uri":"http://unknown.org/QUICK","name":"QUICK"},{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"cda","uri":"http://hl7.org/v3/cda","name":"CDA (R2)"}],"kind":"resource","abstract":false,"type":"Immunization","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Immunization","derivation":"constraint","snapshot":{"element":[{"id":"Immunization","path":"Immunization","short":"Immunization event information","definition":"The US Core Immunization Profile is based upon the core FHIR Immunization Resource and created to meet the 2015 Edition Common Clinical Data Set 'Immunizations' requirements.","min":0,"max":"*","base":{"path":"Immunization","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"v2","map":"VXU_V04"},{"identity":"rim","map":"SubstanceAdministration"},{"identity":"quick","map":"ImmunizationPerformanceOccurrence"},{"identity":"argonaut-dq-dstu2","map":"Immunization"}]},{"id":"Immunization.id","path":"Immunization.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Immunization.meta","path":"Immunization.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Immunization.implicitRules","path":"Immunization.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Immunization.language","path":"Immunization.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Immunization.text","path":"Immunization.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Immunization.contained","path":"Immunization.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.extension","path":"Immunization.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.modifierExtension","path":"Immunization.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.identifier","path":"Immunization.identifier","short":"Business identifier","definition":"A unique identifier assigned to this immunization record.","min":0,"max":"*","base":{"path":"Immunization.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"rim","map":".id"},{"identity":"cda","map":"ClinicalDocument/component/StructuredBody/component/section/entry/substanceAdministration/id"}]},{"id":"Immunization.status","path":"Immunization.status","short":"completed | entered-in-error | not-done","definition":"Indicates the current status of the immunization event.","comment":"Will generally be set to show that the immunization has been completed or not done. This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.","min":1,"max":"1","base":{"path":"Immunization.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains statuses entered-in-error and not-done which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","description":"Constrained list of immunizaiotn status","valueSet":"http://hl7.org/fhir/ValueSet/immunization-status"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"statusCode"},{"identity":"argonaut-dq-dstu2","map":"Immunization.status"}]},{"id":"Immunization.statusReason","path":"Immunization.statusReason","short":"Reason not done","definition":"Indicates the reason the immunization event was not performed.","comment":"This is generally only used for the status of \"not-done\". The reason for performing the immunization event is captured in reasonCode, not here.","min":0,"max":"1","base":{"path":"Immunization.statusReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"strength":"example","valueSet":"http://hl7.org/fhir/ValueSet/immunization-status-reason"},"mapping":[{"identity":"workflow","map":"Event.statusReason"},{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ].source[classCode=CACT, moodCode=EVN].reasonCOde"},{"identity":"argonaut-dq-dstu2","map":"Immunization.wasNotGiven"}]},{"id":"Immunization.vaccineCode","path":"Immunization.vaccineCode","short":"Vaccine Product Type (bind to CVX)","definition":"Vaccine that was administered or was to be administered.","min":1,"max":"1","base":{"path":"Immunization.vaccineCode","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["us-core-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true}],"key":"us-core-1","severity":"warning","human":"SHOULD have a translation to the NDC value set","expression":"coding.where(system='http://hl7.org/fhir/sid/ndc').empty()","xpath":"not(exists(f:coding/f:system[@value='http://hl7.org/fhir/sid/ndc']))"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"The CVX (vaccine administered) code system","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-vaccines-cvx"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"v2","map":"RXA-5"},{"identity":"rim","map":".code"},{"identity":"cda","map":"ClinicalDocument/component/StructuredBody/component/section/entry/substanceAdministration/consumable/manfacturedProduct/manufacturedMaterial/realmCode/code"},{"identity":"quick","map":"vaccine"},{"identity":"argonaut-dq-dstu2","map":"Immunization.vaccineCode"}]},{"id":"Immunization.patient","path":"Immunization.patient","short":"Who was immunized","definition":"The patient who either received or did not receive the immunization.","alias":["Patient"],"min":1,"max":"1","base":{"path":"Immunization.patient","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":".partipication[ttypeCode=].role"},{"identity":"w5","map":"FiveWs.subject"},{"identity":"quick","map":"subject"},{"identity":"argonaut-dq-dstu2","map":"Immunization.patient"}]},{"id":"Immunization.encounter","path":"Immunization.encounter","short":"Encounter immunization was part of","definition":"The visit or admission or other contact between patient and health care provider the immunization was performed as part of.","min":0,"max":"1","base":{"path":"Immunization.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1-19"},{"identity":"rim","map":"component->EncounterEvent"}]},{"id":"Immunization.occurrence[x]","path":"Immunization.occurrence[x]","short":"Vaccine administration date","definition":"Date vaccine administered or was to be administered.","comment":"When immunizations are given a specific date and time should always be known. When immunizations are patient reported, a specific date might not be known. Although partial dates are allowed, an adult patient might not be able to recall the year a childhood immunization was given. An exact date is always preferable, but the use of the String data type is acceptable when an exact date is not known. A small number of vaccines (e.g. live oral typhoid vaccine) are given as a series of patient self-administered dose over a span of time. In cases like this, often, only the first dose (typically a provider supervised dose) is recorded with the occurrence indicating the date/time of the first dose.","min":1,"max":"1","base":{"path":"Immunization.occurrence[x]","min":1,"max":"1"},"type":[{"code":"dateTime"},{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"RXA-3"},{"identity":"rim","map":".effectiveTime"},{"identity":"cda","map":"ClinicalDocument/component/StructuredBody/component/section/entry/substanceAdministration/effectiveTime/value"},{"identity":"quick","map":"performanceTime"},{"identity":"argonaut-dq-dstu2","map":"Immunization.date"}]},{"id":"Immunization.recorded","path":"Immunization.recorded","short":"When the immunization was first captured in the subject's record","definition":"The date the occurrence of the immunization was first captured in the record - potentially significantly after the occurrence of the event.","min":0,"max":"1","base":{"path":"Immunization.recorded","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"rim","map":".participation[typeCode=AUT].time"}]},{"id":"Immunization.primarySource","path":"Immunization.primarySource","short":"Indicates context the data was recorded in","definition":"An indication that the content of the record is based on information from the person who administered the vaccine. This reflects the context under which the data was originally recorded.","comment":"Reflects the “reliability” of the content.","min":1,"max":"1","base":{"path":"Immunization.primarySource","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.source"},{"identity":"v2","map":"RXA-9"},{"identity":"rim","map":"immunization.uncertaintycode (if primary source=false, uncertainty=U)"},{"identity":"quick","map":"reported"},{"identity":"argonaut-dq-dstu2","map":"Immunization.reported"}]},{"id":"Immunization.reportOrigin","path":"Immunization.reportOrigin","short":"Indicates the source of a secondarily reported record","definition":"The source of the data when the report of the immunization event is not based on information from the person who administered the vaccine.","comment":"Should not be populated if primarySource = True, not required even if primarySource = False.","min":0,"max":"1","base":{"path":"Immunization.reportOrigin","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ImmunizationReportOrigin"}],"strength":"example","description":"The source of the data for a record which is not from a primary source.","valueSet":"http://hl7.org/fhir/ValueSet/immunization-origin"},"mapping":[{"identity":"w5","map":"FiveWs.source"},{"identity":"v2","map":"RXA-9"},{"identity":"rim","map":".participation[typeCode=INF].role[classCode=PAT] (this syntax for self-reported) .participation[typeCode=INF].role[classCode=LIC] (this syntax for health care professional) .participation[typeCode=INF].role[classCode=PRS] (this syntax for family member)"}]},{"id":"Immunization.location","path":"Immunization.location","short":"Where immunization occurred","definition":"The service delivery location where the vaccine administration occurred.","min":0,"max":"1","base":{"path":"Immunization.location","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.location"},{"identity":"w5","map":"FiveWs.where[x]"},{"identity":"v2","map":"RXA-27 (or RXA-11, deprecated as of v2.7)"},{"identity":"rim","map":".participation[typeCode=LOC].COCT_MT240000UV"}]},{"id":"Immunization.manufacturer","path":"Immunization.manufacturer","short":"Vaccine manufacturer","definition":"Name of vaccine manufacturer.","min":0,"max":"1","base":{"path":"Immunization.manufacturer","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"RXA-17"},{"identity":"rim","map":".participation[typeCode=CSM].role[classCode=INST].scopedRole.scoper[classCode=ORG]"},{"identity":"cda","map":"ClinicalDocument/component/StructuredBody/component/section/entry/substanceAdministration/consumable/manfacturedProduct/manufacuturerOrganization/name"}]},{"id":"Immunization.lotNumber","path":"Immunization.lotNumber","short":"Vaccine lot number","definition":"Lot number of the vaccine product.","min":0,"max":"1","base":{"path":"Immunization.lotNumber","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"RXA-15"},{"identity":"rim","map":".participation[typeCode=CSM].role[classCode=INST].scopedRole.scoper[classCode=MMAT].id"},{"identity":"cda","map":"ClinicalDocument/component/StructuredBody/component/section/entry/substanceAdministration/consumable/manfacturedProduct/manufacturedMaterial/lotNumberText"}]},{"id":"Immunization.expirationDate","path":"Immunization.expirationDate","short":"Vaccine expiration date","definition":"Date vaccine batch expires.","min":0,"max":"1","base":{"path":"Immunization.expirationDate","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"RXA-16"},{"identity":"rim","map":".participation[typeCode=CSM].role[classCode=INST].scopedRole.scoper[classCode=MMAT].expirationTime"}]},{"id":"Immunization.site","path":"Immunization.site","short":"Body site vaccine was administered","definition":"Body site where vaccine was administered.","min":0,"max":"1","base":{"path":"Immunization.site","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ImmunizationSite"}],"strength":"example","description":"The site at which the vaccine was administered.","valueSet":"http://hl7.org/fhir/ValueSet/immunization-site"},"mapping":[{"identity":"v2","map":"RXR-2"},{"identity":"rim","map":"observation.targetSiteCode"},{"identity":"cda","map":"ClinicalDocument/component/StructuredBody/component/section/entry/substanceAdministration/approachSiteCode/code"}]},{"id":"Immunization.route","path":"Immunization.route","short":"How vaccine entered body","definition":"The path by which the vaccine product is taken into the body.","min":0,"max":"1","base":{"path":"Immunization.route","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ImmunizationRoute"}],"strength":"example","description":"The route by which the vaccine was administered.","valueSet":"http://hl7.org/fhir/ValueSet/immunization-route"},"mapping":[{"identity":"v2","map":"RXR-1"},{"identity":"rim","map":".routeCode"},{"identity":"cda","map":"ClinicalDocument/component/StructuredBody/component/section/entry/substanceAdministration/routeCode/code"}]},{"id":"Immunization.doseQuantity","path":"Immunization.doseQuantity","short":"Amount of vaccine administered","definition":"The quantity of vaccine product that was administered.","min":0,"max":"1","base":{"path":"Immunization.doseQuantity","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"RXA-6 / RXA-7"},{"identity":"rim","map":".doseQuantity"}]},{"id":"Immunization.performer","path":"Immunization.performer","short":"Who performed event","definition":"Indicates who performed the immunization event.","min":0,"max":"*","base":{"path":"Immunization.performer","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer"},{"identity":"v2","map":"ORC-12 / RXA-10"},{"identity":"rim","map":".participation[typeCode=PRF].role[scoper.determinerCode=INSTANCE]"}]},{"id":"Immunization.performer.id","path":"Immunization.performer.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Immunization.performer.extension","path":"Immunization.performer.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Immunization.performer.modifierExtension","path":"Immunization.performer.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.performer.function","path":"Immunization.performer.function","short":"What type of performance was done","definition":"Describes the type of performance (e.g. ordering provider, administering provider, etc.).","min":0,"max":"1","base":{"path":"Immunization.performer.function","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ImmunizationFunction"}],"strength":"extensible","description":"The role a practitioner or organization plays in the immunization event.","valueSet":"http://hl7.org/fhir/ValueSet/immunization-function"},"mapping":[{"identity":"workflow","map":"Event.performer.function"},{"identity":"rim","map":".participation.functionCode"}]},{"id":"Immunization.performer.actor","path":"Immunization.performer.actor","short":"Individual or organization who was performing","definition":"The practitioner or organization who performed the action.","comment":"When the individual practitioner who performed the action is known, it is best to send.","min":1,"max":"1","base":{"path":"Immunization.performer.actor","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"rim","map":".player"}]},{"id":"Immunization.note","path":"Immunization.note","short":"Additional immunization notes","definition":"Extra information about the immunization that is not conveyed by the other attributes.","min":0,"max":"*","base":{"path":"Immunization.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.note"},{"identity":"v2","map":"OBX-5 : OBX-3 = 48767-8"},{"identity":"rim","map":"note"}]},{"id":"Immunization.reasonCode","path":"Immunization.reasonCode","short":"Why immunization occurred","definition":"Reasons why the vaccine was administered.","min":0,"max":"*","base":{"path":"Immunization.reasonCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ImmunizationReason"}],"strength":"example","description":"The reason why a vaccine was administered.","valueSet":"http://hl7.org/fhir/ValueSet/immunization-reason"},"mapping":[{"identity":"workflow","map":"Event.reasonCode"},{"identity":"rim","map":"[actionNegationInd=false].reasonCode"}]},{"id":"Immunization.reasonReference","path":"Immunization.reasonReference","short":"Why immunization occurred","definition":"Condition, Observation or DiagnosticReport that supports why the immunization was administered.","min":0,"max":"*","base":{"path":"Immunization.reasonReference","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Condition","http://hl7.org/fhir/StructureDefinition/Observation","http://hl7.org/fhir/StructureDefinition/DiagnosticReport"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.reasonReference"},{"identity":"rim","map":"N/A"}]},{"id":"Immunization.isSubpotent","path":"Immunization.isSubpotent","short":"Dose potency","definition":"Indication if a dose is considered to be subpotent. By default, a dose should be considered to be potent.","comment":"Typically, the recognition of the dose being sub-potent is retrospective, after the administration (ex. notification of a manufacturer recall after administration). However, in the case of a partial administration (the patient moves unexpectedly and only some of the dose is actually administered), subpotency may be recognized immediately, but it is still important to record the event.","min":0,"max":"1","base":{"path":"Immunization.isSubpotent","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"By default, a dose should be considered to be potent.","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because an immunization event with a subpotent vaccine doesn't protect the patient the same way as a potent dose.","isSummary":true,"mapping":[{"identity":"v2","map":"RXA-20 = PA (partial administration)"},{"identity":"rim","map":"N/A"}]},{"id":"Immunization.subpotentReason","path":"Immunization.subpotentReason","short":"Reason for being subpotent","definition":"Reason why a dose is considered to be subpotent.","min":0,"max":"*","base":{"path":"Immunization.subpotentReason","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"SubpotentReason"}],"strength":"example","description":"The reason why a dose is considered to be subpotent.","valueSet":"http://hl7.org/fhir/ValueSet/immunization-subpotent-reason"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.education","path":"Immunization.education","short":"Educational material presented to patient","definition":"Educational material presented to the patient (or guardian) at the time of vaccine administration.","min":0,"max":"*","base":{"path":"Immunization.education","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"imm-1","severity":"error","human":"One of documentType or reference SHALL be present","expression":"documentType.exists() or reference.exists()","xpath":"exists(f:documentType) or exists(f:reference)"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.education.id","path":"Immunization.education.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Immunization.education.extension","path":"Immunization.education.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Immunization.education.modifierExtension","path":"Immunization.education.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.education.documentType","path":"Immunization.education.documentType","short":"Educational material document identifier","definition":"Identifier of the material presented to the patient.","min":0,"max":"1","base":{"path":"Immunization.education.documentType","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-5 : OBX-3 = 69764-9"},{"identity":"rim","map":"N/A"}]},{"id":"Immunization.education.reference","path":"Immunization.education.reference","short":"Educational material reference pointer","definition":"Reference pointer to the educational material given to the patient if the information was on line.","min":0,"max":"1","base":{"path":"Immunization.education.reference","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.education.publicationDate","path":"Immunization.education.publicationDate","short":"Educational material publication date","definition":"Date the educational material was published.","min":0,"max":"1","base":{"path":"Immunization.education.publicationDate","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-5 : OBX-3 = 29768-9"},{"identity":"rim","map":"N/A"}]},{"id":"Immunization.education.presentationDate","path":"Immunization.education.presentationDate","short":"Educational material presentation date","definition":"Date the educational material was given to the patient.","min":0,"max":"1","base":{"path":"Immunization.education.presentationDate","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-5 : OBX-3 = 29769-7"},{"identity":"rim","map":"N/A"}]},{"id":"Immunization.programEligibility","path":"Immunization.programEligibility","short":"Patient eligibility for a vaccination program","definition":"Indicates a patient's eligibility for a funding program.","min":0,"max":"*","base":{"path":"Immunization.programEligibility","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProgramEligibility"}],"strength":"example","description":"The patient's eligibility for a vaccation program.","valueSet":"http://hl7.org/fhir/ValueSet/immunization-program-eligibility"},"mapping":[{"identity":"v2","map":"OBX-5 : OBX-3 = 64994-7"},{"identity":"rim","map":"N/A"}]},{"id":"Immunization.fundingSource","path":"Immunization.fundingSource","short":"Funding source for the vaccine","definition":"Indicates the source of the vaccine actually administered. This may be different than the patient eligibility (e.g. the patient may be eligible for a publically purchased vaccine but due to inventory issues, vaccine purchased with private funds was actually administered).","min":0,"max":"1","base":{"path":"Immunization.fundingSource","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"FundingSource"}],"strength":"example","description":"The source of funding used to purchase the vaccine administered.","valueSet":"http://hl7.org/fhir/ValueSet/immunization-funding-source"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.reaction","path":"Immunization.reaction","short":"Details of a reaction that follows immunization","definition":"Categorical data indicating that an adverse event is associated in time to an immunization.","comment":"A reaction may be an indication of an allergy or intolerance and, if this is determined to be the case, it should be recorded as a new AllergyIntolerance resource instance as most systems will not query against past Immunization.reaction elements.","min":0,"max":"*","base":{"path":"Immunization.reaction","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"Observation[classCode=obs].code"}]},{"id":"Immunization.reaction.id","path":"Immunization.reaction.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Immunization.reaction.extension","path":"Immunization.reaction.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Immunization.reaction.modifierExtension","path":"Immunization.reaction.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.reaction.date","path":"Immunization.reaction.date","short":"When reaction started","definition":"Date of reaction to the immunization.","min":0,"max":"1","base":{"path":"Immunization.reaction.date","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-14 (ideally this would be reported in an IAM segment, but IAM is not part of the HL7 v2 VXU message - most likely would appear in OBX segments if at all)"},{"identity":"rim","map":".effectiveTime"}]},{"id":"Immunization.reaction.detail","path":"Immunization.reaction.detail","short":"Additional information on reaction","definition":"Details of the reaction.","min":0,"max":"1","base":{"path":"Immunization.reaction.detail","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Observation"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-5"},{"identity":"rim","map":".value"}]},{"id":"Immunization.reaction.reported","path":"Immunization.reaction.reported","short":"Indicates self-reported reaction","definition":"Self-reported indicator.","min":0,"max":"1","base":{"path":"Immunization.reaction.reported","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"(HL7 v2 doesn't seem to provide for this)"},{"identity":"rim","map":".participation[typeCode=INF].role[classCode=PAT] (this syntax for self-reported=true)"}]},{"id":"Immunization.protocolApplied","path":"Immunization.protocolApplied","short":"Protocol followed by the provider","definition":"The protocol (set of recommendations) being followed by the provider who administered the dose.","min":0,"max":"*","base":{"path":"Immunization.protocolApplied","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.protocolApplied.id","path":"Immunization.protocolApplied.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Immunization.protocolApplied.extension","path":"Immunization.protocolApplied.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Immunization.protocolApplied.modifierExtension","path":"Immunization.protocolApplied.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.protocolApplied.series","path":"Immunization.protocolApplied.series","short":"Name of vaccine series","definition":"One possible path to achieve presumed immunity against a disease - within the context of an authority.","min":0,"max":"1","base":{"path":"Immunization.protocolApplied.series","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.protocolApplied.authority","path":"Immunization.protocolApplied.authority","short":"Who is responsible for publishing the recommendations","definition":"Indicates the authority who published the protocol (e.g. ACIP) that is being followed.","min":0,"max":"1","base":{"path":"Immunization.protocolApplied.authority","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.protocolApplied.targetDisease","path":"Immunization.protocolApplied.targetDisease","short":"Vaccine preventatable disease being targetted","definition":"The vaccine preventable disease the dose is being administered against.","min":0,"max":"*","base":{"path":"Immunization.protocolApplied.targetDisease","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"TargetDisease"}],"strength":"example","description":"The vaccine preventable disease the dose is being administered for.","valueSet":"http://hl7.org/fhir/ValueSet/immunization-target-disease"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.protocolApplied.doseNumber[x]","path":"Immunization.protocolApplied.doseNumber[x]","short":"Dose number within series","definition":"Nominal position in a series.","comment":"The use of an integer is preferred if known. A string should only be used in cases where an integer is not available (such as when documenting a recurring booster dose).","min":1,"max":"1","base":{"path":"Immunization.protocolApplied.doseNumber[x]","min":1,"max":"1"},"type":[{"code":"positiveInt"},{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Immunization.protocolApplied.seriesDoses[x]","path":"Immunization.protocolApplied.seriesDoses[x]","short":"Recommended number of doses for immunity","definition":"The recommended number of doses to achieve immunity.","comment":"The use of an integer is preferred if known. A string should only be used in cases where an integer is not available (such as when documenting a recurring booster dose).","min":0,"max":"1","base":{"path":"Immunization.protocolApplied.seriesDoses[x]","min":0,"max":"1"},"type":[{"code":"positiveInt"},{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]}]},"differential":{"element":[{"id":"Immunization","path":"Immunization","definition":"The US Core Immunization Profile is based upon the core FHIR Immunization Resource and created to meet the 2015 Edition Common Clinical Data Set 'Immunizations' requirements.","mustSupport":false,"mapping":[{"identity":"quick","map":"ImmunizationPerformanceOccurrence"},{"identity":"quick","map":"ImmunizationPerformanceOccurrence"},{"identity":"argonaut-dq-dstu2","map":"Immunization"}]},{"id":"Immunization.status","path":"Immunization.status","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true,"binding":{"strength":"required","description":"Constrained list of immunizaiotn status","valueSet":"http://hl7.org/fhir/ValueSet/immunization-status"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Immunization.status"}]},{"id":"Immunization.statusReason","path":"Immunization.statusReason","min":0,"max":"1","mustSupport":true,"binding":{"strength":"example","valueSet":"http://hl7.org/fhir/ValueSet/immunization-status-reason"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Immunization.wasNotGiven"}]},{"id":"Immunization.vaccineCode","path":"Immunization.vaccineCode","short":"Vaccine Product Type (bind to CVX)","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"condition":["us-core-1"],"constraint":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true}],"key":"us-core-1","severity":"warning","human":"SHOULD have a translation to the NDC value set","expression":"coding.where(system='http://hl7.org/fhir/sid/ndc').empty()","xpath":"not(exists(f:coding/f:system[@value='http://hl7.org/fhir/sid/ndc']))"}],"mustSupport":true,"binding":{"strength":"extensible","description":"The CVX (vaccine administered) code system","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-vaccines-cvx"},"mapping":[{"identity":"quick","map":"vaccine"},{"identity":"quick","map":"vaccine"},{"identity":"argonaut-dq-dstu2","map":"Immunization.vaccineCode"}]},{"id":"Immunization.patient","path":"Immunization.patient","alias":["Patient"],"min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"quick","map":"subject"},{"identity":"quick","map":"subject"},{"identity":"argonaut-dq-dstu2","map":"Immunization.patient"}]},{"id":"Immunization.occurrence[x]","path":"Immunization.occurrence[x]","min":1,"max":"1","type":[{"code":"dateTime"},{"code":"string"}],"mustSupport":true,"mapping":[{"identity":"quick","map":"performanceTime"},{"identity":"quick","map":"performanceTime"},{"identity":"argonaut-dq-dstu2","map":"Immunization.date"}]},{"id":"Immunization.primarySource","path":"Immunization.primarySource","min":1,"max":"1","type":[{"code":"boolean"}],"mustSupport":true,"mapping":[{"identity":"quick","map":"reported"},{"identity":"quick","map":"reported"},{"identity":"argonaut-dq-dstu2","map":"Immunization.reported"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-implantable-device.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-implantable-device.json new file mode 100755 index 000000000..e3feb8fb3 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-implantable-device.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-implantable-device","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Device I0..*us-core-12: Implantable medical devices that have UDI information SHALL represent this information in either carrierAIDC or carrierHRF.
    us-core-9: For implantable medical devices that have UDI information, at least one of the Production Identifiers (UDI-PI) SHALL be present.
    \".\"\".\"\".\" udiCarrier S0..1BackboneElement
    \".\"\".\"\".\"\".\" deviceIdentifier S1..1string
    \".\"\".\"\".\"\".\" carrierAIDC SI0..1base64Binary
    \".\"\".\"\".\"\".\" carrierHRF SI0..1string
    \".\"\".\"\".\" distinctIdentifier SI0..1string
    \".\"\".\"\".\" manufactureDate SI0..1dateTime
    \".\"\".\"\".\" expirationDate SI0..1dateTime
    \".\"\".\"\".\" lotNumber SI0..1string
    \".\"\".\"\".\" serialNumber SI0..1string
    \".\"\".\"\".\" type S1..1CodeableConceptBinding: FHIRDeviceTypes (extensible)
    \".\"\".\"\".\" patient S1..1Reference(US Core Patient Profile)

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device","version":"3.1.0","name":"USCoreImplantableDeviceProfile","title":"US Core Implantable Device Profile","status":"active","experimental":false,"date":"2019-09-17T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Device resource for the minimal set of data to query and retrieve a patient's implantable device(s).","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"udi","uri":"http://fda.gov/UDI","name":"UDI Mapping"}],"kind":"resource","abstract":false,"type":"Device","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Device","derivation":"constraint","snapshot":{"element":[{"id":"Device","path":"Device","short":"Item used in healthcare","definition":"The US Core Implantable Device Profile is based upon the core FHIR Device Resource and created to meet the 2015 Edition Common Clinical Data Set 'Unique device identifier(s) for a patient’s implantable device(s)' requirements.","min":0,"max":"*","base":{"path":"Device","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"us-core-12","severity":"error","human":"Implantable medical devices that have UDI information SHALL represent this information in either carrierAIDC or carrierHRF.","expression":"udiCarrier.empty() or (udiCarrier.carrierAIDC.exists() or udiCarrier.carrierHRF.exists())","xpath":"not(f:udiCarrier) or (f:carrierHRF or f:carrierAIDC)"},{"key":"us-core-9","severity":"error","human":"For implantable medical devices that have UDI information, at least one of the Production Identifiers (UDI-PI) SHALL be present.","expression":"udiCarrier.empty() or (manufactureDate.exists() or expirationDate.exists() or lotNumber.exists() or serialNumber.exists() or distinctIdentifier.exists())","xpath":"not(f:udiCarrier) or (f:manufactureDate or f:expirationDate or f:lotNumber or f:serialNumber or f:distinctIdentifier)"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"rim","map":"Device"},{"identity":"argonaut-dq-dstu2","map":"Device"}]},{"id":"Device.id","path":"Device.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Device.meta","path":"Device.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Device.implicitRules","path":"Device.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Device.language","path":"Device.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Device.text","path":"Device.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Device.contained","path":"Device.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Device.extension","path":"Device.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Device.modifierExtension","path":"Device.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Device.identifier","path":"Device.identifier","short":"Instance identifier","definition":"Unique instance identifiers assigned to a device by manufacturers other organizations or owners.","comment":"The barcode string from a barcode present on a device label or package may identify the instance, include names given to the device in local usage, or may identify the type of device. If the identifier identifies the type of device, Device.type element should be used.","min":0,"max":"*","base":{"path":"Device.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"rim","map":".id"},{"identity":"udi","map":"The serial number which is a component of the production identifier (PI), a conditional, variable portion of a UDI. The identifier.type code should be set to “SNO”(Serial Number) and the system left empty."}]},{"id":"Device.definition","path":"Device.definition","short":"The reference to the definition for the device","definition":"The reference to the definition for the device.","min":0,"max":"1","base":{"path":"Device.definition","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/DeviceDefinition"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.udiCarrier","path":"Device.udiCarrier","short":"Unique Device Identifier (UDI) Barcode string","definition":"Unique device identifier (UDI) assigned to device label or package. Note that the Device may include multiple udiCarriers as it either may include just the udiCarrier for the jurisdiction it is sold, or for multiple jurisdictions it could have been sold.","comment":"Some devices may not have UDI information (for example. historical data or patient reported data).","min":0,"max":"1","base":{"path":"Device.udiCarrier","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"rim","map":".id and .code"},{"identity":"argonaut-dq-dstu2","map":"Device.udi"}]},{"id":"Device.udiCarrier.id","path":"Device.udiCarrier.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Device.udiCarrier.extension","path":"Device.udiCarrier.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Device.udiCarrier.modifierExtension","path":"Device.udiCarrier.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Device.udiCarrier.deviceIdentifier","path":"Device.udiCarrier.deviceIdentifier","short":"Mandatory fixed portion of UDI","definition":"The device identifier (DI) is a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device.","alias":["DI"],"min":1,"max":"1","base":{"path":"Device.udiCarrier.deviceIdentifier","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":"Role.id.extension"},{"identity":"udi","map":"The device identifier (DI), a mandatory, fixed portion of a UDI that identifies the labeler and the specific version or model of a device."},{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.udiCarrier.issuer","path":"Device.udiCarrier.issuer","short":"UDI Issuing Organization","definition":"Organization that is charged with issuing UDIs for devices. For example, the US FDA issuers include :\n1) GS1: \nhttp://hl7.org/fhir/NamingSystem/gs1-di, \n2) HIBCC:\nhttp://hl7.org/fhir/NamingSystem/hibcc-dI, \n3) ICCBBA for blood containers:\nhttp://hl7.org/fhir/NamingSystem/iccbba-blood-di, \n4) ICCBA for other devices:\nhttp://hl7.org/fhir/NamingSystem/iccbba-other-di.","alias":["Barcode System"],"min":0,"max":"1","base":{"path":"Device.udiCarrier.issuer","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Role.id.root"},{"identity":"udi","map":"All UDIs are to be issued under a system operated by an Jurisdiction-accredited issuing agency.\nGS1 DIs: \n http://hl7.org/fhir/NamingSystem/gs1\nHIBCC DIs:\n http://hl7.org/fhir/NamingSystem/hibcc\nICCBBA DIs for blood containers:\n http://hl7.org/fhir/NamingSystem/iccbba-blood\nICCBA DIs for other devices:\n http://hl7.org/fhir/NamingSystem/iccbba-other"}]},{"id":"Device.udiCarrier.jurisdiction","path":"Device.udiCarrier.jurisdiction","short":"Regional UDI authority","definition":"The identity of the authoritative source for UDI generation within a jurisdiction. All UDIs are globally unique within a single namespace with the appropriate repository uri as the system. For example, UDIs of devices managed in the U.S. by the FDA, the value is http://hl7.org/fhir/NamingSystem/fda-udi.","requirements":"Allows a recipient of a UDI to know which database will contain the UDI-associated metadata.","min":0,"max":"1","base":{"path":"Device.udiCarrier.jurisdiction","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Role.scoper"}]},{"id":"Device.udiCarrier.carrierAIDC","path":"Device.udiCarrier.carrierAIDC","short":"UDI Machine Readable Barcode String","definition":"The full UDI carrier of the Automatic Identification and Data Capture (AIDC) technology representation of the barcode string as printed on the packaging of the device - e.g., a barcode or RFID. Because of limitations on character sets in XML and the need to round-trip JSON data through XML, AIDC Formats *SHALL* be base64 encoded.","comment":"The AIDC form of UDIs should be scanned or otherwise used for the identification of the device whenever possible to minimize errors in records resulting from manual transcriptions. If separate barcodes for DI and PI are present, concatenate the string with DI first and in order of human readable expression on label.","alias":["Automatic Identification and Data Capture","UDI","Barcode String"],"min":0,"max":"1","base":{"path":"Device.udiCarrier.carrierAIDC","min":0,"max":"1"},"type":[{"code":"base64Binary"}],"condition":["us-core-12"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"Role.id.extension"},{"identity":"udi","map":"A unique device identifier (UDI) on a device label a form that uses automatic identification and data capture (AIDC) technology."},{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.udiCarrier.carrierHRF","path":"Device.udiCarrier.carrierHRF","short":"UDI Human Readable Barcode String","definition":"The full UDI carrier as the human readable form (HRF) representation of the barcode string as printed on the packaging of the device.","comment":"If separate barcodes for DI and PI are present, concatenate the string with DI first and in order of human readable expression on label.","alias":["Human Readable Form","UDI","Barcode String"],"min":0,"max":"1","base":{"path":"Device.udiCarrier.carrierHRF","min":0,"max":"1"},"type":[{"code":"string"}],"condition":["us-core-12"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"Role.id.extension"},{"identity":"udi","map":"A unique device identifier (UDI) on a device label in plain text"},{"identity":"argonaut-dq-dstu2","map":"Device.udi"}]},{"id":"Device.udiCarrier.entryType","path":"Device.udiCarrier.entryType","short":"barcode | rfid | manual +","definition":"A coded entry to indicate how the data was entered.","requirements":"Supports a way to distinguish hand entered from machine read data.","min":0,"max":"1","base":{"path":"Device.udiCarrier.entryType","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"UDIEntryType"}],"strength":"required","description":"Codes to identify how UDI data was entered.","valueSet":"http://hl7.org/fhir/ValueSet/udi-entry-type|4.0.1"},"mapping":[{"identity":"rim","map":"NA"}]},{"id":"Device.status","path":"Device.status","short":"active | inactive | entered-in-error | unknown","definition":"Status of the Device availability.","comment":"This element is labeled as a modifier because the status contains the codes inactive and entered-in-error that mark the device (record)as not currently valid.","min":0,"max":"1","base":{"path":"Device.status","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"FHIRDeviceStatus"}],"strength":"required","description":"The availability status of the device.","valueSet":"http://hl7.org/fhir/ValueSet/device-status|4.0.1"},"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":".statusCode"}]},{"id":"Device.statusReason","path":"Device.statusReason","short":"online | paused | standby | offline | not-ready | transduc-discon | hw-discon | off","definition":"Reason for the dtatus of the Device availability.","min":0,"max":"*","base":{"path":"Device.statusReason","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"FHIRDeviceStatusReason"}],"strength":"extensible","description":"The availability status reason of the device.","valueSet":"http://hl7.org/fhir/ValueSet/device-status-reason"},"mapping":[{"identity":"w5","map":"FiveWs.status"}]},{"id":"Device.distinctIdentifier","path":"Device.distinctIdentifier","short":"The distinct identification string","definition":"The distinct identification string as required by regulation for a human cell, tissue, or cellular and tissue-based product.","comment":"For example, this applies to devices in the United States regulated under *Code of Federal Regulation 21CFR§1271.290(c)*.","alias":["Distinct Identification Code (DIC)"],"min":0,"max":"1","base":{"path":"Device.distinctIdentifier","min":0,"max":"1"},"type":[{"code":"string"}],"condition":["us-core-9"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":".lotNumberText"},{"identity":"udi","map":"The lot or batch number within which a device was manufactured - which is a component of the production identifier (PI), a conditional, variable portion of a UDI."},{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.manufacturer","path":"Device.manufacturer","short":"Name of device manufacturer","definition":"A name of the manufacturer.","min":0,"max":"1","base":{"path":"Device.manufacturer","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":".playedRole[typeCode=MANU].scoper.name"},{"identity":"udi","map":"N/A"}]},{"id":"Device.manufactureDate","path":"Device.manufactureDate","short":"Date when the device was made","definition":"The date and time when the device was manufactured.","min":0,"max":"1","base":{"path":"Device.manufactureDate","min":0,"max":"1"},"type":[{"code":"dateTime"}],"condition":["us-core-9"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":".existenceTime.low"},{"identity":"udi","map":"The date a specific device was manufactured - which is a component of the production identifier (PI), a conditional, variable portion of a UDI. For FHIR, The datetime syntax must converted to YYYY-MM-DD[THH:MM:SS]. If hour is present, the minutes and seconds should both be set to “00”."},{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.expirationDate","path":"Device.expirationDate","short":"Date and time of expiry of this device (if applicable)","definition":"The date and time beyond which this device is no longer valid or should not be used (if applicable).","min":0,"max":"1","base":{"path":"Device.expirationDate","min":0,"max":"1"},"type":[{"code":"dateTime"}],"condition":["us-core-9"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":".expirationTime"},{"identity":"udi","map":"the expiration date of a specific device - which is a component of the production identifier (PI), a conditional, variable portion of a UDI. For FHIR, The datetime syntax must converted to YYYY-MM-DD[THH:MM:SS]. If hour is present, the minutes and seconds should both be set to “00”."},{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.lotNumber","path":"Device.lotNumber","short":"Lot number of manufacture","definition":"Lot number assigned by the manufacturer.","min":0,"max":"1","base":{"path":"Device.lotNumber","min":0,"max":"1"},"type":[{"code":"string"}],"condition":["us-core-9"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":".lotNumberText"},{"identity":"udi","map":"The lot or batch number within which a device was manufactured - which is a component of the production identifier (PI), a conditional, variable portion of a UDI."},{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.serialNumber","path":"Device.serialNumber","short":"Serial number assigned by the manufacturer","definition":"The serial number assigned by the organization when the device was manufactured.","comment":"Alphanumeric Maximum 20.","min":0,"max":"1","base":{"path":"Device.serialNumber","min":0,"max":"1"},"type":[{"code":"string"}],"condition":["us-core-9"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":".playedRole[typeCode=MANU].id"},{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.deviceName","path":"Device.deviceName","short":"The name of the device as given by the manufacturer","definition":"This represents the manufacturer's name of the device as provided by the device, from a UDI label, or by a person describing the Device. This typically would be used when a person provides the name(s) or when the device represents one of the names available from DeviceDefinition.","min":0,"max":"*","base":{"path":"Device.deviceName","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.deviceName.id","path":"Device.deviceName.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Device.deviceName.extension","path":"Device.deviceName.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Device.deviceName.modifierExtension","path":"Device.deviceName.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Device.deviceName.name","path":"Device.deviceName.name","short":"The name of the device","definition":"The name of the device.","alias":["Σ"],"min":1,"max":"1","base":{"path":"Device.deviceName.name","min":1,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.deviceName.type","path":"Device.deviceName.type","short":"udi-label-name | user-friendly-name | patient-reported-name | manufacturer-name | model-name | other","definition":"The type of deviceName.\nUDILabelName | UserFriendlyName | PatientReportedName | ManufactureDeviceName | ModelName.","min":1,"max":"1","base":{"path":"Device.deviceName.type","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DeviceNameType"}],"strength":"required","description":"The type of name the device is referred by.","valueSet":"http://hl7.org/fhir/ValueSet/device-nametype|4.0.1"},"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":".playedRole[typeCode=MANU].code"}]},{"id":"Device.modelNumber","path":"Device.modelNumber","short":"The model number for the device","definition":"The model number for the device.","min":0,"max":"1","base":{"path":"Device.modelNumber","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":".softwareName (included as part)"}]},{"id":"Device.partNumber","path":"Device.partNumber","short":"The part number of the device","definition":"The part number of the device.","comment":"Alphanumeric Maximum 20.","min":0,"max":"1","base":{"path":"Device.partNumber","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":".playedRole[typeCode=MANU].id"}]},{"id":"Device.type","path":"Device.type","short":"The kind or type of device","definition":"The kind or type of device.","min":1,"max":"1","base":{"path":"Device.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"strength":"extensible","description":"Codes to identify medical devices","valueSet":"http://hl7.org/fhir/ValueSet/device-kind"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Device.type"}]},{"id":"Device.specialization","path":"Device.specialization","short":"The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication","definition":"The capabilities supported on a device, the standards to which the device conforms for a particular purpose, and used for the communication.","min":0,"max":"*","base":{"path":"Device.specialization","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.specialization.id","path":"Device.specialization.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Device.specialization.extension","path":"Device.specialization.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Device.specialization.modifierExtension","path":"Device.specialization.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Device.specialization.systemType","path":"Device.specialization.systemType","short":"The standard that is used to operate and communicate","definition":"The standard that is used to operate and communicate.","alias":["Σ"],"min":1,"max":"1","base":{"path":"Device.specialization.systemType","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.specialization.version","path":"Device.specialization.version","short":"The version of the standard that is used to operate and communicate","definition":"The version of the standard that is used to operate and communicate.","min":0,"max":"1","base":{"path":"Device.specialization.version","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"}]},{"id":"Device.version","path":"Device.version","short":"The actual design of the device or software version running on the device","definition":"The actual design of the device or software version running on the device.","min":0,"max":"*","base":{"path":"Device.version","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.version.id","path":"Device.version.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Device.version.extension","path":"Device.version.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Device.version.modifierExtension","path":"Device.version.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Device.version.type","path":"Device.version.type","short":"The type of the device version","definition":"The type of the device version.","alias":["Σ"],"min":0,"max":"1","base":{"path":"Device.version.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.version.component","path":"Device.version.component","short":"A single component of the device version","definition":"A single component of the device version.","min":0,"max":"1","base":{"path":"Device.version.component","min":0,"max":"1"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"}]},{"id":"Device.version.value","path":"Device.version.value","short":"The version text","definition":"The version text.","min":1,"max":"1","base":{"path":"Device.version.value","min":1,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.property","path":"Device.property","short":"The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties","definition":"The actual configuration settings of a device as it actually operates, e.g., regulation status, time properties.","min":0,"max":"*","base":{"path":"Device.property","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.property.id","path":"Device.property.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Device.property.extension","path":"Device.property.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Device.property.modifierExtension","path":"Device.property.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Device.property.type","path":"Device.property.type","short":"Code that specifies the property DeviceDefinitionPropetyCode (Extensible)","definition":"Code that specifies the property DeviceDefinitionPropetyCode (Extensible).","min":1,"max":"1","base":{"path":"Device.property.type","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.property.valueQuantity","path":"Device.property.valueQuantity","short":"Property value as a quantity","definition":"Property value as a quantity.","min":0,"max":"*","base":{"path":"Device.property.valueQuantity","min":0,"max":"*"},"type":[{"code":"Quantity"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.property.valueCode","path":"Device.property.valueCode","short":"Property value as a code, e.g., NTP4 (synced to NTP)","definition":"Property value as a code, e.g., NTP4 (synced to NTP).","min":0,"max":"*","base":{"path":"Device.property.valueCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false},{"id":"Device.patient","path":"Device.patient","short":"Patient to whom Device is affixed","definition":"Patient information, If the device is affixed to a person.","requirements":"If the device is implanted in a patient, then need to associate the device to the patient.","min":1,"max":"1","base":{"path":"Device.patient","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"rim","map":".playedRole[typeCode=USED].scoper.playedRole[typeCode=PAT]"},{"identity":"w5","map":"FiveWs.subject"},{"identity":"argonaut-dq-dstu2","map":"Device.patient"}]},{"id":"Device.owner","path":"Device.owner","short":"Organization responsible for device","definition":"An organization that is responsible for the provision and ongoing maintenance of the device.","min":0,"max":"1","base":{"path":"Device.owner","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.source"},{"identity":"rim","map":".playedRole[typeCode=OWN].scoper"}]},{"id":"Device.contact","path":"Device.contact","short":"Details for human/organization for support","definition":"Contact details for an organization or a particular human that is responsible for the device.","comment":"used for troubleshooting etc.","min":0,"max":"*","base":{"path":"Device.contact","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.source"},{"identity":"rim","map":".scopedRole[typeCode=CON].player"}]},{"id":"Device.location","path":"Device.location","short":"Where the device is found","definition":"The place where the device can be found.","requirements":"Device.location can be used to track device location.","min":0,"max":"1","base":{"path":"Device.location","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.where[x]"},{"identity":"rim","map":".playedRole[typeCode=LOCE].scoper"}]},{"id":"Device.url","path":"Device.url","short":"Network address to contact device","definition":"A network address on which the device may be contacted directly.","comment":"If the device is running a FHIR server, the network address should be the Base URL from which a conformance statement may be retrieved.","min":0,"max":"1","base":{"path":"Device.url","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.where[x]"},{"identity":"rim","map":".telecom"}]},{"id":"Device.note","path":"Device.note","short":"Device notes and comments","definition":"Descriptive information, usage information or implantation information that is not captured in an existing element.","min":0,"max":"*","base":{"path":"Device.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".text"}]},{"id":"Device.safety","path":"Device.safety","short":"Safety Characteristics of Device","definition":"Provides additional safety characteristics about a medical device. For example devices containing latex.","min":0,"max":"*","base":{"path":"Device.safety","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"NA"}]},{"id":"Device.parent","path":"Device.parent","short":"The parent device","definition":"The parent device.","min":0,"max":"1","base":{"path":"Device.parent","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Device"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false}]},"differential":{"element":[{"id":"Device","path":"Device","definition":"The US Core Implantable Device Profile is based upon the core FHIR Device Resource and created to meet the 2015 Edition Common Clinical Data Set 'Unique device identifier(s) for a patient’s implantable device(s)' requirements.","constraint":[{"key":"us-core-12","severity":"error","human":"Implantable medical devices that have UDI information SHALL represent this information in either carrierAIDC or carrierHRF.","expression":"udiCarrier.empty() or (udiCarrier.carrierAIDC.exists() or udiCarrier.carrierHRF.exists())","xpath":"not(f:udiCarrier) or (f:carrierHRF or f:carrierAIDC)"},{"key":"us-core-9","severity":"error","human":"For implantable medical devices that have UDI information, at least one of the Production Identifiers (UDI-PI) SHALL be present.","expression":"udiCarrier.empty() or (manufactureDate.exists() or expirationDate.exists() or lotNumber.exists() or serialNumber.exists() or distinctIdentifier.exists())","xpath":"not(f:udiCarrier) or (f:manufactureDate or f:expirationDate or f:lotNumber or f:serialNumber or f:distinctIdentifier)"}],"mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Device"}]},{"id":"Device.udiCarrier","path":"Device.udiCarrier","comment":"Some devices may not have UDI information (for example. historical data or patient reported data).","min":0,"max":"1","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Device.udi"}]},{"id":"Device.udiCarrier.deviceIdentifier","path":"Device.udiCarrier.deviceIdentifier","alias":["DI"],"min":1,"max":"1","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.udiCarrier.carrierAIDC","path":"Device.udiCarrier.carrierAIDC","alias":["UDI","Barcode String"],"min":0,"max":"1","condition":["us-core-12"],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.udiCarrier.carrierHRF","path":"Device.udiCarrier.carrierHRF","alias":["UDI","Barcode String"],"min":0,"max":"1","condition":["us-core-12"],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Device.udi"}]},{"id":"Device.distinctIdentifier","path":"Device.distinctIdentifier","min":0,"max":"1","condition":["us-core-9"],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.manufactureDate","path":"Device.manufactureDate","min":0,"max":"1","condition":["us-core-9"],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.expirationDate","path":"Device.expirationDate","min":0,"max":"1","condition":["us-core-9"],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.lotNumber","path":"Device.lotNumber","min":0,"max":"1","condition":["us-core-9"],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.serialNumber","path":"Device.serialNumber","min":0,"max":"1","condition":["us-core-9"],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA (not Supported)"}]},{"id":"Device.type","path":"Device.type","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","description":"Codes to identify medical devices","valueSet":"http://hl7.org/fhir/ValueSet/device-kind"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Device.type"}]},{"id":"Device.patient","path":"Device.patient","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Device.patient"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-location.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-location.json new file mode 100755 index 000000000..11e2068f9 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-location.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-location","text":{"status":"generated","div":""},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-location","version":"3.1.0","name":"USCoreLocation","title":"US Core Location Profile","status":"active","experimental":false,"date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines basic constraints and extensions on the Location resource for use with other US Core resources","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"}],"kind":"resource","abstract":false,"type":"Location","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Location","derivation":"constraint","snapshot":{"element":[{"id":"Location","path":"Location","short":"Details and position information for a physical place","definition":"Details and position information for a physical place where services are provided and resources and participants may be stored, found, contained, or accommodated.","min":0,"max":"*","base":{"path":"Location","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"rim","map":".Role[classCode=SDLC]"},{"identity":"servd","map":"Organization"}]},{"id":"Location.id","path":"Location.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Location.meta","path":"Location.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Location.implicitRules","path":"Location.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Location.language","path":"Location.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Location.text","path":"Location.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Location.contained","path":"Location.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Location.extension","path":"Location.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Location.modifierExtension","path":"Location.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Location.identifier","path":"Location.identifier","short":"Unique code or number identifying the location to its users","definition":"Unique code or number identifying the location to its users.","requirements":"Organization label locations in registries, need to keep track of those.","min":0,"max":"*","base":{"path":"Location.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"rim","map":".id"}]},{"id":"Location.status","path":"Location.status","short":"active | suspended | inactive","definition":"The status property covers the general availability of the resource, not the current value which may be covered by the operationStatus, or by a schedule/slots if they are configured for the location.","min":0,"max":"1","base":{"path":"Location.status","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LocationStatus"}],"strength":"required","description":"Indicates whether the location is still in use.","valueSet":"http://hl7.org/fhir/ValueSet/location-status|4.0.1"},"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":".statusCode"}]},{"id":"Location.operationalStatus","path":"Location.operationalStatus","short":"The operational status of the location (typically only for a bed/room)","definition":"The operational status covers operation values most relevant to beds (but can also apply to rooms/units/chairs/etc. such as an isolation unit/dialysis chair). This typically covers concepts such as contamination, housekeeping, and other activities like maintenance.","min":0,"max":"1","base":{"path":"Location.operationalStatus","min":0,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"OperationalStatus"}],"strength":"preferred","description":"The operational status if the location (where typically a bed/room).","valueSet":"http://terminology.hl7.org/ValueSet/v2-0116"},"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"n/a"}]},{"id":"Location.name","path":"Location.name","short":"Name of the location as used by humans","definition":"Name of the location as used by humans. Does not need to be unique.","comment":"If the name of a location changes, consider putting the old name in the alias column so that it can still be located through searches.","min":1,"max":"1","base":{"path":"Location.name","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".name"},{"identity":"servd","map":"./PrimaryAddress and ./OtherAddresses"}]},{"id":"Location.alias","path":"Location.alias","short":"A list of alternate names that the location is known as, or was known as, in the past","definition":"A list of alternate names that the location is known as, or was known as, in the past.","comment":"There are no dates associated with the alias/historic names, as this is not intended to track when names were used, but to assist in searching so that older names can still result in identifying the location.","requirements":"Over time locations and organizations go through many changes and can be known by different names.\n\nFor searching knowing previous names that the location was known by can be very useful.","min":0,"max":"*","base":{"path":"Location.alias","min":0,"max":"*"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".name"}]},{"id":"Location.description","path":"Location.description","short":"Additional details about the location that could be displayed as further information to identify the location beyond its name","definition":"Description of the Location, which helps in finding or referencing the place.","requirements":"Humans need additional information to verify a correct location has been identified.","min":0,"max":"1","base":{"path":"Location.description","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".playingEntity[classCode=PLC determinerCode=INSTANCE].desc"}]},{"id":"Location.mode","path":"Location.mode","short":"instance | kind","definition":"Indicates whether a resource instance represents a specific location or a class of locations.","comment":"This is labeled as a modifier because whether or not the location is a class of locations changes how it can be used and understood.","requirements":"When using a Location resource for scheduling or orders, we need to be able to refer to a class of Locations instead of a specific Location.","min":0,"max":"1","base":{"path":"Location.mode","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LocationMode"}],"strength":"required","description":"Indicates whether a resource instance represents a specific location or a class of locations.","valueSet":"http://hl7.org/fhir/ValueSet/location-mode|4.0.1"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".playingEntity[classCode=PLC].determinerCode"}]},{"id":"Location.type","path":"Location.type","short":"Type of function performed","definition":"Indicates the type of function performed at the location.","min":0,"max":"*","base":{"path":"Location.type","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LocationType"}],"strength":"extensible","description":"Indicates the type of function performed at the location.","valueSet":"http://terminology.hl7.org/ValueSet/v3-ServiceDeliveryLocationRoleType"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".code"}]},{"id":"Location.telecom","path":"Location.telecom","short":"Contact details of the location","definition":"The contact details of communication devices available at the location. This can include phone numbers, fax numbers, mobile numbers, email addresses and web sites.","min":0,"max":"*","base":{"path":"Location.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".telecom"}]},{"id":"Location.address","path":"Location.address","short":"Physical location","definition":"Physical location.","comment":"Additional addresses should be recorded using another instance of the Location resource, or via the Organization.","requirements":"If locations can be visited, we need to keep track of their address.","min":0,"max":"1","base":{"path":"Location.address","min":0,"max":"1"},"type":[{"code":"Address"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".addr"},{"identity":"servd","map":"n/a"}]},{"id":"Location.address.id","path":"Location.address.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.address.extension","path":"Location.address.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.address.use","path":"Location.address.use","short":"home | work | temp | old | billing - purpose of this address","definition":"The purpose of this address.","comment":"Applications can assume that an address is current unless it explicitly says that it is temporary or old.","requirements":"Allows an appropriate address to be chosen from a list of many.","min":0,"max":"1","base":{"path":"Address.use","min":0,"max":"1"},"type":[{"code":"code"}],"example":[{"label":"General","valueCode":"home"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old address etc.for a current/permanent one","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AddressUse"}],"strength":"required","description":"The use of an address.","valueSet":"http://hl7.org/fhir/ValueSet/address-use|4.0.1"},"mapping":[{"identity":"v2","map":"XAD.7"},{"identity":"rim","map":"unique(./use)"},{"identity":"servd","map":"./AddressPurpose"}]},{"id":"Location.address.type","path":"Location.address.type","short":"postal | physical | both","definition":"Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.","comment":"The definition of Address states that \"address is intended to describe postal addresses, not physical locations\". However, many applications track whether an address has a dual purpose of being a location that can be visited as well as being a valid delivery destination, and Postal addresses are often used as proxies for physical locations (also see the [Location](http://hl7.org/fhir/R4/location.html#) resource).","min":0,"max":"1","base":{"path":"Address.type","min":0,"max":"1"},"type":[{"code":"code"}],"example":[{"label":"General","valueCode":"both"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AddressType"}],"strength":"required","description":"The type of an address (physical / postal).","valueSet":"http://hl7.org/fhir/ValueSet/address-type|4.0.1"},"mapping":[{"identity":"v2","map":"XAD.18"},{"identity":"rim","map":"unique(./use)"},{"identity":"vcard","map":"address type parameter"}]},{"id":"Location.address.text","path":"Location.address.text","short":"Text representation of the address","definition":"Specifies the entire address as it should be displayed e.g. on a postal label. This may be provided instead of or as well as the specific parts.","comment":"Can provide both a text representation and parts. Applications updating an address SHALL ensure that when both text and parts are present, no content is included in the text that isn't found in a part.","requirements":"A renderable, unencoded form.","min":0,"max":"1","base":{"path":"Address.text","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"137 Nowhere Street, Erewhon 9132"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.1 + XAD.2 + XAD.3 + XAD.4 + XAD.5 + XAD.6"},{"identity":"rim","map":"./formatted"},{"identity":"vcard","map":"address label parameter"}]},{"id":"Location.address.line","path":"Location.address.line","short":"Street name, number, direction & P.O. Box etc.","definition":"This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.","min":0,"max":"*","base":{"path":"Address.line","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"The order in which lines should appear in an address label","example":[{"label":"General","valueString":"137 Nowhere Street"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.1 + XAD.2 (note: XAD.1 and XAD.2 have different meanings for a company address than for a person address)"},{"identity":"rim","map":"AD.part[parttype = AL]"},{"identity":"vcard","map":"street"},{"identity":"servd","map":"./StreetAddress (newline delimitted)"}]},{"id":"Location.address.city","path":"Location.address.city","short":"Name of city, town etc.","definition":"The name of the city, town, suburb, village or other community or delivery center.","alias":["Municpality"],"min":0,"max":"1","base":{"path":"Address.city","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"Erewhon"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.3"},{"identity":"rim","map":"AD.part[parttype = CTY]"},{"identity":"vcard","map":"locality"},{"identity":"servd","map":"./Jurisdiction"}]},{"id":"Location.address.district","path":"Location.address.district","short":"District name (aka county)","definition":"The name of the administrative area (county).","comment":"District is sometimes known as county, but in some regions 'county' is used in place of city (municipality), so county name should be conveyed in city instead.","alias":["County"],"min":0,"max":"1","base":{"path":"Address.district","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"Madison"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.9"},{"identity":"rim","map":"AD.part[parttype = CNT | CPA]"}]},{"id":"Location.address.state","path":"Location.address.state","short":"Sub-unit of country (abbreviations ok)","definition":"Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes).","alias":["Province","Territory"],"min":0,"max":"1","base":{"path":"Address.state","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Two letter USPS alphabetic codes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state"},"mapping":[{"identity":"v2","map":"XAD.4"},{"identity":"rim","map":"AD.part[parttype = STA]"},{"identity":"vcard","map":"region"},{"identity":"servd","map":"./Region"},{"identity":"servd","map":"./Sites"}]},{"id":"Location.address.postalCode","path":"Location.address.postalCode","short":"US Zip Codes","definition":"A postal code designating a region defined by the postal service.","alias":["Zip"],"min":0,"max":"1","base":{"path":"Address.postalCode","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"9132"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.5"},{"identity":"rim","map":"AD.part[parttype = ZIP]"},{"identity":"vcard","map":"code"},{"identity":"servd","map":"./PostalIdentificationCode"}]},{"id":"Location.address.country","path":"Location.address.country","short":"Country (e.g. can be ISO 3166 2 or 3 letter code)","definition":"Country - a nation as commonly understood or generally accepted.","comment":"ISO 3166 3 letter codes can be used in place of a human readable country name.","min":0,"max":"1","base":{"path":"Address.country","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.6"},{"identity":"rim","map":"AD.part[parttype = CNT]"},{"identity":"vcard","map":"country"},{"identity":"servd","map":"./Country"}]},{"id":"Location.address.period","path":"Location.address.period","short":"Time period when address was/is in use","definition":"Time period when address was/is in use.","requirements":"Allows addresses to be placed in historical context.","min":0,"max":"1","base":{"path":"Address.period","min":0,"max":"1"},"type":[{"code":"Period"}],"example":[{"label":"General","valuePeriod":{"start":"2010-03-23T00:00:00+11:00","end":"2010-07-01T00:00:00+10:00"}}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.12 / XAD.13 + XAD.14"},{"identity":"rim","map":"./usablePeriod[type=\"IVL\"]"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Location.physicalType","path":"Location.physicalType","short":"Physical form of the location","definition":"Physical form of the location, e.g. building, room, vehicle, road.","requirements":"For purposes of showing relevant locations in queries, we need to categorize locations.","min":0,"max":"1","base":{"path":"Location.physicalType","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"PhysicalType"}],"strength":"example","description":"Physical form of the location.","valueSet":"http://hl7.org/fhir/ValueSet/location-physical-type"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".playingEntity [classCode=PLC].code"}]},{"id":"Location.position","path":"Location.position","short":"The absolute geographic location","definition":"The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system used in KML).","requirements":"For mobile applications and automated route-finding knowing the exact location of the Location is required.","min":0,"max":"1","base":{"path":"Location.position","min":0,"max":"1"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity [classCode=PLC determinerCode=INSTANCE].positionText"}]},{"id":"Location.position.id","path":"Location.position.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.position.extension","path":"Location.position.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.position.modifierExtension","path":"Location.position.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Location.position.longitude","path":"Location.position.longitude","short":"Longitude with WGS84 datum","definition":"Longitude. The value domain and the interpretation are the same as for the text of the longitude element in KML (see notes below).","min":1,"max":"1","base":{"path":"Location.position.longitude","min":1,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"(RIM Opted not to map the sub-elements of GPS location, is now an OBS)"}]},{"id":"Location.position.latitude","path":"Location.position.latitude","short":"Latitude with WGS84 datum","definition":"Latitude. The value domain and the interpretation are the same as for the text of the latitude element in KML (see notes below).","min":1,"max":"1","base":{"path":"Location.position.latitude","min":1,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"(RIM Opted not to map the sub-elements of GPS location, is now an OBS)"}]},{"id":"Location.position.altitude","path":"Location.position.altitude","short":"Altitude with WGS84 datum","definition":"Altitude. The value domain and the interpretation are the same as for the text of the altitude element in KML (see notes below).","min":0,"max":"1","base":{"path":"Location.position.altitude","min":0,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"(RIM Opted not to map the sub-elements of GPS location, is now an OBS)"}]},{"id":"Location.managingOrganization","path":"Location.managingOrganization","short":"Organization responsible for provisioning and upkeep","definition":"The organization responsible for the provisioning and upkeep of the location.","comment":"This can also be used as the part of the organization hierarchy where this location provides services. These services can be defined through the HealthcareService resource.","requirements":"Need to know who manages the location.","min":0,"max":"1","base":{"path":"Location.managingOrganization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".scopingEntity[classCode=ORG determinerKind=INSTANCE]"}]},{"id":"Location.partOf","path":"Location.partOf","short":"Another Location this one is physically a part of","definition":"Another Location of which this Location is physically a part of.","requirements":"For purposes of location, display and identification, knowing which locations are located within other locations is important.","min":0,"max":"1","base":{"path":"Location.partOf","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".inboundLink[typeCode=PART].source[classCode=SDLC]"}]},{"id":"Location.hoursOfOperation","path":"Location.hoursOfOperation","short":"What days/times during a week is this location usually open","definition":"What days/times during a week is this location usually open.","comment":"This type of information is commonly found published in directories and on websites informing customers when the facility is available.\n\nSpecific services within the location may have their own hours which could be shorter (or longer) than the locations hours.","min":0,"max":"*","base":{"path":"Location.hoursOfOperation","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"Location.hoursOfOperation.id","path":"Location.hoursOfOperation.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.hoursOfOperation.extension","path":"Location.hoursOfOperation.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.hoursOfOperation.modifierExtension","path":"Location.hoursOfOperation.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Location.hoursOfOperation.daysOfWeek","path":"Location.hoursOfOperation.daysOfWeek","short":"mon | tue | wed | thu | fri | sat | sun","definition":"Indicates which days of the week are available between the start and end Times.","min":0,"max":"*","base":{"path":"Location.hoursOfOperation.daysOfWeek","min":0,"max":"*"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DaysOfWeek"}],"strength":"required","description":"The days of the week.","valueSet":"http://hl7.org/fhir/ValueSet/days-of-week|4.0.1"},"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"Location.hoursOfOperation.allDay","path":"Location.hoursOfOperation.allDay","short":"The Location is open all day","definition":"The Location is open all day.","min":0,"max":"1","base":{"path":"Location.hoursOfOperation.allDay","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"Location.hoursOfOperation.openingTime","path":"Location.hoursOfOperation.openingTime","short":"Time that the Location opens","definition":"Time that the Location opens.","min":0,"max":"1","base":{"path":"Location.hoursOfOperation.openingTime","min":0,"max":"1"},"type":[{"code":"time"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"Location.hoursOfOperation.closingTime","path":"Location.hoursOfOperation.closingTime","short":"Time that the Location closes","definition":"Time that the Location closes.","min":0,"max":"1","base":{"path":"Location.hoursOfOperation.closingTime","min":0,"max":"1"},"type":[{"code":"time"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"Location.availabilityExceptions","path":"Location.availabilityExceptions","short":"Description of availability exceptions","definition":"A description of when the locations opening ours are different to normal, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as detailed in the opening hours Times.","min":0,"max":"1","base":{"path":"Location.availabilityExceptions","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Location.endpoint","path":"Location.endpoint","short":"Technical endpoints providing access to services operated for the location","definition":"Technical endpoints providing access to services operated for the location.","requirements":"Organizations may have different systems at different locations that provide various services and need to be able to define the technical connection details for how to connect to them, and for what purpose.","min":0,"max":"*","base":{"path":"Location.endpoint","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Endpoint"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]}]},"differential":{"element":[{"id":"Location","path":"Location","mustSupport":false,"mapping":[{"identity":"servd","map":"Organization"}]},{"id":"Location.status","path":"Location.status","min":0,"max":"1","type":[{"code":"code"}],"mustSupport":true},{"id":"Location.name","path":"Location.name","min":1,"max":"1","type":[{"code":"string"}],"mustSupport":true,"mapping":[{"identity":"servd","map":"./PrimaryAddress and ./OtherAddresses"}]},{"id":"Location.telecom","path":"Location.telecom","min":0,"max":"*","type":[{"code":"ContactPoint"}],"mustSupport":true},{"id":"Location.address","path":"Location.address","min":0,"max":"1","type":[{"code":"Address"}],"mustSupport":true,"mapping":[{"identity":"servd","map":"n/a"}]},{"id":"Location.address.line","path":"Location.address.line","min":0,"max":"*","type":[{"code":"string"}],"mustSupport":true},{"id":"Location.address.city","path":"Location.address.city","min":0,"max":"1","type":[{"code":"string"}],"mustSupport":true},{"id":"Location.address.state","path":"Location.address.state","min":0,"max":"1","type":[{"code":"string"}],"mustSupport":true,"binding":{"strength":"extensible","description":"Two letter USPS alphabetic codes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state"},"mapping":[{"identity":"servd","map":"./Sites"}]},{"id":"Location.address.postalCode","path":"Location.address.postalCode","short":"US Zip Codes","min":0,"max":"1","type":[{"code":"string"}],"mustSupport":true},{"id":"Location.managingOrganization","path":"Location.managingOrganization","min":0,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-medication.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-medication.json new file mode 100755 index 000000000..a33fcd7e4 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-medication.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-medication","text":{"status":"generated","div":""},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication","version":"3.1.0","name":"USCoreMedicationProfile","title":"US Core Medication Profile","status":"active","experimental":false,"date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Medication resource for the minimal set of data to query and retrieve patient retrieving patient's medication information.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"script10.6","uri":"http://ncpdp.org/SCRIPT10_6","name":"Mapping to NCPDP SCRIPT 10.6"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"}],"kind":"resource","abstract":false,"type":"Medication","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Medication","derivation":"constraint","snapshot":{"element":[{"id":"Medication","path":"Medication","short":"Definition of a Medication","definition":"The US Core Medication Profile is based upon the core FHIR Medication Resource and created to meet the 2015 Edition Common Clinical Data Set 'Medications' requirements.","min":0,"max":"*","base":{"path":"Medication","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"script10.6","map":"NewRx/MedicationPrescribed\r-or-\rRxFill/MedicationDispensed\r-or-\rRxHistoryResponse/MedicationDispensed\r-or-\rRxHistoryResponse/MedicationPrescribed"},{"identity":"rim","map":"ManufacturedProduct[classCode=ADMM]"},{"identity":"argonaut-dq-dstu2","map":"Medication"}]},{"id":"Medication.id","path":"Medication.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Medication.meta","path":"Medication.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Medication.implicitRules","path":"Medication.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Medication.language","path":"Medication.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Medication.text","path":"Medication.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Medication.contained","path":"Medication.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Medication.extension","path":"Medication.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Medication.modifierExtension","path":"Medication.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Medication.identifier","path":"Medication.identifier","short":"Business identifier for this medication","definition":"Business identifier for this medication.","comment":"The serial number could be included as an identifier.","min":0,"max":"*","base":{"path":"Medication.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"rim","map":".id"}]},{"id":"Medication.code","path":"Medication.code","short":"Codes that identify this medication","definition":"A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.","comment":"Depending on the context of use, the code that was actually selected by the user (prescriber, dispenser, etc.) will have the coding.userSelected set to true. As described in the coding datatype: \"A coding may be marked as a \"userSelected\" if a user selected the particular coded value in a user interface (e.g. the user selects an item in a pick-list). If a user selected coding exists, it is the preferred choice for performing translations etc. Other codes can only be literal translations to alternative code systems, or codes at a lower level of granularity (e.g. a generic code for a vendor-specific primary one).","min":1,"max":"1","base":{"path":"Medication.code","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Prescribable medications","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-medication-codes"},"mapping":[{"identity":"script10.6","map":"coding.code = //element(*,MedicationType)/DrugCoded/ProductCode\r\rcoding.system = //element(*,MedicationType)/DrugCoded/ProductCodeQualifier\r\rcoding.display = //element(*,MedicationType)/DrugDescription"},{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"RXO-1.1-Requested Give Code.code / RXE-2.1-Give Code.code / RXD-2.1-Dispense/Give Code.code / RXG-4.1-Give Code.code /RXA-5.1-Administered Code.code / RXC-2.1 Component Code"},{"identity":"rim","map":".code"},{"identity":"argonaut-dq-dstu2","map":"Medication.code"}]},{"id":"Medication.status","path":"Medication.status","short":"active | inactive | entered-in-error","definition":"A code to indicate if the medication is in active use.","comment":"This status is intended to identify if the medication in a local system is in active use within a drug database or inventory. For example, a pharmacy system may create a new drug file record for a compounded product \"ABC Hospital Special Cream\" with an active status. At some point in the future, it may be determined that the drug record was created with an error and the status is changed to \"entered in error\". This status is not intended to specify if a medication is part of a particular formulary. It is possible that the drug record may be referenced by multiple formularies or catalogues and each of those entries would have a separate status.","min":0,"max":"1","base":{"path":"Medication.status","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element changes the interpretation of all descriptive attributes.","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationStatus"}],"strength":"required","description":"A coded concept defining if the medication is in active use.","valueSet":"http://hl7.org/fhir/ValueSet/medication-status|4.0.1"},"mapping":[{"identity":"rim","map":".statusCode"}]},{"id":"Medication.manufacturer","path":"Medication.manufacturer","short":"Manufacturer of the item","definition":"Describes the details of the manufacturer of the medication product. This is not intended to represent the distributor of a medication product.","min":0,"max":"1","base":{"path":"Medication.manufacturer","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"script10.6","map":"no mapping"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"RXD-20-Substance Manufacturer Name / RXG-21-Substance Manufacturer Name / RXA-17-Substance Manufacturer Name"},{"identity":"rim","map":".player.scopingRole[typeCode=MANU].scoper"}]},{"id":"Medication.form","path":"Medication.form","short":"powder | tablets | capsule +","definition":"Describes the form of the item. Powder; tablets; capsule.","comment":"When Medication is referenced from MedicationRequest, this is the ordered form. When Medication is referenced within MedicationDispense, this is the dispensed form. When Medication is referenced within MedicationAdministration, this is administered form.","min":0,"max":"1","base":{"path":"Medication.form","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationForm"}],"strength":"example","description":"A coded concept defining the form of a medication.","valueSet":"http://hl7.org/fhir/ValueSet/medication-form-codes"},"mapping":[{"identity":"script10.6","map":"coding.code = //element(*,DrugCodedType)/FormCode\r\rcoding.system = //element(*,DrugCodedType)/FormSourceCode"},{"identity":"v2","map":"RXO-5-Requested Dosage Form / RXE-6-Give Dosage Form / RXD-6-Actual Dosage Form / RXG-8-Give Dosage Form / RXA-8-Administered Dosage Form"},{"identity":"rim","map":".formCode"}]},{"id":"Medication.amount","path":"Medication.amount","short":"Amount of drug in package","definition":"Specific amount of the drug in the packaged product. For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).","min":0,"max":"1","base":{"path":"Medication.amount","min":0,"max":"1"},"type":[{"code":"Ratio"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".quantity"}]},{"id":"Medication.ingredient","path":"Medication.ingredient","short":"Active or inactive ingredient","definition":"Identifies a particular constituent of interest in the product.","comment":"The ingredients need not be a complete list. If an ingredient is not specified, this does not indicate whether an ingredient is present or absent. If an ingredient is specified it does not mean that all ingredients are specified. It is possible to specify both inactive and active ingredients.","min":0,"max":"*","base":{"path":"Medication.ingredient","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".scopesRole[typeCode=INGR]"}]},{"id":"Medication.ingredient.id","path":"Medication.ingredient.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Medication.ingredient.extension","path":"Medication.ingredient.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Medication.ingredient.modifierExtension","path":"Medication.ingredient.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Medication.ingredient.item[x]","path":"Medication.ingredient.item[x]","short":"The actual ingredient or content","definition":"The actual ingredient - either a substance (simple ingredient) or another medication of a medication.","requirements":"The ingredient may reference a substance (for example, amoxicillin) or another medication (for example in the case of a compounded product, Glaxal Base).","min":1,"max":"1","base":{"path":"Medication.ingredient.item[x]","min":1,"max":"1"},"type":[{"code":"CodeableConcept"},{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Substance","http://hl7.org/fhir/StructureDefinition/Medication"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"coding.code = //element(*,MedicationType)/DrugCoded/ProductCode\r\rcoding.system = //element(*,MedicationType)/DrugCoded/ProductCodeQualifier\r\rcoding.display = //element(*,MedicationType)/DrugDescription"},{"identity":"v2","map":"RXC-2-Component Code if medication: RXO-1-Requested Give Code / RXE-2-Give Code / RXD-2-Dispense/Give Code / RXG-4-Give Code / RXA-5-Administered Code"},{"identity":"rim","map":".player"}]},{"id":"Medication.ingredient.isActive","path":"Medication.ingredient.isActive","short":"Active ingredient indicator","definition":"Indication of whether this ingredient affects the therapeutic action of the drug.","requirements":"True indicates that the ingredient affects the therapeutic action of the drug (i.e. active). \rFalse indicates that the ingredient does not affect the therapeutic action of the drug (i.e. inactive).","min":0,"max":"1","base":{"path":"Medication.ingredient.isActive","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"NA"}]},{"id":"Medication.ingredient.strength","path":"Medication.ingredient.strength","short":"Quantity of ingredient present","definition":"Specifies how many (or how much) of the items there are in this Medication. For example, 250 mg per tablet. This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet.","min":0,"max":"1","base":{"path":"Medication.ingredient.strength","min":0,"max":"1"},"type":[{"code":"Ratio"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"//element(*,DrugCodedType)/Strength"},{"identity":"v2","map":"RXC-3-Component Amount & RXC-4-Component Units if medication: RXO-2-Requested Give Amount - Minimum & RXO-4-Requested Give Units / RXO-3-Requested Give Amount - Maximum & RXO-4-Requested Give Units / RXO-11-Requested Dispense Amount & RXO-12-Requested Dispense Units / RXE-3-Give Amount - Minimum & RXE-5-Give Units / RXE-4-Give Amount - Maximum & RXE-5-Give Units / RXE-10-Dispense Amount & RXE-10-Dispense Units"},{"identity":"rim","map":".quantity"}]},{"id":"Medication.batch","path":"Medication.batch","short":"Details about packaged medications","definition":"Information that only applies to packages (not products).","min":0,"max":"1","base":{"path":"Medication.batch","min":0,"max":"1"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"no mapping"},{"identity":"rim","map":".player[classCode=CONT]"}]},{"id":"Medication.batch.id","path":"Medication.batch.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Medication.batch.extension","path":"Medication.batch.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Medication.batch.modifierExtension","path":"Medication.batch.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Medication.batch.lotNumber","path":"Medication.batch.lotNumber","short":"Identifier assigned to batch","definition":"The assigned lot number of a batch of the specified product.","min":0,"max":"1","base":{"path":"Medication.batch.lotNumber","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"no mapping"},{"identity":"v2","map":"RXA-15 Substance Lot Number / RXG-19 Substance Lot Number"},{"identity":"rim","map":".id"}]},{"id":"Medication.batch.expirationDate","path":"Medication.batch.expirationDate","short":"When batch will expire","definition":"When this specific batch of product will expire.","min":0,"max":"1","base":{"path":"Medication.batch.expirationDate","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"no mapping"},{"identity":"v2","map":"RXA-16 Substance Expiration Date / RXG-20 Substance Expiration Date"},{"identity":"rim","map":"participation[typeCode=CSM].role[classCode=INST].scopedRole.scoper[classCode=MMAT].expirationTime"}]}]},"differential":{"element":[{"id":"Medication","path":"Medication","definition":"The US Core Medication Profile is based upon the core FHIR Medication Resource and created to meet the 2015 Edition Common Clinical Data Set 'Medications' requirements.","mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Medication"}]},{"id":"Medication.code","path":"Medication.code","min":1,"max":"1","mustSupport":true,"binding":{"strength":"extensible","description":"Prescribable medications","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-medication-codes"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Medication.code"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-medicationrequest.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-medicationrequest.json new file mode 100755 index 000000000..c91162753 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-medicationrequest.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-medicationrequest","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" MedicationRequest 0..*
    \".\"\".\"\".\" status S1..1codeBinding: medicationrequest Status (required)
    \".\"\".\"\".\" intent S1..1codeBinding: medicationRequest Intent (required)
    \".\"\".\"\".\" reported[x] S0..1
    \".\"\".\"\".\"\".\" reportedBooleanboolean
    \".\"\".\"\".\"\".\" reportedReferenceReference(US Core Patient Profile | US Core Practitioner Profile | PractitionerRole | US Core Organization Profile | RelatedPerson)
    \".\"\".\"\".\" medication[x] S1..1Binding: US Core Medication Codes (RxNorm) (extensible)
    \".\"\".\"\".\"\".\" medicationCodeableConceptCodeableConcept
    \".\"\".\"\".\"\".\" medicationReferenceReference(US Core Medication Profile)
    \".\"\".\"\".\" subject S1..1Reference(US Core Patient Profile)
    \".\"\".\"\".\" encounter S0..1Reference(Encounter)
    \".\"\".\"\".\" authoredOn S1..1dateTime
    \".\"\".\"\".\" requester S1..1Reference(US Core Practitioner Profile | PractitionerRole | US Core Organization Profile | US Core Patient Profile | US Core Implantable Device Profile | RelatedPerson)
    \".\"\".\"\".\" dosageInstruction S0..*Dosage
    \".\"\".\"\".\"\".\" text S0..1string

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest","version":"3.1.0","name":"USCoreMedicationRequestProfile","title":"US Core MedicationRequest Profile","status":"active","experimental":false,"date":"2019-08-19T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the MedicationRequest resource for the minimal set of data to query and retrieve prescription information.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"script10.6","uri":"http://ncpdp.org/SCRIPT10_6","name":"Mapping to NCPDP SCRIPT 10.6"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"}],"kind":"resource","abstract":false,"type":"MedicationRequest","baseDefinition":"http://hl7.org/fhir/StructureDefinition/MedicationRequest","derivation":"constraint","snapshot":{"element":[{"id":"MedicationRequest","path":"MedicationRequest","short":"Ordering of medication for patient or group","definition":"The US Core Medication Request (Order) Profile is based upon the core FHIR MedicationRequest Resource and created to meet the 2015 Edition Common Clinical Data Set 'Medications' requirements.","alias":["Prescription","Order"],"min":0,"max":"*","base":{"path":"MedicationRequest","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Request"},{"identity":"script10.6","map":"Message/Body/NewRx"},{"identity":"rim","map":"CombinedMedicationRequest"},{"identity":"argonaut-dq-dstu2","map":"MedicationOrder"}]},{"id":"MedicationRequest.id","path":"MedicationRequest.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"MedicationRequest.meta","path":"MedicationRequest.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"MedicationRequest.implicitRules","path":"MedicationRequest.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"MedicationRequest.language","path":"MedicationRequest.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"MedicationRequest.text","path":"MedicationRequest.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"MedicationRequest.contained","path":"MedicationRequest.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"MedicationRequest.extension","path":"MedicationRequest.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"MedicationRequest.modifierExtension","path":"MedicationRequest.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"MedicationRequest.identifier","path":"MedicationRequest.identifier","short":"External ids for this request","definition":"Identifiers associated with this medication request that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.","comment":"This is a business identifier, not a resource identifier.","min":0,"max":"*","base":{"path":"MedicationRequest.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.identifier"},{"identity":"script10.6","map":"Message/Header/PrescriberOrderNumber"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"ORC-2-Placer Order Number / ORC-3-Filler Order Number"},{"identity":"rim","map":".id"}]},{"id":"MedicationRequest.status","path":"MedicationRequest.status","short":"active | on-hold | cancelled | completed | entered-in-error | stopped | draft | unknown","definition":"A code specifying the current state of the order. Generally, this will be active or completed state.","comment":"This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.","min":1,"max":"1","base":{"path":"MedicationRequest.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","description":"A code specifying the state of the prescribing event. Describes the lifecycle of the prescription.","valueSet":"http://hl7.org/fhir/ValueSet/medicationrequest-status"},"mapping":[{"identity":"workflow","map":"Request.status"},{"identity":"script10.6","map":"no mapping"},{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":".statusCode"},{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.status"}]},{"id":"MedicationRequest.statusReason","path":"MedicationRequest.statusReason","short":"Reason for current status","definition":"Captures the reason for the current state of the MedicationRequest.","comment":"This is generally only used for \"exception\" statuses such as \"suspended\" or \"cancelled\". The reason why the MedicationRequest was created at all is captured in reasonCode, not here.","min":0,"max":"1","base":{"path":"MedicationRequest.statusReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationRequestStatusReason"}],"strength":"example","description":"Identifies the reasons for a given status.","valueSet":"http://hl7.org/fhir/ValueSet/medicationrequest-status-reason"},"mapping":[{"identity":"workflow","map":"Request.statusReason"},{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ].source[classCode=CACT, moodCode=EVN].reasonCOde"}]},{"id":"MedicationRequest.intent","path":"MedicationRequest.intent","short":"proposal | plan | order | original-order | reflex-order | filler-order | instance-order | option","definition":"Whether the request is a proposal, plan, or an original order.","comment":"It is expected that the type of requester will be restricted for different stages of a MedicationRequest. For example, Proposals can be created by a patient, relatedPerson, Practitioner or Device. Plans can be created by Practitioners, Patients, RelatedPersons and Devices. Original orders can be created by a Practitioner only.\r\rAn instance-order is an instantiation of a request or order and may be used to populate Medication Administration Record.\r\rThis element is labeled as a modifier because the intent alters when and how the resource is actually applicable.","min":1,"max":"1","base":{"path":"MedicationRequest.intent","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element changes the interpretation of all descriptive attributes. For example \"the time the request is recommended to occur\" vs. \"the time the request is authorized to occur\" or \"who is recommended to perform the request\" vs. \"who is authorized to perform the request","isSummary":true,"binding":{"strength":"required","description":"The kind of medication order.","valueSet":"http://hl7.org/fhir/ValueSet/medicationrequest-intent"},"mapping":[{"identity":"workflow","map":"Request.intent"},{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".moodCode (nuances beyond PRP/PLAN/RQO would need to be elsewhere)"},{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.status"}]},{"id":"MedicationRequest.category","path":"MedicationRequest.category","short":"Type of medication usage","definition":"Indicates the type of medication request (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)).","comment":"The category can be used to include where the medication is expected to be consumed or other types of requests.","min":0,"max":"*","base":{"path":"MedicationRequest.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationRequestCategory"}],"strength":"example","description":"A coded concept identifying the category of medication request. For example, where the medication is to be consumed or administered, or the type of medication treatment.","valueSet":"http://hl7.org/fhir/ValueSet/medicationrequest-category"},"mapping":[{"identity":"script10.6","map":"Message/Body/NewRx/MedicationPrescribed/Directions\r\ror \r\rMessage/Body/NewRx/MedicationPrescribed/StructuredSIG"},{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code=\"type of medication usage\"].value"}]},{"id":"MedicationRequest.priority","path":"MedicationRequest.priority","short":"routine | urgent | asap | stat","definition":"Indicates how quickly the Medication Request should be addressed with respect to other requests.","min":0,"max":"1","base":{"path":"MedicationRequest.priority","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationRequestPriority"}],"strength":"required","description":"Identifies the level of importance to be assigned to actioning the request.","valueSet":"http://hl7.org/fhir/ValueSet/request-priority|4.0.1"},"mapping":[{"identity":"workflow","map":"Request.priority"},{"identity":"w5","map":"FiveWs.grade"},{"identity":"rim","map":".priorityCode"}]},{"id":"MedicationRequest.doNotPerform","path":"MedicationRequest.doNotPerform","short":"True if request is prohibiting action","definition":"If true indicates that the provider is asking for the medication request not to occur.","comment":"If do not perform is not specified, the request is a positive request e.g. \"do perform\".","min":0,"max":"1","base":{"path":"MedicationRequest.doNotPerform","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because this element negates the request to occur (ie, this is a request for the medication not to be ordered or prescribed, etc)","isSummary":true,"mapping":[{"identity":"rim","map":"SubstanceAdministration.actionNegationInd"}]},{"id":"MedicationRequest.reported[x]","path":"MedicationRequest.reported[x]","short":"Reported rather than primary record","definition":"Indicates if this record was captured as a secondary 'reported' record rather than as an original primary source-of-truth record. It may also indicate the source of the report.","min":0,"max":"1","base":{"path":"MedicationRequest.reported[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".participation[typeCode=INF].role"},{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.status"}]},{"id":"MedicationRequest.medication[x]","path":"MedicationRequest.medication[x]","short":"Medication to be taken","definition":"Identifies the medication being requested. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.","comment":"If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the Medication resource is recommended. For example, if you require form or lot number or if the medication is compounded or extemporaneously prepared, then you must reference the Medication resource.","min":1,"max":"1","base":{"path":"MedicationRequest.medication[x]","min":1,"max":"1"},"type":[{"code":"CodeableConcept"},{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Prescribable medications","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-medication-codes"},"mapping":[{"identity":"workflow","map":"Request.code"},{"identity":"script10.6","map":"Message/Body/NewRx/MedicationPrescribed\r\rMedication.code.coding.code = Message/Body/NewRx/MedicationPrescribed/DrugCoded/ProductCode\r\rMedication.code.coding.system = Message/Body/NewRx/MedicationPrescribed/DrugCoded/ProductCodeQualifier\r\rMedication.code.coding.display = Message/Body/NewRx/MedicationPrescribed/DrugDescription"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"v2","map":"RXE-2-Give Code / RXO-1-Requested Give Code / RXC-2-Component Code"},{"identity":"rim","map":"consumable.administrableMedication"},{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.medication[x]"}]},{"id":"MedicationRequest.subject","path":"MedicationRequest.subject","short":"Who or group medication request is for","definition":"A link to a resource representing the person or set of individuals to whom the medication will be given.","comment":"The subject on a medication request is mandatory. For the secondary use case where the actual subject is not provided, there still must be an anonymized subject specified.","min":1,"max":"1","base":{"path":"MedicationRequest.subject","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.subject"},{"identity":"script10.6","map":"Message/Body/NewRx/Patient\r\r(need detail to link to specific patient … Patient.Identification in SCRIPT)"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3-Patient ID List"},{"identity":"rim","map":".participation[typeCode=AUT].role"},{"identity":"w5","map":"FiveWs.subject"},{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.patient"}]},{"id":"MedicationRequest.encounter","path":"MedicationRequest.encounter","short":"Encounter created as part of encounter/admission/stay","definition":"The Encounter during which this [x] was created or to which the creation of this record is tightly associated.","comment":"This will typically be the encounter the event occurred within, but some activities may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter.\" If there is a need to link to episodes of care they will be handled with an extension.","min":0,"max":"1","base":{"path":"MedicationRequest.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.context"},{"identity":"script10.6","map":"no mapping"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1-19-Visit Number"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code=\"type of encounter or episode\"]"},{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.patient"}]},{"id":"MedicationRequest.supportingInformation","path":"MedicationRequest.supportingInformation","short":"Information to support ordering of the medication","definition":"Include additional information (for example, patient height and weight) that supports the ordering of the medication.","min":0,"max":"*","base":{"path":"MedicationRequest.supportingInformation","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.supportingInfo"},{"identity":"w5","map":"FiveWs.context"},{"identity":"rim","map":".outboundRelationship[typeCode=PERT].target[A_SupportingClinicalStatement CMET minimal with many different choices of classCodes(ORG, ENC, PROC, SPLY, SBADM, OBS) and each of the act class codes draws from one or more of the following moodCodes (EVN, DEF, INT PRMS, RQO, PRP, APT, ARQ, GOL)]"}]},{"id":"MedicationRequest.authoredOn","path":"MedicationRequest.authoredOn","short":"When request was initially authored","definition":"The date (and perhaps time) when the prescription was initially written or authored on.","min":1,"max":"1","base":{"path":"MedicationRequest.authoredOn","min":0,"max":"1"},"type":[{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.authoredOn"},{"identity":"script10.6","map":"Message/Body/NewRx/MedicationPrescribed/WrittenDate"},{"identity":"w5","map":"FiveWs.recorded"},{"identity":"v2","map":"RXE-32-Original Order Date/Time / ORC-9-Date/Time of Transaction"},{"identity":"rim","map":"author.time"},{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.dateWritten"}]},{"id":"MedicationRequest.requester","path":"MedicationRequest.requester","short":"Who/What requested the Request","definition":"The individual, organization, or device that initiated the request and has responsibility for its activation.","min":1,"max":"1","base":{"path":"MedicationRequest.requester","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization","http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.requester"},{"identity":"w5","map":"FiveWs.author"},{"identity":"rim","map":".participation[typeCode=AUT].role"},{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.prescriber"}]},{"id":"MedicationRequest.performer","path":"MedicationRequest.performer","short":"Intended performer of administration","definition":"The specified desired performer of the medication treatment (e.g. the performer of the medication administration).","min":0,"max":"1","base":{"path":"MedicationRequest.performer","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/CareTeam"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.performer"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"rim","map":".participation[typeCode=PRF].role[scoper.determinerCode=INSTANCE]"}]},{"id":"MedicationRequest.performerType","path":"MedicationRequest.performerType","short":"Desired kind of performer of the medication administration","definition":"Indicates the type of performer of the administration of the medication.","comment":"If specified without indicating a performer, this indicates that the performer must be of the specified type. If specified with a performer then it indicates the requirements of the performer if the designated performer is not available.","min":0,"max":"1","base":{"path":"MedicationRequest.performerType","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationRequestPerformerType"}],"strength":"example","description":"Identifies the type of individual that is desired to administer the medication.","valueSet":"http://hl7.org/fhir/ValueSet/performer-role"},"mapping":[{"identity":"workflow","map":"Request.performerType"},{"identity":"rim","map":".participation[typeCode=PRF].role[scoper.determinerCode=KIND].code"}]},{"id":"MedicationRequest.recorder","path":"MedicationRequest.recorder","short":"Person who entered the request","definition":"The person who entered the order on behalf of another individual for example in the case of a verbal or a telephone order.","min":0,"max":"1","base":{"path":"MedicationRequest.recorder","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.who"},{"identity":"rim","map":".participation[typeCode=TRANS].role[classCode=ASSIGNED].code (HealthcareProviderType)"}]},{"id":"MedicationRequest.reasonCode","path":"MedicationRequest.reasonCode","short":"Reason or indication for ordering or not ordering the medication","definition":"The reason or the indication for ordering or not ordering the medication.","comment":"This could be a diagnosis code. If a full condition record exists or additional detail is needed, use reasonReference.","min":0,"max":"*","base":{"path":"MedicationRequest.reasonCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationRequestReason"}],"strength":"example","description":"A coded concept indicating why the medication was ordered.","valueSet":"http://hl7.org/fhir/ValueSet/condition-code"},"mapping":[{"identity":"workflow","map":"Request.reasonCode"},{"identity":"script10.6","map":"Message/Body/NewRx/MedicationPrescribed/Diagnosis/Primary/Value"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"v2","map":"ORC-16-Order Control Code Reason /RXE-27-Give Indication/RXO-20-Indication / RXD-21-Indication / RXG-22-Indication / RXA-19-Indication"},{"identity":"rim","map":"reason.observation.reasonCode"}]},{"id":"MedicationRequest.reasonReference","path":"MedicationRequest.reasonReference","short":"Condition or observation that supports why the prescription is being written","definition":"Condition or observation that supports why the medication was ordered.","comment":"This is a reference to a condition or observation that is the reason for the medication order. If only a code exists, use reasonCode.","min":0,"max":"*","base":{"path":"MedicationRequest.reasonReference","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Condition","http://hl7.org/fhir/StructureDefinition/Observation"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.reasonReference"},{"identity":"script10.6","map":"no mapping"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"rim","map":"reason.observation[code=ASSERTION].value"}]},{"id":"MedicationRequest.instantiatesCanonical","path":"MedicationRequest.instantiatesCanonical","short":"Instantiates FHIR protocol or definition","definition":"The URL pointing to a protocol, guideline, orderset, or other definition that is adhered to in whole or in part by this MedicationRequest.","min":0,"max":"*","base":{"path":"MedicationRequest.instantiatesCanonical","min":0,"max":"*"},"type":[{"code":"canonical"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.instantiates"},{"identity":"rim","map":".outboundRelationship[typeCode=DEFN].target"}]},{"id":"MedicationRequest.instantiatesUri","path":"MedicationRequest.instantiatesUri","short":"Instantiates external protocol or definition","definition":"The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this MedicationRequest.","min":0,"max":"*","base":{"path":"MedicationRequest.instantiatesUri","min":0,"max":"*"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode=DEFN].target"}]},{"id":"MedicationRequest.basedOn","path":"MedicationRequest.basedOn","short":"What request fulfills","definition":"A plan or request that is fulfilled in whole or in part by this medication request.","min":0,"max":"*","base":{"path":"MedicationRequest.basedOn","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan","http://hl7.org/fhir/StructureDefinition/MedicationRequest","http://hl7.org/fhir/StructureDefinition/ServiceRequest","http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.basedOn"},{"identity":"rim","map":".outboundRelationship[typeCode=FLFS].target[classCode=SBADM or PROC or PCPR or OBS, moodCode=RQO orPLAN or PRP]"}]},{"id":"MedicationRequest.groupIdentifier","path":"MedicationRequest.groupIdentifier","short":"Composite request this is part of","definition":"A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition or prescription.","requirements":"Requests are linked either by a \"basedOn\" relationship (i.e. one request is fulfilling another) or by having a common requisition. Requests that are part of the same requisition are generally treated independently from the perspective of changing their state or maintaining them after initial creation.","min":0,"max":"1","base":{"path":"MedicationRequest.groupIdentifier","min":0,"max":"1"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Request.groupIdentifier"},{"identity":"rim","map":".outboundRelationship(typeCode=COMP].target[classCode=SBADM, moodCode=INT].id"}]},{"id":"MedicationRequest.courseOfTherapyType","path":"MedicationRequest.courseOfTherapyType","short":"Overall pattern of medication administration","definition":"The description of the overall patte3rn of the administration of the medication to the patient.","comment":"This attribute should not be confused with the protocol of the medication.","min":0,"max":"1","base":{"path":"MedicationRequest.courseOfTherapyType","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationRequestCourseOfTherapy"}],"strength":"example","description":"Identifies the overall pattern of medication administratio.","valueSet":"http://hl7.org/fhir/ValueSet/medicationrequest-course-of-therapy"},"mapping":[{"identity":"rim","map":"Act.code where classCode = LIST and moodCode = EVN"}]},{"id":"MedicationRequest.insurance","path":"MedicationRequest.insurance","short":"Associated insurance coverage","definition":"Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.","min":0,"max":"*","base":{"path":"MedicationRequest.insurance","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Coverage","http://hl7.org/fhir/StructureDefinition/ClaimResponse"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.insurance"},{"identity":"rim","map":".outboundRelationship[typeCode=COVBY].target"}]},{"id":"MedicationRequest.note","path":"MedicationRequest.note","short":"Information about the prescription","definition":"Extra information about the prescription that could not be conveyed by the other attributes.","min":0,"max":"*","base":{"path":"MedicationRequest.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.note"},{"identity":"script10.6","map":"Message/Body/NewRx/MedicationPrescribed/Note"},{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ]/source[classCode=OBS,moodCode=EVN,code=\"annotation\"].value"}]},{"id":"MedicationRequest.dosageInstruction","path":"MedicationRequest.dosageInstruction","short":"How the medication should be taken","definition":"Indicates how the medication is to be used by the patient.","comment":"There are examples where a medication request may include the option of an oral dose or an Intravenous or Intramuscular dose. For example, \"Ondansetron 8mg orally or IV twice a day as needed for nausea\" or \"Compazine® (prochlorperazine) 5-10mg PO or 25mg PR bid prn nausea or vomiting\". In these cases, two medication requests would be created that could be grouped together. The decision on which dose and route of administration to use is based on the patient's condition at the time the dose is needed.","min":0,"max":"*","base":{"path":"MedicationRequest.dosageInstruction","min":0,"max":"*"},"type":[{"code":"Dosage"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.occurrence[x]"},{"identity":"rim","map":"see dosageInstruction mapping"}]},{"id":"MedicationRequest.dosageInstruction.id","path":"MedicationRequest.dosageInstruction.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"MedicationRequest.dosageInstruction.extension","path":"MedicationRequest.dosageInstruction.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"MedicationRequest.dosageInstruction.modifierExtension","path":"MedicationRequest.dosageInstruction.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"MedicationRequest.dosageInstruction.sequence","path":"MedicationRequest.dosageInstruction.sequence","short":"The order of the dosage instructions","definition":"Indicates the order in which the dosage instructions should be applied or interpreted.","requirements":"If the sequence number of multiple Dosages is the same, then it is implied that the instructions are to be treated as concurrent. If the sequence number is different, then the Dosages are intended to be sequential.","min":0,"max":"1","base":{"path":"Dosage.sequence","min":0,"max":"1"},"type":[{"code":"integer"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"TQ1-1"},{"identity":"rim","map":".text"}]},{"id":"MedicationRequest.dosageInstruction.text","path":"MedicationRequest.dosageInstruction.text","short":"Free text dosage instructions e.g. SIG","definition":"Free text dosage instructions e.g. SIG.","requirements":"Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing. Additional information about administration or preparation of the medication should be included as text.","min":0,"max":"1","base":{"path":"Dosage.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"RXO-6; RXE-21"},{"identity":"rim","map":".text"}]},{"id":"MedicationRequest.dosageInstruction.additionalInstruction","path":"MedicationRequest.dosageInstruction.additionalInstruction","short":"Supplemental instruction or warnings to the patient - e.g. \"with meals\", \"may cause drowsiness\"","definition":"Supplemental instructions to the patient on how to take the medication (e.g. \"with meals\" or\"take half to one hour before food\") or warnings for the patient about the medication (e.g. \"may cause drowsiness\" or \"avoid exposure of skin to direct sunlight or sunlamps\").","comment":"Information about administration or preparation of the medication (e.g. \"infuse as rapidly as possibly via intraperitoneal port\" or \"immediately following drug x\") should be populated in dosage.text.","requirements":"Additional instruction is intended to be coded, but where no code exists, the element could include text. For example, \"Swallow with plenty of water\" which might or might not be coded.","min":0,"max":"*","base":{"path":"Dosage.additionalInstruction","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdditionalInstruction"}],"strength":"example","description":"A coded concept identifying additional instructions such as \"take with water\" or \"avoid operating heavy machinery\".","valueSet":"http://hl7.org/fhir/ValueSet/additional-instruction-codes"},"mapping":[{"identity":"v2","map":"RXO-7"},{"identity":"rim","map":".text"}]},{"id":"MedicationRequest.dosageInstruction.patientInstruction","path":"MedicationRequest.dosageInstruction.patientInstruction","short":"Patient or consumer oriented instructions","definition":"Instructions in terms that are understood by the patient or consumer.","min":0,"max":"1","base":{"path":"Dosage.patientInstruction","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"RXO-7"},{"identity":"rim","map":".text"}]},{"id":"MedicationRequest.dosageInstruction.timing","path":"MedicationRequest.dosageInstruction.timing","short":"When medication should be administered","definition":"When medication should be administered.","comment":"This attribute might not always be populated while the Dosage.text is expected to be populated. If both are populated, then the Dosage.text should reflect the content of the Dosage.timing.","requirements":"The timing schedule for giving the medication to the patient. This data type allows many different expressions. For example: \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\". Sometimes, a rate can imply duration when expressed as total volume / duration (e.g. 500mL/2 hours implies a duration of 2 hours). However, when rate doesn't imply duration (e.g. 250mL/hour), then the timing.repeat.duration is needed to convey the infuse over time period.","min":0,"max":"1","base":{"path":"Dosage.timing","min":0,"max":"1"},"type":[{"code":"Timing"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"MedicationRequest.dosageInstruction.asNeeded[x]","path":"MedicationRequest.dosageInstruction.asNeeded[x]","short":"Take \"as needed\" (for x)","definition":"Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).","comment":"Can express \"as needed\" without a reason by setting the Boolean = True. In this case the CodeableConcept is not populated. Or you can express \"as needed\" with a reason by including the CodeableConcept. In this case the Boolean is assumed to be True. If you set the Boolean to False, then the dose is given according to the schedule and is not \"prn\" or \"as needed\".","min":0,"max":"1","base":{"path":"Dosage.asNeeded[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationAsNeededReason"}],"strength":"example","description":"A coded concept identifying the precondition that should be met or evaluated prior to consuming or administering a medication dose. For example \"pain\", \"30 minutes prior to sexual intercourse\", \"on flare-up\" etc.","valueSet":"http://hl7.org/fhir/ValueSet/medication-as-needed-reason"},"mapping":[{"identity":"v2","map":"TQ1-9"},{"identity":"rim","map":".outboundRelationship[typeCode=PRCN].target[classCode=OBS, moodCode=EVN, code=\"as needed\"].value=boolean or codable concept"}]},{"id":"MedicationRequest.dosageInstruction.site","path":"MedicationRequest.dosageInstruction.site","short":"Body site to administer to","definition":"Body site to administer to.","comment":"If the use case requires attributes from the BodySite resource (e.g. to identify and track separately) then use the standard extension [bodySite](http://hl7.org/fhir/R4/extension-bodysite.html). May be a summary code, or a reference to a very precise definition of the location, or both.","requirements":"A coded specification of the anatomic site where the medication first enters the body.","min":0,"max":"1","base":{"path":"Dosage.site","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationAdministrationSite"}],"strength":"example","description":"A coded concept describing the site location the medicine enters into or onto the body.","valueSet":"http://hl7.org/fhir/ValueSet/approach-site-codes"},"mapping":[{"identity":"v2","map":"RXR-2"},{"identity":"rim","map":".approachSiteCode"}]},{"id":"MedicationRequest.dosageInstruction.route","path":"MedicationRequest.dosageInstruction.route","short":"How drug should enter body","definition":"How drug should enter body.","requirements":"A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body.","min":0,"max":"1","base":{"path":"Dosage.route","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"RouteOfAdministration"}],"strength":"example","description":"A coded concept describing the route or physiological path of administration of a therapeutic agent into or onto the body of a subject.","valueSet":"http://hl7.org/fhir/ValueSet/route-codes"},"mapping":[{"identity":"v2","map":"RXR-1"},{"identity":"rim","map":".routeCode"}]},{"id":"MedicationRequest.dosageInstruction.method","path":"MedicationRequest.dosageInstruction.method","short":"Technique for administering medication","definition":"Technique for administering medication.","comment":"Terminologies used often pre-coordinate this term with the route and or form of administration.","requirements":"A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV.","min":0,"max":"1","base":{"path":"Dosage.method","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationAdministrationMethod"}],"strength":"example","description":"A coded concept describing the technique by which the medicine is administered.","valueSet":"http://hl7.org/fhir/ValueSet/administration-method-codes"},"mapping":[{"identity":"v2","map":"RXR-4"},{"identity":"rim","map":".doseQuantity"}]},{"id":"MedicationRequest.dosageInstruction.doseAndRate","path":"MedicationRequest.dosageInstruction.doseAndRate","short":"Amount of medication administered","definition":"The amount of medication administered.","min":0,"max":"*","base":{"path":"Dosage.doseAndRate","min":0,"max":"*"},"type":[{"code":"Element"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"TQ1-2"}]},{"id":"MedicationRequest.dosageInstruction.doseAndRate.id","path":"MedicationRequest.dosageInstruction.doseAndRate.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"MedicationRequest.dosageInstruction.doseAndRate.extension","path":"MedicationRequest.dosageInstruction.doseAndRate.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"MedicationRequest.dosageInstruction.doseAndRate.type","path":"MedicationRequest.dosageInstruction.doseAndRate.type","short":"The kind of dose or rate specified","definition":"The kind of dose or rate specified, for example, ordered or calculated.","requirements":"If the type is not populated, assume to be \"ordered\".","min":0,"max":"1","base":{"path":"Dosage.doseAndRate.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DoseAndRateType"}],"strength":"example","description":"The kind of dose or rate specified.","valueSet":"http://hl7.org/fhir/ValueSet/dose-rate-type"},"mapping":[{"identity":"v2","map":"RXO-21; RXE-23"}]},{"id":"MedicationRequest.dosageInstruction.doseAndRate.dose[x]","path":"MedicationRequest.dosageInstruction.doseAndRate.dose[x]","short":"Amount of medication per dose","definition":"Amount of medication per dose.","comment":"Note that this specifies the quantity of the specified medication, not the quantity for each active ingredient(s). Each ingredient amount can be communicated in the Medication resource. For example, if one wants to communicate that a tablet was 375 mg, where the dose was one tablet, you can use the Medication resource to document that the tablet was comprised of 375 mg of drug XYZ. Alternatively if the dose was 375 mg, then you may only need to use the Medication resource to indicate this was a tablet. If the example were an IV such as dopamine and you wanted to communicate that 400mg of dopamine was mixed in 500 ml of some IV solution, then this would all be communicated in the Medication resource. If the administration is not intended to be instantaneous (rate is present or timing has a duration), this can be specified to convey the total amount to be administered over the period of time as indicated by the schedule e.g. 500 ml in dose, with timing used to convey that this should be done over 4 hours.","requirements":"The amount of therapeutic or other substance given at one administration event.","min":0,"max":"1","base":{"path":"Dosage.doseAndRate.dose[x]","min":0,"max":"1"},"type":[{"code":"Range"},{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"RXO-2, RXE-3"},{"identity":"rim","map":".doseQuantity"}]},{"id":"MedicationRequest.dosageInstruction.doseAndRate.rate[x]","path":"MedicationRequest.dosageInstruction.doseAndRate.rate[x]","short":"Amount of medication per unit of time","definition":"Amount of medication per unit of time.","comment":"It is possible to supply both a rate and a doseQuantity to provide full details about how the medication is to be administered and supplied. If the rate is intended to change over time, depending on local rules/regulations, each change should be captured as a new version of the MedicationRequest with an updated rate, or captured with a new MedicationRequest with the new rate.\r\rIt is possible to specify a rate over time (for example, 100 ml/hour) using either the rateRatio and rateQuantity. The rateQuantity approach requires systems to have the capability to parse UCUM grammer where ml/hour is included rather than a specific ratio where the time is specified as the denominator. Where a rate such as 500ml over 2 hours is specified, the use of rateRatio may be more semantically correct than specifying using a rateQuantity of 250 mg/hour.","requirements":"Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. Sometimes, a rate can imply duration when expressed as total volume / duration (e.g. 500mL/2 hours implies a duration of 2 hours). However, when rate doesn't imply duration (e.g. 250mL/hour), then the timing.repeat.duration is needed to convey the infuse over time period.","min":0,"max":"1","base":{"path":"Dosage.doseAndRate.rate[x]","min":0,"max":"1"},"type":[{"code":"Ratio"},{"code":"Range"},{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"RXE22, RXE23, RXE-24"},{"identity":"rim","map":".rateQuantity"}]},{"id":"MedicationRequest.dosageInstruction.maxDosePerPeriod","path":"MedicationRequest.dosageInstruction.maxDosePerPeriod","short":"Upper limit on medication per unit of time","definition":"Upper limit on medication per unit of time.","comment":"This is intended for use as an adjunct to the dosage when there is an upper cap. For example \"2 tablets every 4 hours to a maximum of 8/day\".","requirements":"The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.","min":0,"max":"1","base":{"path":"Dosage.maxDosePerPeriod","min":0,"max":"1"},"type":[{"code":"Ratio"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"RXO-23, RXE-19"},{"identity":"rim","map":".maxDoseQuantity"}]},{"id":"MedicationRequest.dosageInstruction.maxDosePerAdministration","path":"MedicationRequest.dosageInstruction.maxDosePerAdministration","short":"Upper limit on medication per administration","definition":"Upper limit on medication per administration.","comment":"This is intended for use as an adjunct to the dosage when there is an upper cap. For example, a body surface area related dose with a maximum amount, such as 1.5 mg/m2 (maximum 2 mg) IV over 5 – 10 minutes would have doseQuantity of 1.5 mg/m2 and maxDosePerAdministration of 2 mg.","requirements":"The maximum total quantity of a therapeutic substance that may be administered to a subject per administration.","min":0,"max":"1","base":{"path":"Dosage.maxDosePerAdministration","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"not supported"}]},{"id":"MedicationRequest.dosageInstruction.maxDosePerLifetime","path":"MedicationRequest.dosageInstruction.maxDosePerLifetime","short":"Upper limit on medication per lifetime of the patient","definition":"Upper limit on medication per lifetime of the patient.","requirements":"The maximum total quantity of a therapeutic substance that may be administered per lifetime of the subject.","min":0,"max":"1","base":{"path":"Dosage.maxDosePerLifetime","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"not supported"}]},{"id":"MedicationRequest.dispenseRequest","path":"MedicationRequest.dispenseRequest","short":"Medication supply authorization","definition":"Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order). Note that this information is not always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.","min":0,"max":"1","base":{"path":"MedicationRequest.dispenseRequest","min":0,"max":"1"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"Message/Body/NewRx/MedicationPrescribed/ExpirationDate"},{"identity":"rim","map":"component.supplyEvent"}]},{"id":"MedicationRequest.dispenseRequest.id","path":"MedicationRequest.dispenseRequest.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"MedicationRequest.dispenseRequest.extension","path":"MedicationRequest.dispenseRequest.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"MedicationRequest.dispenseRequest.modifierExtension","path":"MedicationRequest.dispenseRequest.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"MedicationRequest.dispenseRequest.initialFill","path":"MedicationRequest.dispenseRequest.initialFill","short":"First fill details","definition":"Indicates the quantity or duration for the first dispense of the medication.","comment":"If populating this element, either the quantity or the duration must be included.","min":0,"max":"1","base":{"path":"MedicationRequest.dispenseRequest.initialFill","min":0,"max":"1"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"SubstanceAdministration -> ActRelationship[sequenceNumber = '1'] -> Supply"}]},{"id":"MedicationRequest.dispenseRequest.initialFill.id","path":"MedicationRequest.dispenseRequest.initialFill.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"MedicationRequest.dispenseRequest.initialFill.extension","path":"MedicationRequest.dispenseRequest.initialFill.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"MedicationRequest.dispenseRequest.initialFill.modifierExtension","path":"MedicationRequest.dispenseRequest.initialFill.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"MedicationRequest.dispenseRequest.initialFill.quantity","path":"MedicationRequest.dispenseRequest.initialFill.quantity","short":"First fill quantity","definition":"The amount or quantity to provide as part of the first dispense.","min":0,"max":"1","base":{"path":"MedicationRequest.dispenseRequest.initialFill.quantity","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Supply.quantity[moodCode=RQO]"}]},{"id":"MedicationRequest.dispenseRequest.initialFill.duration","path":"MedicationRequest.dispenseRequest.initialFill.duration","short":"First fill duration","definition":"The length of time that the first dispense is expected to last.","min":0,"max":"1","base":{"path":"MedicationRequest.dispenseRequest.initialFill.duration","min":0,"max":"1"},"type":[{"code":"Duration"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Supply.effectivetime[moodCode=RQO]"}]},{"id":"MedicationRequest.dispenseRequest.dispenseInterval","path":"MedicationRequest.dispenseRequest.dispenseInterval","short":"Minimum period of time between dispenses","definition":"The minimum period of time that must occur between dispenses of the medication.","min":0,"max":"1","base":{"path":"MedicationRequest.dispenseRequest.dispenseInterval","min":0,"max":"1"},"type":[{"code":"Duration"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Supply.effectivetime[moodCode=RQO]"}]},{"id":"MedicationRequest.dispenseRequest.validityPeriod","path":"MedicationRequest.dispenseRequest.validityPeriod","short":"Time period supply is authorized for","definition":"This indicates the validity period of a prescription (stale dating the Prescription).","comment":"It reflects the prescribers' perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations.","requirements":"Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.","min":0,"max":"1","base":{"path":"MedicationRequest.dispenseRequest.validityPeriod","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"Message/Body/NewRx/MedicationPrescribed/Refills"},{"identity":"rim","map":"effectiveTime"}]},{"id":"MedicationRequest.dispenseRequest.numberOfRepeatsAllowed","path":"MedicationRequest.dispenseRequest.numberOfRepeatsAllowed","short":"Number of refills authorized","definition":"An integer indicating the number of times, in addition to the original dispense, (aka refills or repeats) that the patient can receive the prescribed medication. Usage Notes: This integer does not include the original order dispense. This means that if an order indicates dispense 30 tablets plus \"3 repeats\", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets. A prescriber may explicitly say that zero refills are permitted after the initial dispense.","comment":"If displaying \"number of authorized fills\", add 1 to this number.","min":0,"max":"1","base":{"path":"MedicationRequest.dispenseRequest.numberOfRepeatsAllowed","min":0,"max":"1"},"type":[{"code":"unsignedInt"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"Message/Body/NewRx/MedicationPrescribed/Quantity"},{"identity":"v2","map":"RXE-12-Number of Refills"},{"identity":"rim","map":"repeatNumber"}]},{"id":"MedicationRequest.dispenseRequest.quantity","path":"MedicationRequest.dispenseRequest.quantity","short":"Amount of medication to supply per dispense","definition":"The amount that is to be dispensed for one fill.","min":0,"max":"1","base":{"path":"MedicationRequest.dispenseRequest.quantity","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"Message/Body/NewRx/MedicationPrescribed/DaysSupply"},{"identity":"v2","map":"RXD-4-Actual Dispense Amount / RXD-5.1-Actual Dispense Units.code / RXD-5.3-Actual Dispense Units.name of coding system"},{"identity":"rim","map":"quantity"}]},{"id":"MedicationRequest.dispenseRequest.expectedSupplyDuration","path":"MedicationRequest.dispenseRequest.expectedSupplyDuration","short":"Number of days supply per dispense","definition":"Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last.","comment":"In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage). When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.","min":0,"max":"1","base":{"path":"MedicationRequest.dispenseRequest.expectedSupplyDuration","min":0,"max":"1"},"type":[{"code":"Duration"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"Message/Body/NewRx/MedicationPrescribed/Substitutions"},{"identity":"rim","map":"expectedUseTime"}]},{"id":"MedicationRequest.dispenseRequest.performer","path":"MedicationRequest.dispenseRequest.performer","short":"Intended dispenser","definition":"Indicates the intended dispensing Organization specified by the prescriber.","min":0,"max":"1","base":{"path":"MedicationRequest.dispenseRequest.performer","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"w5","map":"FiveWs.who"},{"identity":"rim","map":".outboundRelationship[typeCode=COMP].target[classCode=SPLY, moodCode=RQO] .participation[typeCode=PRF].role[scoper.determinerCode=INSTANCE]"}]},{"id":"MedicationRequest.substitution","path":"MedicationRequest.substitution","short":"Any restrictions on medication substitution","definition":"Indicates whether or not substitution can or should be part of the dispense. In some cases, substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done.","min":0,"max":"1","base":{"path":"MedicationRequest.substitution","min":0,"max":"1"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"script10.6","map":"specific values within Message/Body/NewRx/MedicationPrescribed/Substitutions"},{"identity":"rim","map":"subjectOf.substitutionPersmission"}]},{"id":"MedicationRequest.substitution.id","path":"MedicationRequest.substitution.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"MedicationRequest.substitution.extension","path":"MedicationRequest.substitution.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"MedicationRequest.substitution.modifierExtension","path":"MedicationRequest.substitution.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"MedicationRequest.substitution.allowed[x]","path":"MedicationRequest.substitution.allowed[x]","short":"Whether substitution is allowed or not","definition":"True if the prescriber allows a different drug to be dispensed from what was prescribed.","comment":"This element is labeled as a modifier because whether substitution is allow or not, it cannot be ignored.","min":1,"max":"1","base":{"path":"MedicationRequest.substitution.allowed[x]","min":1,"max":"1"},"type":[{"code":"boolean"},{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationRequestSubstitution"}],"strength":"example","description":"Identifies the type of substitution allowed.","valueSet":"http://terminology.hl7.org/ValueSet/v3-ActSubstanceAdminSubstitutionCode"},"mapping":[{"identity":"script10.6","map":"specific values within Message/Body/NewRx/MedicationPrescribed/Substitutions"},{"identity":"v2","map":"RXO-9-Allow Substitutions / RXE-9-Substitution Status"},{"identity":"rim","map":"code"}]},{"id":"MedicationRequest.substitution.reason","path":"MedicationRequest.substitution.reason","short":"Why should (not) substitution be made","definition":"Indicates the reason for the substitution, or why substitution must or must not be performed.","min":0,"max":"1","base":{"path":"MedicationRequest.substitution.reason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MedicationIntendedSubstitutionReason"}],"strength":"example","description":"A coded concept describing the reason that a different medication should (or should not) be substituted from what was prescribed.","valueSet":"http://terminology.hl7.org/ValueSet/v3-SubstanceAdminSubstitutionReason"},"mapping":[{"identity":"script10.6","map":"not mapped"},{"identity":"v2","map":"RXE-9 Substition status"},{"identity":"rim","map":"reasonCode"}]},{"id":"MedicationRequest.priorPrescription","path":"MedicationRequest.priorPrescription","short":"An order/prescription that is being replaced","definition":"A link to a resource representing an earlier order related order or prescription.","min":0,"max":"1","base":{"path":"MedicationRequest.priorPrescription","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/MedicationRequest"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.replaces"},{"identity":"script10.6","map":"not mapped"},{"identity":"rim","map":".outboundRelationship[typeCode=?RPLC or ?SUCC]/target[classCode=SBADM,moodCode=RQO]"}]},{"id":"MedicationRequest.detectedIssue","path":"MedicationRequest.detectedIssue","short":"Clinical Issue with action","definition":"Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, duplicate therapy, dosage alert etc.","comment":"This element can include a detected issue that has been identified either by a decision support system or by a clinician and may include information on the steps that were taken to address the issue.","alias":["Contraindication","Drug Utilization Review (DUR)","Alert"],"min":0,"max":"*","base":{"path":"MedicationRequest.detectedIssue","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/DetectedIssue"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ]/source[classCode=ALRT,moodCode=EVN].value"}]},{"id":"MedicationRequest.eventHistory","path":"MedicationRequest.eventHistory","short":"A list of events of interest in the lifecycle","definition":"Links to Provenance records for past versions of this resource or fulfilling request or event resources that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource.","comment":"This might not include provenances for all versions of the request – only those deemed “relevant” or important. This SHALL NOT include the provenance associated with this current version of the resource. (If that provenance is deemed to be a “relevant” change, it will need to be added as part of a later update. Until then, it can be queried directly as the provenance that points to this version using _revinclude All Provenances should have some historical version of this Request as their subject.).","min":0,"max":"*","base":{"path":"MedicationRequest.eventHistory","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Provenance"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Request.relevantHistory"},{"identity":"rim","map":".inboundRelationship(typeCode=SUBJ].source[classCode=CACT, moodCode=EVN]"}]}]},"differential":{"element":[{"id":"MedicationRequest","path":"MedicationRequest","definition":"The US Core Medication Request (Order) Profile is based upon the core FHIR MedicationRequest Resource and created to meet the 2015 Edition Common Clinical Data Set 'Medications' requirements.","mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"MedicationOrder"}]},{"id":"MedicationRequest.status","path":"MedicationRequest.status","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true,"binding":{"strength":"required","description":"A code specifying the state of the prescribing event. Describes the lifecycle of the prescription.","valueSet":"http://hl7.org/fhir/ValueSet/medicationrequest-status"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.status"}]},{"id":"MedicationRequest.intent","path":"MedicationRequest.intent","min":1,"max":"1","mustSupport":true,"binding":{"strength":"required","description":"The kind of medication order.","valueSet":"http://hl7.org/fhir/ValueSet/medicationrequest-intent"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.status"}]},{"id":"MedicationRequest.reported[x]","path":"MedicationRequest.reported[x]","min":0,"max":"1","type":[{"code":"boolean"},{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.status"}]},{"id":"MedicationRequest.medication[x]","path":"MedicationRequest.medication[x]","min":1,"max":"1","type":[{"code":"CodeableConcept"},{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication"]}],"mustSupport":true,"binding":{"strength":"extensible","description":"Prescribable medications","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-medication-codes"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.medication[x]"}]},{"id":"MedicationRequest.subject","path":"MedicationRequest.subject","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.patient"}]},{"id":"MedicationRequest.encounter","path":"MedicationRequest.encounter","min":0,"max":"1","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.patient"}]},{"id":"MedicationRequest.authoredOn","path":"MedicationRequest.authoredOn","min":1,"max":"1","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.dateWritten"}]},{"id":"MedicationRequest.requester","path":"MedicationRequest.requester","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization","http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"MedicationOrder.prescriber"}]},{"id":"MedicationRequest.dosageInstruction","path":"MedicationRequest.dosageInstruction","mustSupport":true},{"id":"MedicationRequest.dosageInstruction.text","path":"MedicationRequest.dosageInstruction.text","mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-observation-lab.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-observation-lab.json new file mode 100755 index 000000000..282aa7e66 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-observation-lab.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-observation-lab","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Observation I0..*us-core-2: If there is no component or related element then either a value[x] or a data absent reason must be present
    \".\"\".\"\".\" status S1..1codeBinding: ObservationStatus (required)
    \".\"\".\"\".\" category S1..*(Slice Definition)Slice: Unordered, Open by pattern:$this
    \".\"\".\"\".\"\".\" category:Laboratory S1..1CodeableConceptRequired Pattern: At least the following
    \".\"\".\"\".\"\".\"\".\" coding1..*CodingCode defined by a terminology system
    Fixed Value: (complex)
    \".\"\".\"\".\"\".\"\".\"\".\" system1..1uriIdentity of the terminology system
    Fixed Value: http://terminology.hl7.org/CodeSystem/observation-category
    \".\"\".\"\".\"\".\"\".\"\".\" code1..1codeSymbol in syntax defined by the system
    Fixed Value: laboratory
    \".\"\".\"\".\" code S1..1CodeableConceptLaboratory Test Name
    Binding: LOINCCodes (extensible)
    \".\"\".\"\".\" subject S1..1Reference(US Core Patient Profile)
    \".\"\".\"\".\" effective[x] SI0..1us-core-1: Datetime must be at least to day.
    \".\"\".\"\".\"\".\" effectiveDateTimedateTime
    \".\"\".\"\".\"\".\" effectivePeriodPeriod
    \".\"\".\"\".\" value[x] SI0..1Quantity, CodeableConcept, string, boolean, integer, Range, Ratio, SampledData, time, dateTime, PeriodResult Value
    us-core-4: SHOULD use Snomed CT for coded Results
    us-core-3: SHALL use UCUM for coded quantity units.
    \".\"\".\"\".\" dataAbsentReason SI0..1CodeableConceptBinding: DataAbsentReason (extensible)

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab","version":"3.1.0","name":"USCoreLaboratoryResultObservationProfile","title":"US Core Laboratory Result Observation Profile","status":"active","experimental":false,"date":"2019-08-19T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Observation resource for the minimal set of data to query and retrieve laboratory test results","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"sct-concept","uri":"http://snomed.info/conceptdomain","name":"SNOMED CT Concept Domain Binding"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"sct-attr","uri":"http://snomed.org/attributebinding","name":"SNOMED CT Attribute Binding"}],"kind":"resource","abstract":false,"type":"Observation","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Observation","derivation":"constraint","snapshot":{"element":[{"id":"Observation","path":"Observation","short":"Measurements and simple assertions","definition":"This profile is created to meet the 2015 Edition Common Clinical Data Set 'Laboratory test(s) and Laboratory value(s)/result(s)' requirements.","comment":"Used for simple observations such as device measurements, laboratory atomic results, vital signs, height, weight, smoking status, comments, etc. Other resources are used to provide context for observations such as laboratory reports, etc.","alias":["Vital Signs","Measurement","Results","Tests"],"min":0,"max":"*","base":{"path":"Observation","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"obs-6","severity":"error","human":"dataAbsentReason SHALL only be present if Observation.value[x] is not present","expression":"dataAbsentReason.empty() or value.empty()","xpath":"not(exists(f:dataAbsentReason)) or (not(exists(*[starts-with(local-name(.), 'value')])))","source":"http://hl7.org/fhir/StructureDefinition/Observation"},{"key":"obs-7","severity":"error","human":"If Observation.code is the same as an Observation.component.code then the value element associated with the code SHALL NOT be present","expression":"value.empty() or component.code.where(coding.intersect(%resource.code.coding).exists()).empty()","xpath":"not(f:*[starts-with(local-name(.), 'value')] and (for $coding in f:code/f:coding return f:component/f:code/f:coding[f:code/@value=$coding/f:code/@value] [f:system/@value=$coding/f:system/@value]))","source":"http://hl7.org/fhir/StructureDefinition/Observation"},{"key":"us-core-2","severity":"error","human":"If there is no component or related element then either a value[x] or a data absent reason must be present","expression":"(component.empty() and related.empty()) implies (dataAbsentReason or value)","xpath":"exists(f:component) or exists(f:related) or exists(f:*[starts-with(local-name(.), 'value)]) or exists(f:dataAbsentReason)"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"sct-concept","map":"< 363787002 |Observable entity|"},{"identity":"v2","map":"OBX"},{"identity":"rim","map":"Observation[classCode=OBS, moodCode=EVN]"},{"identity":"argonaut-dq-dstu2","map":"Observation"}]},{"id":"Observation.id","path":"Observation.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Observation.meta","path":"Observation.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Observation.implicitRules","path":"Observation.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Observation.language","path":"Observation.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Observation.text","path":"Observation.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Observation.contained","path":"Observation.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.extension","path":"Observation.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.modifierExtension","path":"Observation.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.identifier","path":"Observation.identifier","short":"Business Identifier for observation","definition":"A unique identifier assigned to this observation.","requirements":"Allows observations to be distinguished and referenced.","min":0,"max":"*","base":{"path":"Observation.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"OBX.21 For OBX segments from systems without OBX-21 support a combination of ORC/OBR and OBX must be negotiated between trading partners to uniquely identify the OBX segment. Depending on how V2 has been implemented each of these may be an option: 1) OBR-3 + OBX-3 + OBX-4 or 2) OBR-3 + OBR-4 + OBX-3 + OBX-4 or 2) some other way to uniquely ID the OBR/ORC + OBX-3 + OBX-4."},{"identity":"rim","map":"id"}]},{"id":"Observation.basedOn","path":"Observation.basedOn","short":"Fulfills plan, proposal or order","definition":"A plan, proposal or order that is fulfilled in whole or in part by this event. For example, a MedicationRequest may require a patient to have laboratory test performed before it is dispensed.","requirements":"Allows tracing of authorization for the event and tracking whether proposals/recommendations were acted upon.","alias":["Fulfills"],"min":0,"max":"*","base":{"path":"Observation.basedOn","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan","http://hl7.org/fhir/StructureDefinition/DeviceRequest","http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation","http://hl7.org/fhir/StructureDefinition/MedicationRequest","http://hl7.org/fhir/StructureDefinition/NutritionOrder","http://hl7.org/fhir/StructureDefinition/ServiceRequest"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.basedOn"},{"identity":"v2","map":"ORC"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[moodCode=EVN]"}]},{"id":"Observation.partOf","path":"Observation.partOf","short":"Part of referenced event","definition":"A larger event of which this particular Observation is a component or step. For example, an observation as part of a procedure.","comment":"To link an Observation to an Encounter use `encounter`. See the [Notes](http://hl7.org/fhir/R4/observation.html#obsgrouping) below for guidance on referencing another Observation.","alias":["Container"],"min":0,"max":"*","base":{"path":"Observation.partOf","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/MedicationAdministration","http://hl7.org/fhir/StructureDefinition/MedicationDispense","http://hl7.org/fhir/StructureDefinition/MedicationStatement","http://hl7.org/fhir/StructureDefinition/Procedure","http://hl7.org/fhir/StructureDefinition/Immunization","http://hl7.org/fhir/StructureDefinition/ImagingStudy"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.partOf"},{"identity":"v2","map":"Varies by domain"},{"identity":"rim","map":".outboundRelationship[typeCode=FLFS].target"}]},{"id":"Observation.status","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint","valueString":"default: final"}],"path":"Observation.status","short":"registered | preliminary | final | amended +","definition":"The status of the result value.","comment":"This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.","requirements":"Need to track the status of individual results. Some results are finalized before the whole report is finalized.","min":1,"max":"1","base":{"path":"Observation.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/observation-status"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"sct-concept","map":"< 445584004 |Report by finality status|"},{"identity":"v2","map":"OBX-11"},{"identity":"rim","map":"status Amended & Final are differentiated by whether it is the subject of a ControlAct event with a type of \"revise\""},{"identity":"argonaut-dq-dstu2","map":"Observation.status"}]},{"id":"Observation.category","path":"Observation.category","slicing":{"discriminator":[{"type":"pattern","path":"$this"}],"rules":"open"},"short":"Classification of type of observation","definition":"A code that classifies the general type of observation being made.","comment":"In addition to the required category valueset, this element allows various categorization schemes based on the owner’s definition of the category and effectively multiple categories can be used at once. The level of granularity is defined by the category concepts in the value set.","requirements":"Used for filtering what observations are retrieved and displayed.","min":1,"max":"*","base":{"path":"Observation.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCategory"}],"strength":"preferred","description":"Codes for high level observation categories.","valueSet":"http://hl7.org/fhir/ValueSet/observation-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"},{"identity":"argonaut-dq-dstu2","map":"Observation.category"}]},{"id":"Observation.category:Laboratory","path":"Observation.category","sliceName":"Laboratory","short":"Classification of type of observation","definition":"A code that classifies the general type of observation being made.","comment":"In addition to the required category valueset, this element allows various categorization schemes based on the owner’s definition of the category and effectively multiple categories can be used at once. The level of granularity is defined by the category concepts in the value set.","requirements":"Used for filtering what observations are retrieved and displayed.","min":1,"max":"1","base":{"path":"Observation.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory"}]},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCategory"}],"strength":"preferred","description":"Codes for high level observation categories.","valueSet":"http://hl7.org/fhir/ValueSet/observation-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"},{"identity":"argonaut-dq-dstu2","map":"Observation.category"}]},{"id":"Observation.code","path":"Observation.code","short":"Laboratory Test Name","definition":"The test that was performed. A LOINC **SHALL** be used if the concept is present in LOINC.","comment":"The typical patterns for codes are: 1) a LOINC code either as a translation from a \"local\" code or as a primary code, or 2) a local code only if no suitable LOINC exists, or 3) both the local and the LOINC translation. Systems SHALL be capable of sending the local code if one exists. When using LOINC , Use either the SHORTNAME or LONG_COMMON_NAME field for the display.","requirements":"Knowing what kind of observation is being made is essential to understanding the observation.","alias":["Name","Test Name","Observation Identifer"],"min":1,"max":"1","base":{"path":"Observation.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"LOINC codes","valueSet":"http://hl7.org/fhir/ValueSet/observation-codes"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR < 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"},{"identity":"sct-attr","map":"116680003 |Is a|"},{"identity":"argonaut-dq-dstu2","map":"Observation.code"}]},{"id":"Observation.subject","path":"Observation.subject","short":"Who and/or what the observation is about","definition":"The patient, or group of patients, location, or device this observation is about and into whose record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation.","comment":"One would expect this element to be a cardinality of 1..1. The only circumstance in which the subject can be missing is when the observation is made by a device that does not know the patient. In this case, the observation SHALL be matched to a patient through some context/channel matching technique, and at this point, the observation should be updated.","requirements":"Observations have no value if you don't know who or what they're about.","min":1,"max":"1","base":{"path":"Observation.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":"participation[typeCode=RTGT] "},{"identity":"w5","map":"FiveWs.subject"},{"identity":"argonaut-dq-dstu2","map":"Observation.subject"}]},{"id":"Observation.focus","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"path":"Observation.focus","short":"What the observation is about, when it is not about the subject of record","definition":"The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record. The focus of an observation could also be an existing condition, an intervention, the subject's diet, another observation of the subject, or a body structure such as tumor or implanted device. An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.","comment":"Typically, an observation is made about the subject - a patient, or group of patients, location, or device - and the distinction between the subject and what is directly measured for an observation is specified in the observation code itself ( e.g., \"Blood Glucose\") and does not need to be represented separately using this element. Use `specimen` if a reference to a specimen is required. If a code is required instead of a resource use either `bodysite` for bodysites or the standard extension [focusCode](http://hl7.org/fhir/R4/extension-observation-focuscode.html).","min":0,"max":"*","base":{"path":"Observation.focus","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"participation[typeCode=SBJ]"},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"Observation.encounter","path":"Observation.encounter","short":"Healthcare event during which this observation is made","definition":"The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.","comment":"This will typically be the encounter the event occurred within, but some events may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter (e.g. pre-admission laboratory tests).","requirements":"For some observations it may be important to know the link between an observation and a particular encounter.","alias":["Context"],"min":0,"max":"1","base":{"path":"Observation.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1"},{"identity":"rim","map":"inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN]"}]},{"id":"Observation.effective[x]","path":"Observation.effective[x]","short":"Clinically relevant time/time-period for observation","definition":"For lab tests this is the specimen collection date. For Ask at Order Entry Questions (AOE)'s this is the date the question was asked.","comment":"At least a date should be present unless this observation is a historical report. For recording imprecise or \"fuzzy\" times (For example, a blood glucose measurement taken \"after breakfast\") use the [Timing](http://hl7.org/fhir/R4/datatypes.html#timing) datatype which allow the measurement to be tied to regular life events.","requirements":"Knowing when an observation was deemed true is important to its relevance as well as determining trends.","alias":["Occurrence"],"min":0,"max":"1","base":{"path":"Observation.effective[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Period"}],"condition":["us-core-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"us-core-1","severity":"error","human":"Datetime must be at least to day.","expression":"($this as dateTime).toString().length() >= 8","xpath":"f:matches(effectiveDateTime,/\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)/)"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"OBX-14, and/or OBX-19 after v2.4 (depends on who observation made)"},{"identity":"rim","map":"effectiveTime"},{"identity":"argonaut-dq-dstu2","map":"Observation.effective[x]"}]},{"id":"Observation.issued","path":"Observation.issued","short":"Date/Time this version was made available","definition":"The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.","comment":"For Observations that don’t require review and verification, it may be the same as the [`lastUpdated` ](http://hl7.org/fhir/R4/resource-definitions.html#Meta.lastUpdated) time of the resource itself. For Observations that do require review and verification for certain updates, it might not be the same as the `lastUpdated` time of the resource itself due to a non-clinically significant update that doesn’t require the new version to be reviewed and verified again.","min":0,"max":"1","base":{"path":"Observation.issued","min":0,"max":"1"},"type":[{"code":"instant"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"v2","map":"OBR.22 (or MSH.7), or perhaps OBX-19 (depends on who observation made)"},{"identity":"rim","map":"participation[typeCode=AUT].time"}]},{"id":"Observation.performer","path":"Observation.performer","short":"Who is responsible for the observation","definition":"Who was responsible for asserting the observed value as \"true\".","requirements":"May give a degree of confidence in the observation and also indicates where follow-up questions should be directed.","min":0,"max":"*","base":{"path":"Observation.performer","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/CareTeam","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"OBX.15 / (Practitioner) OBX-16, PRT-5:PRT-4='RO' / (Device) OBX-18 , PRT-10:PRT-4='EQUIP' / (Organization) OBX-23, PRT-8:PRT-4='PO'"},{"identity":"rim","map":"participation[typeCode=PRF]"}]},{"id":"Observation.value[x]","path":"Observation.value[x]","short":"Result Value","definition":"The Laboratory result value. If a coded value, the valueCodeableConcept.code **SHOULD** be selected from [SNOMED CT](http://hl7.org/fhir/ValueSet/uslab-obs-codedresults). If a numeric value, valueQuantity.code **SHALL** be selected from [UCUM](http://unitsofmeasure.org). A FHIR [UCUM Codes value set](http://hl7.org/fhir/STU3/valueset-ucum-units.html) that defines all UCUM codes is in the FHIR specification.","comment":"An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/R4/observation.html#notes) below.","requirements":"An observation exists to have a value, though it might not if it is in error, or if it represents a group of observations.","min":0,"max":"1","base":{"path":"Observation.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"},{"code":"CodeableConcept"},{"code":"string"},{"code":"boolean"},{"code":"integer"},{"code":"Range"},{"code":"Ratio"},{"code":"SampledData"},{"code":"time"},{"code":"dateTime"},{"code":"Period"}],"condition":["obs-7","us-core-2","us-core-3","us-core-4"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true}],"key":"us-core-4","severity":"warning","human":"SHOULD use Snomed CT for coded Results","expression":"valueCodeableConcept.coding.system.empty() or valueCodeableConcept.coding.system = 'http://snomed.info/sct'","xpath":"not(exists(f:valueCodeableConcept/f:coding/f:system) ) or f:valueCodeableConcept/f:coding/f:system[@value='http://snomed.info/sct']"},{"key":"us-core-3","severity":"error","human":"SHALL use UCUM for coded quantity units.","expression":"valueQuantity.system.empty() or valueQuantity.system = 'http://unitsofmeasure.org'","xpath":"not(exists(f:valueQuantity/f:system) ) or f:valueQuantity/f:system[@value='http://unitsofmeasure.org']"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"sct-concept","map":"< 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"},{"identity":"argonaut-dq-dstu2","map":"Observation.value[x]"}]},{"id":"Observation.dataAbsentReason","path":"Observation.dataAbsentReason","short":"Why the result is missing","definition":"Provides a reason why the expected value in the element Observation.value[x] is missing.","comment":"Null or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"specimen unsatisfactory\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Note that an observation may only be reported if there are values to report. For example differential cell counts values may be reported only when > 0. Because of these options, use-case agreements are required to interpret general observations for null or exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6","us-core-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"},{"identity":"argonaut-dq-dstu2","map":"Observation.dataAbsentReason"}]},{"id":"Observation.interpretation","path":"Observation.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.note","path":"Observation.note","short":"Comments about the observation","definition":"Comments about the observation or the results.","comment":"May include general statements about the observation, or statements about significant, unexpected or unreliable results values, or information about its source when relevant to its interpretation.","requirements":"Need to be able to provide free text additional information.","min":0,"max":"*","base":{"path":"Observation.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NTE.3 (partner NTE to OBX, or sometimes another (child?) OBX)"},{"identity":"rim","map":"subjectOf.observationEvent[code=\"annotation\"].value"}]},{"id":"Observation.bodySite","path":"Observation.bodySite","short":"Observed body part","definition":"Indicates the site on the subject's body where the observation was made (i.e. the target site).","comment":"Only used if not implicit in code found in Observation.code. In many systems, this may be represented as a related observation instead of an inline component. \n\nIf the use case requires BodySite to be handled as a separate resource (e.g. to identify and track separately) then use the standard extension[ bodySite](http://hl7.org/fhir/R4/extension-bodysite.html).","min":0,"max":"1","base":{"path":"Observation.bodySite","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BodySite"}],"strength":"example","description":"Codes describing anatomical locations. May include laterality.","valueSet":"http://hl7.org/fhir/ValueSet/body-site"},"mapping":[{"identity":"sct-concept","map":"< 123037004 |Body structure|"},{"identity":"v2","map":"OBX-20"},{"identity":"rim","map":"targetSiteCode"},{"identity":"sct-attr","map":"718497002 |Inherent location|"}]},{"id":"Observation.method","path":"Observation.method","short":"How it was done","definition":"Indicates the mechanism used to perform the observation.","comment":"Only used if not implicit in code for Observation.code.","requirements":"In some cases, method can impact results and is thus used for determining whether results can be compared or determining significance of results.","min":0,"max":"1","base":{"path":"Observation.method","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationMethod"}],"strength":"example","description":"Methods for simple observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-methods"},"mapping":[{"identity":"v2","map":"OBX-17"},{"identity":"rim","map":"methodCode"}]},{"id":"Observation.specimen","path":"Observation.specimen","short":"Specimen used for this observation","definition":"The specimen that was used when this observation was made.","comment":"Should only be used if not implicit in code found in `Observation.code`. Observations are not made on specimens themselves; they are made on a subject, but in many cases by the means of a specimen. Note that although specimens are often involved, they are not always tracked and reported explicitly. Also note that observation resources may be used in contexts that track the specimen explicitly (e.g. Diagnostic Report).","min":0,"max":"1","base":{"path":"Observation.specimen","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Specimen"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"sct-concept","map":"< 123038009 |Specimen|"},{"identity":"v2","map":"SPM segment"},{"identity":"rim","map":"participation[typeCode=SPC].specimen"},{"identity":"sct-attr","map":"704319004 |Inherent in|"}]},{"id":"Observation.device","path":"Observation.device","short":"(Measurement) Device","definition":"The device used to generate the observation data.","comment":"Note that this is not meant to represent a device involved in the transmission of the result, e.g., a gateway. Such devices may be documented using the Provenance resource where relevant.","min":0,"max":"1","base":{"path":"Observation.device","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/DeviceMetric"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"sct-concept","map":"< 49062001 |Device|"},{"identity":"v2","map":"OBX-17 / PRT -10"},{"identity":"rim","map":"participation[typeCode=DEV]"},{"identity":"sct-attr","map":"424226004 |Using device|"}]},{"id":"Observation.referenceRange","path":"Observation.referenceRange","short":"Provides guide for interpretation","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an \"OR\". In other words, to represent two distinct target populations, two `referenceRange` elements would be used.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.referenceRange","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"obs-3","severity":"error","human":"Must have at least a low or a high or text","expression":"low.exists() or high.exists() or text.exists()","xpath":"(exists(f:low) or exists(f:high)or exists(f:text))"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]},{"id":"Observation.referenceRange.id","path":"Observation.referenceRange.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.referenceRange.extension","path":"Observation.referenceRange.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.referenceRange.modifierExtension","path":"Observation.referenceRange.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.referenceRange.low","path":"Observation.referenceRange.low","short":"Low Range, if relevant","definition":"The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).","min":0,"max":"1","base":{"path":"Observation.referenceRange.low","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"condition":["obs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:IVL_PQ.low"}]},{"id":"Observation.referenceRange.high","path":"Observation.referenceRange.high","short":"High Range, if relevant","definition":"The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).","min":0,"max":"1","base":{"path":"Observation.referenceRange.high","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"condition":["obs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:IVL_PQ.high"}]},{"id":"Observation.referenceRange.type","path":"Observation.referenceRange.type","short":"Reference range qualifier","definition":"Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.","comment":"This SHOULD be populated if there is more than one range. If this element is not present then the normal range is assumed.","requirements":"Need to be able to say what kind of reference range this is - normal, recommended, therapeutic, etc., - for proper interpretation.","min":0,"max":"1","base":{"path":"Observation.referenceRange.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationRangeMeaning"}],"strength":"preferred","description":"Code for the meaning of a reference range.","valueSet":"http://hl7.org/fhir/ValueSet/referencerange-meaning"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values| OR \r< 365860008 |General clinical state finding| \rOR \r< 250171008 |Clinical history or observation findings| OR \r< 415229000 |Racial group| OR \r< 365400002 |Finding of puberty stage| OR\r< 443938003 |Procedure carried out on subject|"},{"identity":"v2","map":"OBX-10"},{"identity":"rim","map":"interpretationCode"}]},{"id":"Observation.referenceRange.appliesTo","path":"Observation.referenceRange.appliesTo","short":"Reference range population","definition":"Codes to indicate the target population this reference range applies to. For example, a reference range may be based on the normal population or a particular sex or race. Multiple `appliesTo` are interpreted as an \"AND\" of the target populations. For example, to represent a target population of African American females, both a code of female and a code for African American would be used.","comment":"This SHOULD be populated if there is more than one range. If this element is not present then the normal population is assumed.","requirements":"Need to be able to identify the target population for proper interpretation.","min":0,"max":"*","base":{"path":"Observation.referenceRange.appliesTo","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationRangeType"}],"strength":"example","description":"Codes identifying the population the reference range applies to.","valueSet":"http://hl7.org/fhir/ValueSet/referencerange-appliesto"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values| OR \r< 365860008 |General clinical state finding| \rOR \r< 250171008 |Clinical history or observation findings| OR \r< 415229000 |Racial group| OR \r< 365400002 |Finding of puberty stage| OR\r< 443938003 |Procedure carried out on subject|"},{"identity":"v2","map":"OBX-10"},{"identity":"rim","map":"interpretationCode"}]},{"id":"Observation.referenceRange.age","path":"Observation.referenceRange.age","short":"Applicable age range, if relevant","definition":"The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.","requirements":"Some analytes vary greatly over age.","min":0,"max":"1","base":{"path":"Observation.referenceRange.age","min":0,"max":"1"},"type":[{"code":"Range"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"outboundRelationship[typeCode=PRCN].targetObservationCriterion[code=\"age\"].value"}]},{"id":"Observation.referenceRange.text","path":"Observation.referenceRange.text","short":"Text based reference range in an observation","definition":"Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of \"Negative\" or a list or table of \"normals\".","min":0,"max":"1","base":{"path":"Observation.referenceRange.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:ST"}]},{"id":"Observation.hasMember","path":"Observation.hasMember","short":"Related resource that belongs to the Observation group","definition":"This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.","comment":"When using this element, an observation will typically have either a value or a set of related resources, although both may be present in some cases. For a discussion on the ways Observations can assembled in groups together, see [Notes](http://hl7.org/fhir/R4/observation.html#obsgrouping) below. Note that a system may calculate results from [QuestionnaireResponse](http://hl7.org/fhir/R4/questionnaireresponse.html) into a final score and represent the score as an Observation.","min":0,"max":"*","base":{"path":"Observation.hasMember","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Observation","http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","http://hl7.org/fhir/StructureDefinition/MolecularSequence"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Relationships established by OBX-4 usage"},{"identity":"rim","map":"outBoundRelationship"}]},{"id":"Observation.derivedFrom","path":"Observation.derivedFrom","short":"Related measurements the observation is made from","definition":"The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.","comment":"All the reference choices that are listed in this element can represent clinical observations and other measurements that may be the source for a derived value. The most common reference will be another Observation. For a discussion on the ways Observations can assembled in groups together, see [Notes](http://hl7.org/fhir/R4/observation.html#obsgrouping) below.","min":0,"max":"*","base":{"path":"Observation.derivedFrom","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/DocumentReference","http://hl7.org/fhir/StructureDefinition/ImagingStudy","http://hl7.org/fhir/StructureDefinition/Media","http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","http://hl7.org/fhir/StructureDefinition/Observation","http://hl7.org/fhir/StructureDefinition/MolecularSequence"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Relationships established by OBX-4 usage"},{"identity":"rim","map":".targetObservation"}]},{"id":"Observation.component","path":"Observation.component","short":"Component results","definition":"Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.","comment":"For a discussion on the ways Observations can be assembled in groups together see [Notes](http://hl7.org/fhir/R4/observation.html#notes) below.","requirements":"Component observations share the same attributes in the Observation resource as the primary observation and are always treated a part of a single observation (they are not separable). However, the reference range for the primary observation value is not inherited by the component values and is required when appropriate for each component observation.","min":0,"max":"*","base":{"path":"Observation.component","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"containment by OBX-4?"},{"identity":"rim","map":"outBoundRelationship[typeCode=COMP]"}]},{"id":"Observation.component.id","path":"Observation.component.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component.extension","path":"Observation.component.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component.modifierExtension","path":"Observation.component.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.component.code","path":"Observation.component.code","short":"Type of component observation (code / type)","definition":"Describes what was observed. Sometimes this is called the observation \"code\".","comment":"*All* code-value and component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation.","requirements":"Knowing what kind of observation is being made is essential to understanding the observation.","min":1,"max":"1","base":{"path":"Observation.component.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCode"}],"strength":"example","description":"Codes identifying names of simple observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-codes"},"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR \r< 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"}]},{"id":"Observation.component.value[x]","path":"Observation.component.value[x]","short":"Actual component result","definition":"The information determined as a result of making the observation, if the information has a simple value.","comment":"Used when observation has a set of component observations. An observation may have both a value (e.g. an Apgar score) and component observations (the observations from which the Apgar score was derived). If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/R4/observation.html#notes) below.","requirements":"An observation exists to have a value, though it might not if it is in error, or if it represents a group of observations.","min":0,"max":"1","base":{"path":"Observation.component.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"},{"code":"CodeableConcept"},{"code":"string"},{"code":"boolean"},{"code":"integer"},{"code":"Range"},{"code":"Ratio"},{"code":"SampledData"},{"code":"time"},{"code":"dateTime"},{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"sct-concept","map":"363714003 |Interprets| < 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.component.dataAbsentReason","path":"Observation.component.dataAbsentReason","short":"Why the component result is missing","definition":"Provides a reason why the expected value in the element Observation.component.value[x] is missing.","comment":"\"Null\" or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"test not done\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Because of these options, use-case agreements are required to interpret general observations for exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.component.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.component.interpretation","path":"Observation.component.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.component.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.component.referenceRange","path":"Observation.component.referenceRange","short":"Provides guide for interpretation of component result","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.component.referenceRange","min":0,"max":"*"},"contentReference":"#Observation.referenceRange","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]}]},"differential":{"element":[{"id":"Observation","path":"Observation","definition":"This profile is created to meet the 2015 Edition Common Clinical Data Set 'Laboratory test(s) and Laboratory value(s)/result(s)' requirements.","constraint":[{"key":"us-core-2","severity":"error","human":"If there is no component or related element then either a value[x] or a data absent reason must be present","expression":"(component.empty() and related.empty()) implies (dataAbsentReason or value)","xpath":"exists(f:component) or exists(f:related) or exists(f:*[starts-with(local-name(.), 'value)]) or exists(f:dataAbsentReason)"}],"mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation"}]},{"id":"Observation.status","path":"Observation.status","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/observation-status"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.status"}]},{"id":"Observation.category","path":"Observation.category","slicing":{"discriminator":[{"type":"pattern","path":"$this"}],"rules":"open"},"min":1,"max":"*","type":[{"code":"CodeableConcept"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.category"}]},{"id":"Observation.category:Laboratory","path":"Observation.category","sliceName":"Laboratory","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"laboratory"}]},"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.category"}]},{"id":"Observation.code","path":"Observation.code","short":"Laboratory Test Name","definition":"The test that was performed. A LOINC **SHALL** be used if the concept is present in LOINC.","comment":"The typical patterns for codes are: 1) a LOINC code either as a translation from a \"local\" code or as a primary code, or 2) a local code only if no suitable LOINC exists, or 3) both the local and the LOINC translation. Systems SHALL be capable of sending the local code if one exists. When using LOINC , Use either the SHORTNAME or LONG_COMMON_NAME field for the display.","alias":["Test Name","Observation Identifer"],"min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","description":"LOINC codes","valueSet":"http://hl7.org/fhir/ValueSet/observation-codes"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.code"}]},{"id":"Observation.subject","path":"Observation.subject","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.subject"}]},{"id":"Observation.effective[x]","path":"Observation.effective[x]","definition":"For lab tests this is the specimen collection date. For Ask at Order Entry Questions (AOE)'s this is the date the question was asked.","min":0,"max":"1","type":[{"code":"dateTime"},{"code":"Period"}],"condition":["us-core-1"],"constraint":[{"key":"us-core-1","severity":"error","human":"Datetime must be at least to day.","expression":"($this as dateTime).toString().length() >= 8","xpath":"f:matches(effectiveDateTime,/\\d{4}-[01]\\d-[0-3]\\dT[0-2]\\d:[0-5]\\d([+-][0-2]\\d:[0-5]\\d|Z)/)"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.effective[x]"}]},{"id":"Observation.value[x]","path":"Observation.value[x]","short":"Result Value","definition":"The Laboratory result value. If a coded value, the valueCodeableConcept.code **SHOULD** be selected from [SNOMED CT](http://hl7.org/fhir/ValueSet/uslab-obs-codedresults). If a numeric value, valueQuantity.code **SHALL** be selected from [UCUM](http://unitsofmeasure.org). A FHIR [UCUM Codes value set](http://hl7.org/fhir/STU3/valueset-ucum-units.html) that defines all UCUM codes is in the FHIR specification.","min":0,"max":"1","condition":["us-core-2","us-core-3","us-core-4"],"constraint":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true}],"key":"us-core-4","severity":"warning","human":"SHOULD use Snomed CT for coded Results","expression":"valueCodeableConcept.coding.system.empty() or valueCodeableConcept.coding.system = 'http://snomed.info/sct'","xpath":"not(exists(f:valueCodeableConcept/f:coding/f:system) ) or f:valueCodeableConcept/f:coding/f:system[@value='http://snomed.info/sct']"},{"key":"us-core-3","severity":"error","human":"SHALL use UCUM for coded quantity units.","expression":"valueQuantity.system.empty() or valueQuantity.system = 'http://unitsofmeasure.org'","xpath":"not(exists(f:valueQuantity/f:system) ) or f:valueQuantity/f:system[@value='http://unitsofmeasure.org']"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.value[x]"}]},{"id":"Observation.dataAbsentReason","path":"Observation.dataAbsentReason","min":0,"max":"1","type":[{"code":"CodeableConcept"}],"condition":["us-core-2"],"mustSupport":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.dataAbsentReason"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-organization.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-organization.json new file mode 100755 index 000000000..2df37ce8c --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-organization.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-organization","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Organization 0..*
    \".\"\".\"\".\" identifier S0..*(Slice Definition)Slice: Unordered, Open by pattern:$this
    \".\"\".\"\".\"\".\" identifier:All Slices Content/Rules for all slices
    \".\"\".\"\".\"\".\"\".\" system S0..1uri
    \".\"\".\"\".\"\".\"\".\" value S0..1string
    \".\"\".\"\".\"\".\" identifier:NPI S0..1IdentifierNational Provider Identifier (NPI)
    Required Pattern: At least the following
    \".\"\".\"\".\"\".\"\".\" system1..1uriThe namespace for the identifier value
    Fixed Value: http://hl7.org/fhir/sid/us-npi
    \".\"\".\"\".\"\".\" identifier:CLIA S0..1IdentifierClinical Laboratory Improvement Amendments (CLIA) Number for laboratories
    Required Pattern: At least the following
    \".\"\".\"\".\"\".\"\".\" system1..1uriThe namespace for the identifier value
    Fixed Value: urn:oid:2.16.840.1.113883.4.7
    \".\"\".\"\".\" active S1..1boolean
    \".\"\".\"\".\" name S1..1string
    \".\"\".\"\".\" telecom S0..*ContactPoint
    \".\"\".\"\".\" address S0..*Address
    \".\"\".\"\".\"\".\" line S0..4string
    \".\"\".\"\".\"\".\" city S0..1string
    \".\"\".\"\".\"\".\" state S0..1stringBinding: USPS Two Letter Alphabetic Codes (extensible)
    \".\"\".\"\".\"\".\" postalCode S0..1stringUS Zip Codes
    \".\"\".\"\".\"\".\" country S0..1string

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization","version":"3.1.0","name":"USCoreOrganizationProfile","title":"US Core Organization Profile","status":"active","experimental":false,"date":"2019-08-31T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines basic constraints and extensions on the Organization resource for use with other US Core resources","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"}],"kind":"resource","abstract":false,"type":"Organization","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Organization","derivation":"constraint","snapshot":{"element":[{"id":"Organization","path":"Organization","short":"A grouping of people or organizations with a common purpose","definition":"A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice groups, payer/insurer, etc.","min":0,"max":"*","base":{"path":"Organization","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"org-1","severity":"error","human":"The organization SHALL at least have a name or an identifier, and possibly more than one","expression":"(identifier.count() + name.count()) > 0","xpath":"count(f:identifier | f:name) > 0","source":"http://hl7.org/fhir/StructureDefinition/Organization"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"v2","map":"(also see master files messages)"},{"identity":"rim","map":"Organization(classCode=ORG, determinerCode=INST)"},{"identity":"servd","map":"Organization"}]},{"id":"Organization.id","path":"Organization.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Organization.meta","path":"Organization.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Organization.implicitRules","path":"Organization.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Organization.language","path":"Organization.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Organization.text","path":"Organization.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Organization.contained","path":"Organization.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.extension","path":"Organization.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.modifierExtension","path":"Organization.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.identifier","path":"Organization.identifier","slicing":{"discriminator":[{"type":"pattern","path":"$this"}],"rules":"open"},"short":"Identifies this organization across multiple systems","definition":"Identifier for the organization that is used to identify the organization across multiple disparate systems.","comment":"NPI preferred.","requirements":"Organizations are known by a variety of ids. Some institutions maintain several, and most collect identifiers for exchange with other organizations concerning the organization.","min":0,"max":"*","base":{"path":"Organization.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"condition":["org-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"XON.10 / XON.3"},{"identity":"rim","map":".scopes[Role](classCode=IDENT)"},{"identity":"servd","map":"./Identifiers"},{"identity":"servd","map":"n/a"}]},{"id":"Organization.identifier.id","path":"Organization.identifier.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.identifier.extension","path":"Organization.identifier.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.identifier.use","path":"Organization.identifier.use","short":"usual | official | temp | secondary | old (If known)","definition":"The purpose of this identifier.","comment":"Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.","requirements":"Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.","min":0,"max":"1","base":{"path":"Identifier.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary id for a permanent one.","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"IdentifierUse"}],"strength":"required","description":"Identifies the purpose for this identifier, if known .","valueSet":"http://hl7.org/fhir/ValueSet/identifier-use|4.0.1"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"Role.code or implied by context"}]},{"id":"Organization.identifier.type","path":"Organization.identifier.type","short":"Description of identifier","definition":"A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.","comment":"This element deals only with general categories of identifiers. It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.","requirements":"Allows users to make use of identifiers when the identifier system is not known.","min":0,"max":"1","base":{"path":"Identifier.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"IdentifierType"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"extensible","description":"A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.","valueSet":"http://hl7.org/fhir/ValueSet/identifier-type"},"mapping":[{"identity":"v2","map":"CX.5"},{"identity":"rim","map":"Role.code or implied by context"}]},{"id":"Organization.identifier.system","path":"Organization.identifier.system","short":"The namespace for the identifier value","definition":"Establishes the namespace for the value - that is, a URL that describes a set values that are unique.","comment":"Identifier.system is always case sensitive.","requirements":"There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.","min":0,"max":"1","base":{"path":"Identifier.system","min":0,"max":"1"},"type":[{"code":"uri"}],"example":[{"label":"General","valueUri":"http://www.acme.com/identifiers/patient"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.4 / EI-2-4"},{"identity":"rim","map":"II.root or Role.id.root"},{"identity":"servd","map":"./IdentifierType"}]},{"id":"Organization.identifier.value","path":"Organization.identifier.value","short":"The value that is unique","definition":"The portion of the identifier typically relevant to the user and which is unique within the context of the system.","comment":"If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the [Rendered Value extension](http://hl7.org/fhir/R4/extension-rendered-value.html). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe.","min":0,"max":"1","base":{"path":"Identifier.value","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"123456"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.1 / EI.1"},{"identity":"rim","map":"II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)"},{"identity":"servd","map":"./Value"}]},{"id":"Organization.identifier.period","path":"Organization.identifier.period","short":"Time period when id is/was valid for use","definition":"Time period during which identifier is/was valid for use.","min":0,"max":"1","base":{"path":"Identifier.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.7 + CX.8"},{"identity":"rim","map":"Role.effectiveTime or implied by context"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Organization.identifier.assigner","path":"Organization.identifier.assigner","short":"Organization that issued id (may be just text)","definition":"Organization that issued/manages the identifier.","comment":"The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization.","min":0,"max":"1","base":{"path":"Identifier.assigner","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.4 / (CX.4,CX.9,CX.10)"},{"identity":"rim","map":"II.assigningAuthorityName but note that this is an improper use by the definition of the field. Also Role.scoper"},{"identity":"servd","map":"./IdentifierIssuingAuthority"}]},{"id":"Organization.identifier:NPI","path":"Organization.identifier","sliceName":"NPI","short":"National Provider Identifier (NPI)","definition":"Identifier for the organization that is used to identify the organization across multiple disparate systems.","requirements":"Organizations are known by a variety of ids. Some institutions maintain several, and most collect identifiers for exchange with other organizations concerning the organization.","min":0,"max":"1","base":{"path":"Organization.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"patternIdentifier":{"system":"http://hl7.org/fhir/sid/us-npi"},"condition":["org-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"XON.10 / XON.3"},{"identity":"rim","map":".scopes[Role](classCode=IDENT)"},{"identity":"servd","map":"./Identifiers"},{"identity":"servd","map":"n/a"}]},{"id":"Organization.identifier:CLIA","path":"Organization.identifier","sliceName":"CLIA","short":"Clinical Laboratory Improvement Amendments (CLIA) Number for laboratories","definition":"Identifier for the organization that is used to identify the organization across multiple disparate systems.","requirements":"Organizations are known by a variety of ids. Some institutions maintain several, and most collect identifiers for exchange with other organizations concerning the organization.","min":0,"max":"1","base":{"path":"Organization.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"patternIdentifier":{"system":"urn:oid:2.16.840.1.113883.4.7"},"condition":["org-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"XON.10 / XON.3"},{"identity":"rim","map":".scopes[Role](classCode=IDENT)"},{"identity":"servd","map":"./Identifiers"},{"identity":"servd","map":"n/a"}]},{"id":"Organization.active","path":"Organization.active","short":"Whether the organization's record is still in active use","definition":"Whether the organization's record is still in active use.","comment":"This active flag is not intended to be used to mark an organization as temporarily closed or under construction. Instead the Location(s) within the Organization should have the suspended status. If further details of the reason for the suspension are required, then an extension on this element should be used.\n\nThis element is labeled as a modifier because it may be used to mark that the resource was created in error.","requirements":"Need a flag to indicate a record is no longer to be used and should generally be hidden for the user in the UI.","min":1,"max":"1","base":{"path":"Organization.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid","isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"No equivalent in HL7 v2"},{"identity":"rim","map":".status"},{"identity":"servd","map":"./Status (however this concept in ServD more covers why the organization is active or not, could be delisted, deregistered, not operational yet) this could alternatively be derived from ./StartDate and ./EndDate and given a context date."}]},{"id":"Organization.type","path":"Organization.type","short":"Kind of organization","definition":"The kind(s) of organization that this is.","comment":"Organizations can be corporations, wards, sections, clinical teams, government departments, etc. Note that code is generally a classifier of the type of organization; in many applications, codes are used to identity a particular organization (say, ward) as opposed to another of the same type - these are identifiers, not codes\n\nWhen considering if multiple types are appropriate, you should evaluate if child organizations would be a more appropriate use of the concept, as different types likely are in different sub-areas of the organization. This is most likely to be used where type values have orthogonal values, such as a religious, academic and medical center.\n\nWe expect that some jurisdictions will profile this optionality to be a single cardinality.","requirements":"Need to be able to track the kind of organization that this is - different organization types have different uses.","min":0,"max":"*","base":{"path":"Organization.type","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"OrganizationType"}],"strength":"example","description":"Used to categorize the organization.","valueSet":"http://hl7.org/fhir/ValueSet/organization-type"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"v2","map":"No equivalent in v2"},{"identity":"rim","map":".code"},{"identity":"servd","map":"n/a"}]},{"id":"Organization.name","path":"Organization.name","short":"Name used for the organization","definition":"A name associated with the organization.","comment":"If the name of an organization changes, consider putting the old name in the alias column so that it can still be located through searches.","requirements":"Need to use the name as the label of the organization.","min":1,"max":"1","base":{"path":"Organization.name","min":0,"max":"1"},"type":[{"code":"string"}],"condition":["org-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XON.1"},{"identity":"rim","map":".name"},{"identity":"servd","map":".PreferredName/Name"},{"identity":"servd","map":"./PrimaryAddress and ./OtherAddresses"}]},{"id":"Organization.alias","path":"Organization.alias","short":"A list of alternate names that the organization is known as, or was known as in the past","definition":"A list of alternate names that the organization is known as, or was known as in the past.","comment":"There are no dates associated with the alias/historic names, as this is not intended to track when names were used, but to assist in searching so that older names can still result in identifying the organization.","requirements":"Over time locations and organizations go through many changes and can be known by different names.\n\nFor searching knowing previous names that the organization was known by can be very useful.","min":0,"max":"*","base":{"path":"Organization.alias","min":0,"max":"*"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".name"}]},{"id":"Organization.telecom","path":"Organization.telecom","short":"A contact detail for the organization","definition":"A contact detail for the organization.","comment":"The use code 'home' is not to be used. Note that these contacts are not the contact details of people who are employed by or represent the organization, but official contacts for the organization itself.","requirements":"Human contact for the organization.","min":0,"max":"*","base":{"path":"Organization.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"condition":["org-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"org-3","severity":"error","human":"The telecom of an organization can never be of use 'home'","expression":"where(use = 'home').empty()","xpath":"count(f:use[@value='home']) = 0","source":"http://hl7.org/fhir/StructureDefinition/Organization"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"ORC-22?"},{"identity":"rim","map":".telecom"},{"identity":"servd","map":"./ContactPoints"}]},{"id":"Organization.address","path":"Organization.address","short":"An address for the organization","definition":"An address for the organization.","comment":"Organization may have multiple addresses with different uses or applicable periods. The use code 'home' is not to be used.","requirements":"May need to keep track of the organization's addresses for contacting, billing or reporting requirements.","min":0,"max":"*","base":{"path":"Organization.address","min":0,"max":"*"},"type":[{"code":"Address"}],"condition":["org-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"org-2","severity":"error","human":"An address of an organization can never be of use 'home'","expression":"where(use = 'home').empty()","xpath":"count(f:use[@value='home']) = 0","source":"http://hl7.org/fhir/StructureDefinition/Organization"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"ORC-23?"},{"identity":"rim","map":".address"},{"identity":"servd","map":"./PrimaryAddress and ./OtherAddresses"},{"identity":"servd","map":"n/a"}]},{"id":"Organization.address.id","path":"Organization.address.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.address.extension","path":"Organization.address.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.address.use","path":"Organization.address.use","short":"home | work | temp | old | billing - purpose of this address","definition":"The purpose of this address.","comment":"Applications can assume that an address is current unless it explicitly says that it is temporary or old.","requirements":"Allows an appropriate address to be chosen from a list of many.","min":0,"max":"1","base":{"path":"Address.use","min":0,"max":"1"},"type":[{"code":"code"}],"example":[{"label":"General","valueCode":"home"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old address etc.for a current/permanent one","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AddressUse"}],"strength":"required","description":"The use of an address.","valueSet":"http://hl7.org/fhir/ValueSet/address-use|4.0.1"},"mapping":[{"identity":"v2","map":"XAD.7"},{"identity":"rim","map":"unique(./use)"},{"identity":"servd","map":"./AddressPurpose"}]},{"id":"Organization.address.type","path":"Organization.address.type","short":"postal | physical | both","definition":"Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.","comment":"The definition of Address states that \"address is intended to describe postal addresses, not physical locations\". However, many applications track whether an address has a dual purpose of being a location that can be visited as well as being a valid delivery destination, and Postal addresses are often used as proxies for physical locations (also see the [Location](http://hl7.org/fhir/R4/location.html#) resource).","min":0,"max":"1","base":{"path":"Address.type","min":0,"max":"1"},"type":[{"code":"code"}],"example":[{"label":"General","valueCode":"both"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AddressType"}],"strength":"required","description":"The type of an address (physical / postal).","valueSet":"http://hl7.org/fhir/ValueSet/address-type|4.0.1"},"mapping":[{"identity":"v2","map":"XAD.18"},{"identity":"rim","map":"unique(./use)"},{"identity":"vcard","map":"address type parameter"}]},{"id":"Organization.address.text","path":"Organization.address.text","short":"Text representation of the address","definition":"Specifies the entire address as it should be displayed e.g. on a postal label. This may be provided instead of or as well as the specific parts.","comment":"Can provide both a text representation and parts. Applications updating an address SHALL ensure that when both text and parts are present, no content is included in the text that isn't found in a part.","requirements":"A renderable, unencoded form.","min":0,"max":"1","base":{"path":"Address.text","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"137 Nowhere Street, Erewhon 9132"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.1 + XAD.2 + XAD.3 + XAD.4 + XAD.5 + XAD.6"},{"identity":"rim","map":"./formatted"},{"identity":"vcard","map":"address label parameter"}]},{"id":"Organization.address.line","path":"Organization.address.line","short":"Street name, number, direction & P.O. Box etc.","definition":"This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.","min":0,"max":"4","base":{"path":"Address.line","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"The order in which lines should appear in an address label","example":[{"label":"General","valueString":"137 Nowhere Street"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.1 + XAD.2 (note: XAD.1 and XAD.2 have different meanings for a company address than for a person address)"},{"identity":"rim","map":"AD.part[parttype = AL]"},{"identity":"vcard","map":"street"},{"identity":"servd","map":"./StreetAddress (newline delimitted)"}]},{"id":"Organization.address.city","path":"Organization.address.city","short":"Name of city, town etc.","definition":"The name of the city, town, suburb, village or other community or delivery center.","alias":["Municpality"],"min":0,"max":"1","base":{"path":"Address.city","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"Erewhon"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.3"},{"identity":"rim","map":"AD.part[parttype = CTY]"},{"identity":"vcard","map":"locality"},{"identity":"servd","map":"./Jurisdiction"}]},{"id":"Organization.address.district","path":"Organization.address.district","short":"District name (aka county)","definition":"The name of the administrative area (county).","comment":"District is sometimes known as county, but in some regions 'county' is used in place of city (municipality), so county name should be conveyed in city instead.","alias":["County"],"min":0,"max":"1","base":{"path":"Address.district","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"Madison"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.9"},{"identity":"rim","map":"AD.part[parttype = CNT | CPA]"}]},{"id":"Organization.address.state","path":"Organization.address.state","short":"Sub-unit of country (abbreviations ok)","definition":"Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes).","alias":["Province","Territory"],"min":0,"max":"1","base":{"path":"Address.state","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Two letter USPS alphabetic codes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state"},"mapping":[{"identity":"v2","map":"XAD.4"},{"identity":"rim","map":"AD.part[parttype = STA]"},{"identity":"vcard","map":"region"},{"identity":"servd","map":"./Region"},{"identity":"servd","map":"./Sites"}]},{"id":"Organization.address.postalCode","path":"Organization.address.postalCode","short":"US Zip Codes","definition":"A postal code designating a region defined by the postal service.","alias":["Zip"],"min":0,"max":"1","base":{"path":"Address.postalCode","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"9132"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.5"},{"identity":"rim","map":"AD.part[parttype = ZIP]"},{"identity":"vcard","map":"code"},{"identity":"servd","map":"./PostalIdentificationCode"}]},{"id":"Organization.address.country","path":"Organization.address.country","short":"Country (e.g. can be ISO 3166 2 or 3 letter code)","definition":"Country - a nation as commonly understood or generally accepted.","comment":"ISO 3166 3 letter codes can be used in place of a human readable country name.","min":0,"max":"1","base":{"path":"Address.country","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.6"},{"identity":"rim","map":"AD.part[parttype = CNT]"},{"identity":"vcard","map":"country"},{"identity":"servd","map":"./Country"}]},{"id":"Organization.address.period","path":"Organization.address.period","short":"Time period when address was/is in use","definition":"Time period when address was/is in use.","requirements":"Allows addresses to be placed in historical context.","min":0,"max":"1","base":{"path":"Address.period","min":0,"max":"1"},"type":[{"code":"Period"}],"example":[{"label":"General","valuePeriod":{"start":"2010-03-23T00:00:00+11:00","end":"2010-07-01T00:00:00+10:00"}}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.12 / XAD.13 + XAD.14"},{"identity":"rim","map":"./usablePeriod[type=\"IVL\"]"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Organization.partOf","path":"Organization.partOf","short":"The organization of which this organization forms a part","definition":"The organization of which this organization forms a part.","requirements":"Need to be able to track the hierarchy of organizations within an organization.","min":0,"max":"1","base":{"path":"Organization.partOf","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":true}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"No equivalent in HL7 v2"},{"identity":"rim","map":".playedBy[classCode=Part].scoper"},{"identity":"servd","map":"n/a"}]},{"id":"Organization.contact","path":"Organization.contact","short":"Contact for the organization for a certain purpose","definition":"Contact for the organization for a certain purpose.","comment":"Where multiple contacts for the same purpose are provided there is a standard extension that can be used to determine which one is the preferred contact to use.","requirements":"Need to keep track of assigned contact points within bigger organization.","min":0,"max":"*","base":{"path":"Organization.contact","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".contactParty"}]},{"id":"Organization.contact.id","path":"Organization.contact.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.contact.extension","path":"Organization.contact.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Organization.contact.modifierExtension","path":"Organization.contact.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Organization.contact.purpose","path":"Organization.contact.purpose","short":"The type of contact","definition":"Indicates a purpose for which the contact can be reached.","requirements":"Need to distinguish between multiple contact persons.","min":0,"max":"1","base":{"path":"Organization.contact.purpose","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ContactPartyType"}],"strength":"extensible","description":"The purpose for which you would contact a contact party.","valueSet":"http://hl7.org/fhir/ValueSet/contactentity-type"},"mapping":[{"identity":"rim","map":"./type"}]},{"id":"Organization.contact.name","path":"Organization.contact.name","short":"A name associated with the contact","definition":"A name associated with the contact.","requirements":"Need to be able to track the person by name.","min":0,"max":"1","base":{"path":"Organization.contact.name","min":0,"max":"1"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-5, PID-9"},{"identity":"rim","map":"./name"}]},{"id":"Organization.contact.telecom","path":"Organization.contact.telecom","short":"Contact details (telephone, email, etc.) for a contact","definition":"A contact detail (e.g. a telephone number or an email address) by which the party may be contacted.","requirements":"People have (primary) ways to contact them in some way such as phone, email.","min":0,"max":"*","base":{"path":"Organization.contact.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-13, PID-14"},{"identity":"rim","map":"./telecom"}]},{"id":"Organization.contact.address","path":"Organization.contact.address","short":"Visiting or postal addresses for the contact","definition":"Visiting or postal addresses for the contact.","requirements":"May need to keep track of a contact party's address for contacting, billing or reporting requirements.","min":0,"max":"1","base":{"path":"Organization.contact.address","min":0,"max":"1"},"type":[{"code":"Address"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-11"},{"identity":"rim","map":"./addr"}]},{"id":"Organization.endpoint","path":"Organization.endpoint","short":"Technical endpoints providing access to services operated for the organization","definition":"Technical endpoints providing access to services operated for the organization.","requirements":"Organizations have multiple systems that provide various services and need to be able to define the technical connection details for how to connect to them, and for what purpose.","min":0,"max":"*","base":{"path":"Organization.endpoint","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Endpoint"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]}]},"differential":{"element":[{"id":"Organization","path":"Organization","mustSupport":false,"mapping":[{"identity":"servd","map":"Organization"}]},{"id":"Organization.identifier","path":"Organization.identifier","slicing":{"discriminator":[{"type":"pattern","path":"$this"}],"rules":"open"},"comment":"NPI preferred.","min":0,"max":"*","type":[{"code":"Identifier"}],"mustSupport":true,"mapping":[{"identity":"servd","map":"n/a"}]},{"id":"Organization.identifier.system","path":"Organization.identifier.system","min":0,"max":"1","type":[{"code":"uri"}],"mustSupport":true},{"id":"Organization.identifier.value","path":"Organization.identifier.value","min":0,"max":"1","type":[{"code":"string"}],"mustSupport":true},{"id":"Organization.identifier:NPI","path":"Organization.identifier","sliceName":"NPI","short":"National Provider Identifier (NPI)","min":0,"max":"1","type":[{"code":"Identifier"}],"patternIdentifier":{"system":"http://hl7.org/fhir/sid/us-npi"},"mustSupport":true,"mapping":[{"identity":"servd","map":"n/a"}]},{"id":"Organization.identifier:CLIA","path":"Organization.identifier","sliceName":"CLIA","short":"Clinical Laboratory Improvement Amendments (CLIA) Number for laboratories","min":0,"max":"1","type":[{"code":"Identifier"}],"patternIdentifier":{"system":"urn:oid:2.16.840.1.113883.4.7"},"mustSupport":true,"mapping":[{"identity":"servd","map":"n/a"}]},{"id":"Organization.active","path":"Organization.active","min":1,"max":"1","type":[{"code":"boolean"}],"mustSupport":true},{"id":"Organization.name","path":"Organization.name","min":1,"max":"1","type":[{"code":"string"}],"mustSupport":true,"mapping":[{"identity":"servd","map":"./PrimaryAddress and ./OtherAddresses"}]},{"id":"Organization.telecom","path":"Organization.telecom","min":0,"max":"*","type":[{"code":"ContactPoint"}],"mustSupport":true},{"id":"Organization.address","path":"Organization.address","min":0,"max":"*","type":[{"code":"Address"}],"mustSupport":true,"mapping":[{"identity":"servd","map":"n/a"}]},{"id":"Organization.address.line","path":"Organization.address.line","min":0,"max":"4","type":[{"code":"string"}],"mustSupport":true},{"id":"Organization.address.city","path":"Organization.address.city","min":0,"max":"1","type":[{"code":"string"}],"mustSupport":true},{"id":"Organization.address.state","path":"Organization.address.state","min":0,"max":"1","type":[{"code":"string"}],"mustSupport":true,"binding":{"strength":"extensible","description":"Two letter USPS alphabetic codes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state"},"mapping":[{"identity":"servd","map":"./Sites"}]},{"id":"Organization.address.postalCode","path":"Organization.address.postalCode","short":"US Zip Codes","min":0,"max":"1","type":[{"code":"string"}],"mustSupport":true},{"id":"Organization.address.country","path":"Organization.address.country","min":0,"max":"1","type":[{"code":"string"}],"mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-patient.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-patient.json new file mode 100755 index 000000000..f6db73134 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-patient.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-patient","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Patient 0..*
    \".\"\".\"\".\" us-core-race S0..1(Complex)US Core Race Extension
    URL: http://hl7.org/fhir/us/core/StructureDefinition/us-core-race
    \".\"\".\"\".\" us-core-ethnicity S0..1(Complex)US Core ethnicity Extension
    URL: http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity
    \".\"\".\"\".\" us-core-birthsex S0..1codeExtension
    URL: http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex
    Binding: Birth Sex (required)
    \".\"\".\"\".\" identifier S1..*Identifier
    \".\"\".\"\".\"\".\" system S1..1uri
    \".\"\".\"\".\"\".\" value S1..1stringThe value that is unique within the system.
    \".\"\".\"\".\" name SI1..*HumanNameus-core-8: Patient.name.given or Patient.name.family or both SHALL be present
    \".\"\".\"\".\"\".\" family SI0..1string
    \".\"\".\"\".\"\".\" given SI0..*string
    \".\"\".\"\".\" telecom S0..*ContactPoint
    \".\"\".\"\".\"\".\" system S1..1codeBinding: ContactPointSystem (required)
    \".\"\".\"\".\"\".\" value S1..1string
    \".\"\".\"\".\"\".\" use S0..1codeBinding: ContactPointUse (required)
    \".\"\".\"\".\" gender S1..1codeBinding: AdministrativeGender (required)
    \".\"\".\"\".\" birthDate S0..1date
    \".\"\".\"\".\" address S0..*Address
    \".\"\".\"\".\"\".\" line S0..*string
    \".\"\".\"\".\"\".\" city S0..1string
    \".\"\".\"\".\"\".\" state S0..1stringBinding: USPS Two Letter Alphabetic Codes (extensible)
    \".\"\".\"\".\"\".\" postalCode S0..1stringUS Zip Codes
    \".\"\".\"\".\"\".\" period S0..1Period
    \".\"\".\"\".\" communication S0..*BackboneElement
    \".\"\".\"\".\"\".\" language S1..1CodeableConceptBinding: Language codes with language and optionally a region modifier (extensible)

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","version":"3.1.0","name":"USCorePatientProfile","title":"US Core Patient Profile","status":"active","experimental":false,"date":"2019-08-26T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the patient resource for the minimal set of data to query and retrieve patient demographic information.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"cda","uri":"http://hl7.org/v3/cda","name":"CDA (R2)"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"loinc","uri":"http://loinc.org","name":"LOINC code for the element"}],"kind":"resource","abstract":false,"type":"Patient","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Patient","derivation":"constraint","snapshot":{"element":[{"id":"Patient","path":"Patient","short":"Information about an individual or animal receiving health care services","definition":"The US Core Patient Profile is based upon the core FHIR Patient Resource and designed to meet the applicable patient demographic data elements from the 2015 Edition Common Clinical Data Set.","alias":["SubjectOfCare Client Resident"],"min":0,"max":"*","base":{"path":"Patient","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"rim","map":"Patient[classCode=PAT]"},{"identity":"cda","map":"ClinicalDocument.recordTarget.patientRole"},{"identity":"argonaut-dq-dstu2","map":"Patient"}]},{"id":"Patient.id","path":"Patient.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Patient.meta","path":"Patient.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Patient.implicitRules","path":"Patient.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Patient.language","path":"Patient.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Patient.text","path":"Patient.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Patient.contained","path":"Patient.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.extension","path":"Patient.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"ordered":false,"rules":"open"},"short":"Extension","definition":"An Extension","min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false},{"id":"Patient.extension:race","path":"Patient.extension","sliceName":"race","short":"US Core Race Extension","definition":"Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The race codes used to represent these concepts are based upon the [CDC Race and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 921 reference race. The race concepts are grouped by and pre-mapped to the 5 OMB race categories:\n\n - American Indian or Alaska Native\n - Asian\n - Black or African American\n - Native Hawaiian or Other Pacific Islander\n - White.","min":0,"max":"1","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"]}],"condition":["ele-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":true,"isModifier":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.extension"}]},{"id":"Patient.extension:ethnicity","path":"Patient.extension","sliceName":"ethnicity","short":"US Core ethnicity Extension","definition":"Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The ethnicity codes used to represent these concepts are based upon the [CDC ethnicity and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 43 reference ethnicity. The ethnicity concepts are grouped by and pre-mapped to the 2 OMB ethnicity categories: - Hispanic or Latino - Not Hispanic or Latino.","min":0,"max":"1","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"]}],"condition":["ele-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":true,"isModifier":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.extension"}]},{"id":"Patient.extension:birthsex","path":"Patient.extension","sliceName":"birthsex","short":"Extension","definition":"A code classifying the person's sex assigned at birth as specified by the [Office of the National Coordinator for Health IT (ONC)](https://www.healthit.gov/newsroom/about-onc).","comment":"The codes required are intended to present birth sex (i.e., the sex recorded on the patient’s birth certificate) and not gender identity or reassigned sex.","min":0,"max":"1","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension","profile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex"]}],"condition":["ele-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":true,"isModifier":false,"mapping":[{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"iso11179","map":".patient.administrativeGenderCode"},{"identity":"argonaut-dq-dstu2","map":"Patient.extension"}]},{"id":"Patient.modifierExtension","path":"Patient.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.identifier","path":"Patient.identifier","short":"An identifier for this patient","definition":"An identifier for this patient.","requirements":"Patients are almost always assigned specific numerical identifiers.","min":1,"max":"*","base":{"path":"Patient.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":"id"},{"identity":"cda","map":".id"},{"identity":"argonaut-dq-dstu2","map":"Patient.identifier"}]},{"id":"Patient.identifier.id","path":"Patient.identifier.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.identifier.extension","path":"Patient.identifier.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.identifier.use","path":"Patient.identifier.use","short":"usual | official | temp | secondary | old (If known)","definition":"The purpose of this identifier.","comment":"Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.","requirements":"Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.","min":0,"max":"1","base":{"path":"Identifier.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary id for a permanent one.","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"IdentifierUse"}],"strength":"required","description":"Identifies the purpose for this identifier, if known .","valueSet":"http://hl7.org/fhir/ValueSet/identifier-use|4.0.1"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"Role.code or implied by context"}]},{"id":"Patient.identifier.type","path":"Patient.identifier.type","short":"Description of identifier","definition":"A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.","comment":"This element deals only with general categories of identifiers. It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.","requirements":"Allows users to make use of identifiers when the identifier system is not known.","min":0,"max":"1","base":{"path":"Identifier.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"IdentifierType"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"extensible","description":"A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.","valueSet":"http://hl7.org/fhir/ValueSet/identifier-type"},"mapping":[{"identity":"v2","map":"CX.5"},{"identity":"rim","map":"Role.code or implied by context"}]},{"id":"Patient.identifier.system","path":"Patient.identifier.system","short":"The namespace for the identifier value","definition":"Establishes the namespace for the value - that is, a URL that describes a set values that are unique.","comment":"Identifier.system is always case sensitive.","requirements":"There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.","min":1,"max":"1","base":{"path":"Identifier.system","min":0,"max":"1"},"type":[{"code":"uri"}],"example":[{"label":"General","valueUri":"http://www.acme.com/identifiers/patient"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.4 / EI-2-4"},{"identity":"rim","map":"II.root or Role.id.root"},{"identity":"servd","map":"./IdentifierType"},{"identity":"argonaut-dq-dstu2","map":"Patient.identifier.system"}]},{"id":"Patient.identifier.value","path":"Patient.identifier.value","short":"The value that is unique within the system.","definition":"The portion of the identifier typically relevant to the user and which is unique within the context of the system.","comment":"If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the [Rendered Value extension](http://hl7.org/fhir/R4/extension-rendered-value.html). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe.","min":1,"max":"1","base":{"path":"Identifier.value","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"123456"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.1 / EI.1"},{"identity":"rim","map":"II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)"},{"identity":"servd","map":"./Value"},{"identity":"argonaut-dq-dstu2","map":"Patient.identifier.value"}]},{"id":"Patient.identifier.period","path":"Patient.identifier.period","short":"Time period when id is/was valid for use","definition":"Time period during which identifier is/was valid for use.","min":0,"max":"1","base":{"path":"Identifier.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.7 + CX.8"},{"identity":"rim","map":"Role.effectiveTime or implied by context"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Patient.identifier.assigner","path":"Patient.identifier.assigner","short":"Organization that issued id (may be just text)","definition":"Organization that issued/manages the identifier.","comment":"The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization.","min":0,"max":"1","base":{"path":"Identifier.assigner","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.4 / (CX.4,CX.9,CX.10)"},{"identity":"rim","map":"II.assigningAuthorityName but note that this is an improper use by the definition of the field. Also Role.scoper"},{"identity":"servd","map":"./IdentifierIssuingAuthority"}]},{"id":"Patient.active","path":"Patient.active","short":"Whether this patient's record is in active use","definition":"Whether this patient record is in active use. \nMany systems use this property to mark as non-current patients, such as those that have not been seen for a period of time based on an organization's business rules.\n\nIt is often used to filter patient lists to exclude inactive patients\n\nDeceased patients may also be marked as inactive for the same reasons, but may be active for some time after death.","comment":"If a record is inactive, and linked to an active record, then future patient/record updates should occur on the other patient.","requirements":"Need to be able to mark a patient record as not to be used because it was created in error.","min":0,"max":"1","base":{"path":"Patient.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that can indicate that a record should not be treated as valid","isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"statusCode"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.name","path":"Patient.name","short":"A name associated with the patient","definition":"A name associated with the individual.","comment":"A patient may have multiple names with different uses or applicable periods. For animals, the name is a \"HumanName\" in the sense that is assigned and used by humans and has the same patterns.","requirements":"Need to be able to track the patient by multiple names. Examples are your official name and a partner name.","min":1,"max":"*","base":{"path":"Patient.name","min":0,"max":"*"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"us-core-8","severity":"error","human":"Patient.name.given or Patient.name.family or both SHALL be present","expression":"family.exists() or given.exists()","xpath":"f:given or f:family"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-5, PID-9"},{"identity":"rim","map":"name"},{"identity":"cda","map":".patient.name"},{"identity":"argonaut-dq-dstu2","map":"Patient.name"}]},{"id":"Patient.name.id","path":"Patient.name.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.name.extension","path":"Patient.name.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.name.use","path":"Patient.name.use","short":"usual | official | temp | nickname | anonymous | old | maiden","definition":"Identifies the purpose for this name.","comment":"Applications can assume that a name is current unless it explicitly says that it is temporary or old.","requirements":"Allows the appropriate name for a particular context of use to be selected from among a set of names.","min":0,"max":"1","base":{"path":"HumanName.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old name etc.for a current/permanent one","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"NameUse"}],"strength":"required","description":"The use of a human name.","valueSet":"http://hl7.org/fhir/ValueSet/name-use|4.0.1"},"mapping":[{"identity":"v2","map":"XPN.7, but often indicated by which field contains the name"},{"identity":"rim","map":"unique(./use)"},{"identity":"servd","map":"./NamePurpose"}]},{"id":"Patient.name.text","path":"Patient.name.text","short":"Text representation of the full name","definition":"Specifies the entire name as it should be displayed e.g. on an application UI. This may be provided instead of or as well as the specific parts.","comment":"Can provide both a text representation and parts. Applications updating a name SHALL ensure that when both text and parts are present, no content is included in the text that isn't found in a part.","requirements":"A renderable, unencoded form.","min":0,"max":"1","base":{"path":"HumanName.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"implied by XPN.11"},{"identity":"rim","map":"./formatted"}]},{"id":"Patient.name.family","path":"Patient.name.family","short":"Family name (often called 'Surname')","definition":"The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.","comment":"Family Name may be decomposed into specific parts using extensions (de, nl, es related cultures).","alias":["surname"],"min":0,"max":"1","base":{"path":"HumanName.family","min":0,"max":"1"},"type":[{"code":"string"}],"condition":["us-core-8"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.1/FN.1"},{"identity":"rim","map":"./part[partType = FAM]"},{"identity":"servd","map":"./FamilyName"},{"identity":"argonaut-dq-dstu2","map":"Patient.name.family"}]},{"id":"Patient.name.given","path":"Patient.name.given","short":"Given names (not always 'first'). Includes middle names","definition":"Given name.","comment":"If only initials are recorded, they may be used in place of the full name parts. Initials may be separated into multiple given names but often aren't due to paractical limitations. This element is not called \"first name\" since given names do not always come first.","alias":["first name","middle name"],"min":0,"max":"*","base":{"path":"HumanName.given","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Given Names appear in the correct order for presenting the name","condition":["us-core-8"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.2 + XPN.3"},{"identity":"rim","map":"./part[partType = GIV]"},{"identity":"servd","map":"./GivenNames"},{"identity":"argonaut-dq-dstu2","map":"Patient.name.given"}]},{"id":"Patient.name.prefix","path":"Patient.name.prefix","short":"Parts that come before the name","definition":"Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.","min":0,"max":"*","base":{"path":"HumanName.prefix","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Prefixes appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.5"},{"identity":"rim","map":"./part[partType = PFX]"},{"identity":"servd","map":"./TitleCode"}]},{"id":"Patient.name.suffix","path":"Patient.name.suffix","short":"Parts that come after the name","definition":"Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.","min":0,"max":"*","base":{"path":"HumanName.suffix","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Suffixes appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN/4"},{"identity":"rim","map":"./part[partType = SFX]"}]},{"id":"Patient.name.period","path":"Patient.name.period","short":"Time period when name was/is in use","definition":"Indicates the period of time when this name was valid for the named person.","requirements":"Allows names to be placed in historical context.","min":0,"max":"1","base":{"path":"HumanName.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.13 + XPN.14"},{"identity":"rim","map":"./usablePeriod[type=\"IVL\"]"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Patient.telecom","path":"Patient.telecom","short":"A contact detail for the individual","definition":"A contact detail (e.g. a telephone number or an email address) by which the individual may be contacted.","comment":"A Patient may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently and also to help with identification. The address might not go directly to the individual, but may reach another party that is able to proxy for the patient (i.e. home phone, or pet owner's phone).","requirements":"People have (primary) ways to contact them in some way such as phone, email.","min":0,"max":"*","base":{"path":"Patient.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-13, PID-14, PID-40"},{"identity":"rim","map":"telecom"},{"identity":"cda","map":".telecom"},{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.telecom.id","path":"Patient.telecom.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.telecom.extension","path":"Patient.telecom.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.telecom.system","path":"Patient.telecom.system","short":"phone | fax | email | pager | url | sms | other","definition":"Telecommunications form for contact point - what communications system is required to make use of the contact.","min":1,"max":"1","base":{"path":"ContactPoint.system","min":0,"max":"1"},"type":[{"code":"code"}],"condition":["cpt-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"required","description":"Telecommunications form for contact point.","valueSet":"http://hl7.org/fhir/ValueSet/contact-point-system"},"mapping":[{"identity":"v2","map":"XTN.3"},{"identity":"rim","map":"./scheme"},{"identity":"servd","map":"./ContactPointType"},{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.telecom.value","path":"Patient.telecom.value","short":"The actual contact point details","definition":"The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).","comment":"Additional text data such as phone extension numbers, or notes about use of the contact are sometimes included in the value.","requirements":"Need to support legacy numbers that are not in a tightly controlled format.","min":1,"max":"1","base":{"path":"ContactPoint.value","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XTN.1 (or XTN.12)"},{"identity":"rim","map":"./url"},{"identity":"servd","map":"./Value"},{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.telecom.use","path":"Patient.telecom.use","short":"home | work | temp | old | mobile - purpose of this contact point","definition":"Identifies the purpose for the contact point.","comment":"Applications can assume that a contact is current unless it explicitly says that it is temporary or old.","requirements":"Need to track the way a person uses this contact, so a user can choose which is appropriate for their purpose.","min":0,"max":"1","base":{"path":"ContactPoint.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old contact etc.for a current/permanent one","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/contact-point-use"},"mapping":[{"identity":"v2","map":"XTN.2 - but often indicated by field"},{"identity":"rim","map":"unique(./use)"},{"identity":"servd","map":"./ContactPointPurpose"},{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.telecom.rank","path":"Patient.telecom.rank","short":"Specify preferred order of use (1 = highest)","definition":"Specifies a preferred order in which to use a set of contacts. ContactPoints with lower rank values are more preferred than those with higher rank values.","comment":"Note that rank does not necessarily follow the order in which the contacts are represented in the instance.","min":0,"max":"1","base":{"path":"ContactPoint.rank","min":0,"max":"1"},"type":[{"code":"positiveInt"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"n/a"},{"identity":"rim","map":"n/a"}]},{"id":"Patient.telecom.period","path":"Patient.telecom.period","short":"Time period when the contact point was/is in use","definition":"Time period when the contact point was/is in use.","min":0,"max":"1","base":{"path":"ContactPoint.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"./usablePeriod[type=\"IVL\"]"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Patient.gender","path":"Patient.gender","short":"male | female | other | unknown","definition":"Administrative Gender - the gender that the patient is considered to have for administration and record keeping purposes.","comment":"The gender might not match the biological sex as determined by genetics or the individual's preferred identification. Note that for both humans and particularly animals, there are other legitimate possibilities than male and female, though the vast majority of systems and contexts only support male and female. Systems providing decision support or enforcing business rules should ideally do this on the basis of Observations dealing with the specific sex or gender aspect of interest (anatomical, chromosomal, social, etc.) However, because these observations are infrequently recorded, defaulting to the administrative gender is common practice. Where such defaulting occurs, rule enforcement should allow for the variation between administrative and biological, chromosomal and other gender aspects. For example, an alert about a hysterectomy on a male should be handled as a warning or overridable error, not a \"hard\" error. See the Patient Gender and Sex section for additional information about communicating patient gender and sex.","requirements":"Needed for identification of the individual, in combination with (at least) name and birth date.","min":1,"max":"1","base":{"path":"Patient.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender"},"mapping":[{"identity":"v2","map":"PID-8"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"cda","map":".patient.administrativeGenderCode"},{"identity":"argonaut-dq-dstu2","map":"Patient.gender"}]},{"id":"Patient.birthDate","path":"Patient.birthDate","short":"The date of birth for the individual","definition":"The date of birth for the individual.","comment":"At least an estimated year should be provided as a guess if the real DOB is unknown There is a standard extension \"patient-birthTime\" available that should be used where Time is required (such as in maternity/infant care systems).","requirements":"Age of the individual drives many clinical processes.","min":0,"max":"1","base":{"path":"Patient.birthDate","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-7"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/birthTime"},{"identity":"cda","map":".patient.birthTime"},{"identity":"loinc","map":"21112-8"},{"identity":"argonaut-dq-dstu2","map":"Patient.birthDate"}]},{"id":"Patient.deceased[x]","path":"Patient.deceased[x]","short":"Indicates if the individual is deceased or not","definition":"Indicates if the individual is deceased or not.","comment":"If there's no value in the instance, it means there is no statement on whether or not the individual is deceased. Most systems will interpret the absence of a value as a sign of the person being alive.","requirements":"The fact that a patient is deceased influences the clinical process. Also, in human communication and relation management it is necessary to know whether the person is alive.","min":0,"max":"1","base":{"path":"Patient.deceased[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because once a patient is marked as deceased, the actions that are appropriate to perform on the patient may be significantly different.","isSummary":true,"mapping":[{"identity":"v2","map":"PID-30 (bool) and PID-29 (datetime)"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/deceasedTime"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.address","path":"Patient.address","short":"An address for the individual","definition":"An address for the individual.","comment":"Patient may have multiple addresses with different uses or applicable periods.","requirements":"May need to keep track of patient addresses for contacting, billing or reporting requirements and also to help with identification.","min":0,"max":"*","base":{"path":"Patient.address","min":0,"max":"*"},"type":[{"code":"Address"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-11"},{"identity":"rim","map":"addr"},{"identity":"cda","map":".addr"},{"identity":"argonaut-dq-dstu2","map":"Patient.birthDate"}]},{"id":"Patient.address.id","path":"Patient.address.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.address.extension","path":"Patient.address.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.address.use","path":"Patient.address.use","short":"home | work | temp | old | billing - purpose of this address","definition":"The purpose of this address.","comment":"Applications can assume that an address is current unless it explicitly says that it is temporary or old.","requirements":"Allows an appropriate address to be chosen from a list of many.","min":0,"max":"1","base":{"path":"Address.use","min":0,"max":"1"},"type":[{"code":"code"}],"example":[{"label":"General","valueCode":"home"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old address etc.for a current/permanent one","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AddressUse"}],"strength":"required","description":"The use of an address.","valueSet":"http://hl7.org/fhir/ValueSet/address-use|4.0.1"},"mapping":[{"identity":"v2","map":"XAD.7"},{"identity":"rim","map":"unique(./use)"},{"identity":"servd","map":"./AddressPurpose"}]},{"id":"Patient.address.type","path":"Patient.address.type","short":"postal | physical | both","definition":"Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of addresses). Most addresses are both.","comment":"The definition of Address states that \"address is intended to describe postal addresses, not physical locations\". However, many applications track whether an address has a dual purpose of being a location that can be visited as well as being a valid delivery destination, and Postal addresses are often used as proxies for physical locations (also see the [Location](http://hl7.org/fhir/R4/location.html#) resource).","min":0,"max":"1","base":{"path":"Address.type","min":0,"max":"1"},"type":[{"code":"code"}],"example":[{"label":"General","valueCode":"both"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AddressType"}],"strength":"required","description":"The type of an address (physical / postal).","valueSet":"http://hl7.org/fhir/ValueSet/address-type|4.0.1"},"mapping":[{"identity":"v2","map":"XAD.18"},{"identity":"rim","map":"unique(./use)"},{"identity":"vcard","map":"address type parameter"}]},{"id":"Patient.address.text","path":"Patient.address.text","short":"Text representation of the address","definition":"Specifies the entire address as it should be displayed e.g. on a postal label. This may be provided instead of or as well as the specific parts.","comment":"Can provide both a text representation and parts. Applications updating an address SHALL ensure that when both text and parts are present, no content is included in the text that isn't found in a part.","requirements":"A renderable, unencoded form.","min":0,"max":"1","base":{"path":"Address.text","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"137 Nowhere Street, Erewhon 9132"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.1 + XAD.2 + XAD.3 + XAD.4 + XAD.5 + XAD.6"},{"identity":"rim","map":"./formatted"},{"identity":"vcard","map":"address label parameter"}]},{"id":"Patient.address.line","path":"Patient.address.line","short":"Street name, number, direction & P.O. Box etc.","definition":"This component contains the house number, apartment number, street name, street direction, P.O. Box number, delivery hints, and similar address information.","min":0,"max":"*","base":{"path":"Address.line","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"The order in which lines should appear in an address label","example":[{"label":"General","valueString":"137 Nowhere Street"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.1 + XAD.2 (note: XAD.1 and XAD.2 have different meanings for a company address than for a person address)"},{"identity":"rim","map":"AD.part[parttype = AL]"},{"identity":"vcard","map":"street"},{"identity":"servd","map":"./StreetAddress (newline delimitted)"},{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.address.city","path":"Patient.address.city","short":"Name of city, town etc.","definition":"The name of the city, town, suburb, village or other community or delivery center.","alias":["Municpality"],"min":0,"max":"1","base":{"path":"Address.city","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"Erewhon"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.3"},{"identity":"rim","map":"AD.part[parttype = CTY]"},{"identity":"vcard","map":"locality"},{"identity":"servd","map":"./Jurisdiction"},{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.address.district","path":"Patient.address.district","short":"District name (aka county)","definition":"The name of the administrative area (county).","comment":"District is sometimes known as county, but in some regions 'county' is used in place of city (municipality), so county name should be conveyed in city instead.","alias":["County"],"min":0,"max":"1","base":{"path":"Address.district","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"Madison"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.9"},{"identity":"rim","map":"AD.part[parttype = CNT | CPA]"}]},{"id":"Patient.address.state","path":"Patient.address.state","short":"Sub-unit of country (abbreviations ok)","definition":"Sub-unit of a country with limited sovereignty in a federally organized country. A code may be used if codes are in common use (e.g. US 2 letter state codes).","alias":["Province","Territory"],"min":0,"max":"1","base":{"path":"Address.state","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Two Letter USPS alphabetic codes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state"},"mapping":[{"identity":"v2","map":"XAD.4"},{"identity":"rim","map":"AD.part[parttype = STA]"},{"identity":"vcard","map":"region"},{"identity":"servd","map":"./Region"},{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.address.postalCode","path":"Patient.address.postalCode","short":"US Zip Codes","definition":"A postal code designating a region defined by the postal service.","alias":["Zip","Zip Code"],"min":0,"max":"1","base":{"path":"Address.postalCode","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"9132"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.5"},{"identity":"rim","map":"AD.part[parttype = ZIP]"},{"identity":"vcard","map":"code"},{"identity":"servd","map":"./PostalIdentificationCode"},{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.address.country","path":"Patient.address.country","short":"Country (e.g. can be ISO 3166 2 or 3 letter code)","definition":"Country - a nation as commonly understood or generally accepted.","comment":"ISO 3166 3 letter codes can be used in place of a human readable country name.","min":0,"max":"1","base":{"path":"Address.country","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.6"},{"identity":"rim","map":"AD.part[parttype = CNT]"},{"identity":"vcard","map":"country"},{"identity":"servd","map":"./Country"}]},{"id":"Patient.address.period","path":"Patient.address.period","short":"Time period when address was/is in use","definition":"Time period when address was/is in use.","requirements":"Allows addresses to be placed in historical context.","min":0,"max":"1","base":{"path":"Address.period","min":0,"max":"1"},"type":[{"code":"Period"}],"example":[{"label":"General","valuePeriod":{"start":"2010-03-23T00:00:00+11:00","end":"2010-07-01T00:00:00+10:00"}}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XAD.12 / XAD.13 + XAD.14"},{"identity":"rim","map":"./usablePeriod[type=\"IVL\"]"},{"identity":"servd","map":"./StartDate and ./EndDate"},{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.maritalStatus","path":"Patient.maritalStatus","short":"Marital (civil) status of a patient","definition":"This field contains a patient's most recent marital (civil) status.","requirements":"Most, if not all systems capture it.","min":0,"max":"1","base":{"path":"Patient.maritalStatus","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"MaritalStatus"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"extensible","description":"The domestic partnership status of a person.","valueSet":"http://hl7.org/fhir/ValueSet/marital-status"},"mapping":[{"identity":"v2","map":"PID-16"},{"identity":"rim","map":"player[classCode=PSN]/maritalStatusCode"},{"identity":"cda","map":".patient.maritalStatusCode"}]},{"id":"Patient.multipleBirth[x]","path":"Patient.multipleBirth[x]","short":"Whether patient is part of a multiple birth","definition":"Indicates whether the patient is part of a multiple (boolean) or indicates the actual birth order (integer).","comment":"Where the valueInteger is provided, the number is the birth number in the sequence. E.g. The middle birth in triplets would be valueInteger=2 and the third born would have valueInteger=3 If a boolean value was provided for this triplets example, then all 3 patient records would have valueBoolean=true (the ordering is not indicated).","requirements":"For disambiguation of multiple-birth children, especially relevant where the care provider doesn't meet the patient, such as labs.","min":0,"max":"1","base":{"path":"Patient.multipleBirth[x]","min":0,"max":"1"},"type":[{"code":"boolean"},{"code":"integer"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-24 (bool), PID-25 (integer)"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/multipleBirthInd, player[classCode=PSN|ANM and determinerCode=INSTANCE]/multipleBirthOrderNumber"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.photo","path":"Patient.photo","short":"Image of the patient","definition":"Image of the patient.","comment":"Guidelines:\n* Use id photos, not clinical photos.\n* Limit dimensions to thumbnail.\n* Keep byte count low to ease resource updates.","requirements":"Many EHR systems have the capability to capture an image of the patient. Fits with newer social media usage too.","min":0,"max":"*","base":{"path":"Patient.photo","min":0,"max":"*"},"type":[{"code":"Attachment"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-5 - needs a profile"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/desc"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-explicit-type-name","valueString":"Contact"}],"path":"Patient.contact","short":"A contact party (e.g. guardian, partner, friend) for the patient","definition":"A contact party (e.g. guardian, partner, friend) for the patient.","comment":"Contact covers all kinds of contact parties: family members, business contacts, guardians, caregivers. Not applicable to register pedigree and family ties beyond use of having contact.","requirements":"Need to track people you can contact about the patient.","min":0,"max":"*","base":{"path":"Patient.contact","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"pat-1","severity":"error","human":"SHALL at least contain a contact's details or a reference to an organization","expression":"name.exists() or telecom.exists() or address.exists() or organization.exists()","xpath":"exists(f:name) or exists(f:telecom) or exists(f:address) or exists(f:organization)"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/scopedRole[classCode=CON]"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.id","path":"Patient.contact.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.contact.extension","path":"Patient.contact.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.contact.modifierExtension","path":"Patient.contact.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.contact.relationship","path":"Patient.contact.relationship","short":"The kind of relationship","definition":"The nature of the relationship between the patient and the contact person.","requirements":"Used to determine which contact person is the most relevant to approach, depending on circumstances.","min":0,"max":"*","base":{"path":"Patient.contact.relationship","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ContactRelationship"}],"strength":"extensible","description":"The nature of the relationship between a patient and a contact person for that patient.","valueSet":"http://hl7.org/fhir/ValueSet/patient-contactrelationship"},"mapping":[{"identity":"v2","map":"NK1-7, NK1-3"},{"identity":"rim","map":"code"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.name","path":"Patient.contact.name","short":"A name associated with the contact person","definition":"A name associated with the contact person.","requirements":"Contact persons need to be identified by name, but it is uncommon to need details about multiple other names for that contact person.","min":0,"max":"1","base":{"path":"Patient.contact.name","min":0,"max":"1"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-2"},{"identity":"rim","map":"name"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.telecom","path":"Patient.contact.telecom","short":"A contact detail for the person","definition":"A contact detail for the person, e.g. a telephone number or an email address.","comment":"Contact may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently, and also to help with identification.","requirements":"People have (primary) ways to contact them in some way such as phone, email.","min":0,"max":"*","base":{"path":"Patient.contact.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-5, NK1-6, NK1-40"},{"identity":"rim","map":"telecom"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.address","path":"Patient.contact.address","short":"Address for the contact person","definition":"Address for the contact person.","requirements":"Need to keep track where the contact person can be contacted per postal mail or visited.","min":0,"max":"1","base":{"path":"Patient.contact.address","min":0,"max":"1"},"type":[{"code":"Address"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-4"},{"identity":"rim","map":"addr"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.gender","path":"Patient.contact.gender","short":"male | female | other | unknown","definition":"Administrative Gender - the gender that the contact person is considered to have for administration and record keeping purposes.","requirements":"Needed to address the person correctly.","min":0,"max":"1","base":{"path":"Patient.contact.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdministrativeGender"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"required","description":"The gender of a person used for administrative purposes.","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender|4.0.1"},"mapping":[{"identity":"v2","map":"NK1-15"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/administrativeGender"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.organization","path":"Patient.contact.organization","short":"Organization that is associated with the contact","definition":"Organization on behalf of which the contact is acting or for which the contact is working.","requirements":"For guardians or business related contacts, the organization is relevant.","min":0,"max":"1","base":{"path":"Patient.contact.organization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"condition":["pat-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NK1-13, NK1-30, NK1-31, NK1-32, NK1-41"},{"identity":"rim","map":"scoper"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.contact.period","path":"Patient.contact.period","short":"The period during which this contact person or organization is valid to be contacted relating to this patient","definition":"The period during which this contact person or organization is valid to be contacted relating to this patient.","min":0,"max":"1","base":{"path":"Patient.contact.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"effectiveTime"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.communication","path":"Patient.communication","short":"A language which may be used to communicate with the patient about his or her health","definition":"A language which may be used to communicate with the patient about his or her health.","comment":"If no language is specified, this *implies* that the default local language is spoken. If you need to convey proficiency for multiple modes, then you need multiple Patient.Communication associations. For animals, language is not a relevant field, and should be absent from the instance. If the Patient does not speak the default local language, then the Interpreter Required Standard can be used to explicitly declare that an interpreter is required.","requirements":"If a patient does not speak the local language, interpreters may be required, so languages spoken and proficiency are important things to keep track of both for patient and other persons of interest.","min":0,"max":"*","base":{"path":"Patient.communication","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"LanguageCommunication"},{"identity":"cda","map":"patient.languageCommunication"},{"identity":"argonaut-dq-dstu2","map":"Patient.communication"}]},{"id":"Patient.communication.id","path":"Patient.communication.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.communication.extension","path":"Patient.communication.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.communication.modifierExtension","path":"Patient.communication.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.communication.language","path":"Patient.communication.language","short":"The language which can be used to communicate with the patient about his or her health","definition":"The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English.","comment":"The structure aa-BB with this exact casing is one the most widely used notations for locale. However not all systems actually code this but instead have it as free text. Hence CodeableConcept instead of code as the data type.","requirements":"Most systems in multilingual countries will want to convey language. Not all systems actually need the regional dialect.","min":1,"max":"1","base":{"path":"Patient.communication.language","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/simple-language"},"mapping":[{"identity":"v2","map":"PID-15, LAN-2"},{"identity":"rim","map":"player[classCode=PSN|ANM and determinerCode=INSTANCE]/languageCommunication/code"},{"identity":"cda","map":".languageCode"},{"identity":"argonaut-dq-dstu2","map":"Patient.communication.language"}]},{"id":"Patient.communication.preferred","path":"Patient.communication.preferred","short":"Language preference indicator","definition":"Indicates whether or not the patient prefers this language (over other languages he masters up a certain level).","comment":"This language is specifically identified for communicating healthcare information.","requirements":"People that master multiple languages up to certain level may prefer one or more, i.e. feel more confident in communicating in a particular language making other languages sort of a fall back method.","min":0,"max":"1","base":{"path":"Patient.communication.preferred","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PID-15"},{"identity":"rim","map":"preferenceInd"},{"identity":"cda","map":".preferenceInd"}]},{"id":"Patient.generalPractitioner","path":"Patient.generalPractitioner","short":"Patient's nominated primary care provider","definition":"Patient's nominated care provider.","comment":"This may be the primary care provider (in a GP context), or it may be a patient nominated care manager in a community/disability setting, or even organization that will provide people to perform the care provider roles. It is not to be used to record Care Teams, these should be in a CareTeam resource that may be linked to the CarePlan or EpisodeOfCare resources.\nMultiple GPs may be recorded against the patient for various reasons, such as a student that has his home GP listed along with the GP at university during the school semesters, or a \"fly-in/fly-out\" worker that has the onsite GP also included with his home GP to remain aware of medical issues.\n\nJurisdictions may decide that they can profile this down to 1 if desired, or 1 per type.","alias":["careProvider"],"min":0,"max":"*","base":{"path":"Patient.generalPractitioner","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"PD1-4"},{"identity":"rim","map":"subjectOf.CareEvent.performer.AssignedEntity"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.managingOrganization","path":"Patient.managingOrganization","short":"Organization that is the custodian of the patient record","definition":"Organization that is the custodian of the patient record.","comment":"There is only one managing organization for a specific patient record. Other organizations will have their own Patient record, and may use the Link property to join the records together (or a Person resource which can include confidence ratings for the association).","requirements":"Need to know who recognizes this patient record, manages and updates it.","min":0,"max":"1","base":{"path":"Patient.managingOrganization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"scoper"},{"identity":"cda","map":".providerOrganization"}]},{"id":"Patient.link","path":"Patient.link","short":"Link to another patient resource that concerns the same actual person","definition":"Link to another patient resource that concerns the same actual patient.","comment":"There is no assumption that linked patient records have mutual links.","requirements":"There are multiple use cases: \n\n* Duplicate patient records due to the clerical errors associated with the difficulties of identifying humans consistently, and \n* Distribution of patient information across multiple servers.","min":0,"max":"*","base":{"path":"Patient.link","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it might not be the main Patient resource, and the referenced patient should be used instead of this Patient record. This is when the link.type value is 'replaced-by'","isSummary":true,"mapping":[{"identity":"rim","map":"outboundLink"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.link.id","path":"Patient.link.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.link.extension","path":"Patient.link.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Patient.link.modifierExtension","path":"Patient.link.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Patient.link.other","path":"Patient.link.other","short":"The other patient or related person resource that the link refers to","definition":"The other patient resource that the link refers to.","comment":"Referencing a RelatedPerson here removes the need to use a Person record to associate a Patient and RelatedPerson as the same individual.","min":1,"max":"1","base":{"path":"Patient.link.other","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-hierarchy","valueBoolean":false}],"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PID-3, MRG-1"},{"identity":"rim","map":"id"},{"identity":"cda","map":"n/a"}]},{"id":"Patient.link.type","path":"Patient.link.type","short":"replaced-by | replaces | refer | seealso","definition":"The type of link between this patient resource and another patient resource.","min":1,"max":"1","base":{"path":"Patient.link.type","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"LinkType"}],"strength":"required","description":"The type of link between this patient resource and another patient resource.","valueSet":"http://hl7.org/fhir/ValueSet/link-type|4.0.1"},"mapping":[{"identity":"rim","map":"typeCode"},{"identity":"cda","map":"n/a"}]}]},"differential":{"element":[{"id":"Patient","path":"Patient","definition":"The US Core Patient Profile is based upon the core FHIR Patient Resource and designed to meet the applicable patient demographic data elements from the 2015 Edition Common Clinical Data Set.","mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient"}]},{"id":"Patient.extension:race","path":"Patient.extension","sliceName":"race","min":0,"max":"1","type":[{"code":"Extension","profile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.extension"}]},{"id":"Patient.extension:ethnicity","path":"Patient.extension","sliceName":"ethnicity","min":0,"max":"1","type":[{"code":"Extension","profile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.extension"}]},{"id":"Patient.extension:birthsex","path":"Patient.extension","sliceName":"birthsex","min":0,"max":"1","type":[{"code":"Extension","profile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex"]}],"mustSupport":true,"binding":{"strength":"required","description":"Code for sex assigned at birth","valueSet":"http://hl7.org/fhir/us/core/ValueSet/birthsex"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.extension"}]},{"id":"Patient.identifier","path":"Patient.identifier","min":1,"max":"*","type":[{"code":"Identifier"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.identifier"}]},{"id":"Patient.identifier.system","path":"Patient.identifier.system","min":1,"max":"1","type":[{"code":"uri"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.identifier.system"}]},{"id":"Patient.identifier.value","path":"Patient.identifier.value","short":"The value that is unique within the system.","min":1,"max":"1","type":[{"code":"string"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.identifier.value"}]},{"id":"Patient.name","path":"Patient.name","min":1,"max":"*","type":[{"code":"HumanName"}],"constraint":[{"key":"us-core-8","severity":"error","human":"Patient.name.given or Patient.name.family or both SHALL be present","expression":"family.exists() or given.exists()","xpath":"f:given or f:family"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.name"}]},{"id":"Patient.name.family","path":"Patient.name.family","min":0,"max":"1","type":[{"code":"string"}],"condition":["us-core-8"],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.name.family"}]},{"id":"Patient.name.given","path":"Patient.name.given","min":0,"max":"*","type":[{"code":"string"}],"condition":["us-core-8"],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.name.given"}]},{"id":"Patient.telecom","path":"Patient.telecom","min":0,"max":"*","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.telecom.system","path":"Patient.telecom.system","min":1,"max":"1","mustSupport":true,"binding":{"strength":"required","description":"Telecommunications form for contact point.","valueSet":"http://hl7.org/fhir/ValueSet/contact-point-system"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.telecom.value","path":"Patient.telecom.value","min":1,"max":"1","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.telecom.use","path":"Patient.telecom.use","min":0,"max":"1","mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/contact-point-use"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.gender","path":"Patient.gender","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.gender"}]},{"id":"Patient.birthDate","path":"Patient.birthDate","min":0,"max":"1","type":[{"code":"date"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.birthDate"}]},{"id":"Patient.address","path":"Patient.address","min":0,"max":"*","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.birthDate"}]},{"id":"Patient.address.line","path":"Patient.address.line","min":0,"max":"*","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.address.city","path":"Patient.address.city","min":0,"max":"1","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.address.state","path":"Patient.address.state","min":0,"max":"1","mustSupport":true,"binding":{"strength":"extensible","description":"Two Letter USPS alphabetic codes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.address.postalCode","path":"Patient.address.postalCode","short":"US Zip Codes","alias":["Zip Code"],"min":0,"max":"1","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.address.period","path":"Patient.address.period","min":0,"max":"1","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"NA"}]},{"id":"Patient.communication","path":"Patient.communication","min":0,"max":"*","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.communication"}]},{"id":"Patient.communication.language","path":"Patient.communication.language","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/simple-language"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Patient.communication.language"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-practitioner.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-practitioner.json new file mode 100755 index 000000000..6d546b040 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-practitioner.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-practitioner","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Practitioner 0..*
    \".\"\".\"\".\" identifier S1..*(Slice Definition)Slice: Unordered, Open by pattern:$this
    \".\"\".\"\".\"\".\" identifier:All Slices Content/Rules for all slices
    \".\"\".\"\".\"\".\"\".\" system S1..1uri
    \".\"\".\"\".\"\".\"\".\" value S1..1string
    \".\"\".\"\".\"\".\" identifier:NPI S0..1IdentifierRequired Pattern: At least the following
    \".\"\".\"\".\"\".\"\".\" system1..1uriThe namespace for the identifier value
    Fixed Value: http://hl7.org/fhir/sid/us-npi
    \".\"\".\"\".\" name S1..*HumanName
    \".\"\".\"\".\"\".\" family S1..1string

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","version":"3.1.0","name":"USCorePractitionerProfile","title":"US Core Practitioner Profile","status":"active","experimental":false,"date":"2019-09-02T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"The practitioner(s) referenced in US Core profiles.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"}],"kind":"resource","abstract":false,"type":"Practitioner","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Practitioner","derivation":"constraint","snapshot":{"element":[{"id":"Practitioner","path":"Practitioner","short":"A person with a formal responsibility in the provisioning of healthcare or related services","definition":"This is basic constraint on provider for use in US Core resources.","alias":["Provider"],"min":0,"max":"*","base":{"path":"Practitioner","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"v2","map":"PRD (as one example)"},{"identity":"rim","map":"Role"},{"identity":"servd","map":"Provider"}]},{"id":"Practitioner.id","path":"Practitioner.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Practitioner.meta","path":"Practitioner.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Practitioner.implicitRules","path":"Practitioner.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Practitioner.language","path":"Practitioner.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Practitioner.text","path":"Practitioner.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Practitioner.contained","path":"Practitioner.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.extension","path":"Practitioner.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.modifierExtension","path":"Practitioner.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.identifier","path":"Practitioner.identifier","slicing":{"discriminator":[{"type":"pattern","path":"$this"}],"rules":"open"},"short":"An identifier for the person as this agent","definition":"An identifier that applies to this person in this role.","comment":"NPI must be supported as the identifier system in the US, Tax id is allowed, Local id is allowed in addition to an another identifier supplied by a jurisdictional authority such as a practitioner's *Drug Enforcement Administration (DEA)* number.","requirements":"Often, specific identities are assigned for the agent.","min":1,"max":"*","base":{"path":"Practitioner.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PRD-7 (or XCN.1)"},{"identity":"rim","map":"./id"},{"identity":"servd","map":"./Identifiers"}]},{"id":"Practitioner.identifier.id","path":"Practitioner.identifier.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.identifier.extension","path":"Practitioner.identifier.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.identifier.use","path":"Practitioner.identifier.use","short":"usual | official | temp | secondary | old (If known)","definition":"The purpose of this identifier.","comment":"Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.","requirements":"Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.","min":0,"max":"1","base":{"path":"Identifier.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary id for a permanent one.","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"IdentifierUse"}],"strength":"required","description":"Identifies the purpose for this identifier, if known .","valueSet":"http://hl7.org/fhir/ValueSet/identifier-use|4.0.1"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"Role.code or implied by context"}]},{"id":"Practitioner.identifier.type","path":"Practitioner.identifier.type","short":"Description of identifier","definition":"A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.","comment":"This element deals only with general categories of identifiers. It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.","requirements":"Allows users to make use of identifiers when the identifier system is not known.","min":0,"max":"1","base":{"path":"Identifier.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"IdentifierType"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"extensible","description":"A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.","valueSet":"http://hl7.org/fhir/ValueSet/identifier-type"},"mapping":[{"identity":"v2","map":"CX.5"},{"identity":"rim","map":"Role.code or implied by context"}]},{"id":"Practitioner.identifier.system","path":"Practitioner.identifier.system","short":"The namespace for the identifier value","definition":"Establishes the namespace for the value - that is, a URL that describes a set values that are unique.","comment":"Identifier.system is always case sensitive.","requirements":"There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.","min":1,"max":"1","base":{"path":"Identifier.system","min":0,"max":"1"},"type":[{"code":"uri"}],"example":[{"label":"General","valueUri":"http://www.acme.com/identifiers/patient"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.4 / EI-2-4"},{"identity":"rim","map":"II.root or Role.id.root"},{"identity":"servd","map":"./IdentifierType"}]},{"id":"Practitioner.identifier.value","path":"Practitioner.identifier.value","short":"The value that is unique","definition":"The portion of the identifier typically relevant to the user and which is unique within the context of the system.","comment":"If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the [Rendered Value extension](http://hl7.org/fhir/R4/extension-rendered-value.html). Identifier.value is to be treated as case sensitive unless knowledge of the Identifier.system allows the processer to be confident that non-case-sensitive processing is safe.","min":1,"max":"1","base":{"path":"Identifier.value","min":0,"max":"1"},"type":[{"code":"string"}],"example":[{"label":"General","valueString":"123456"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.1 / EI.1"},{"identity":"rim","map":"II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)"},{"identity":"servd","map":"./Value"}]},{"id":"Practitioner.identifier.period","path":"Practitioner.identifier.period","short":"Time period when id is/was valid for use","definition":"Time period during which identifier is/was valid for use.","min":0,"max":"1","base":{"path":"Identifier.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.7 + CX.8"},{"identity":"rim","map":"Role.effectiveTime or implied by context"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Practitioner.identifier.assigner","path":"Practitioner.identifier.assigner","short":"Organization that issued id (may be just text)","definition":"Organization that issued/manages the identifier.","comment":"The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization.","min":0,"max":"1","base":{"path":"Identifier.assigner","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"CX.4 / (CX.4,CX.9,CX.10)"},{"identity":"rim","map":"II.assigningAuthorityName but note that this is an improper use by the definition of the field. Also Role.scoper"},{"identity":"servd","map":"./IdentifierIssuingAuthority"}]},{"id":"Practitioner.identifier:NPI","path":"Practitioner.identifier","sliceName":"NPI","short":"An identifier for the person as this agent","definition":"An identifier that applies to this person in this role.","requirements":"Often, specific identities are assigned for the agent.","min":0,"max":"1","base":{"path":"Practitioner.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"patternIdentifier":{"system":"http://hl7.org/fhir/sid/us-npi"},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PRD-7 (or XCN.1)"},{"identity":"rim","map":"./id"},{"identity":"servd","map":"./Identifiers"}]},{"id":"Practitioner.active","path":"Practitioner.active","short":"Whether this practitioner's record is in active use","definition":"Whether this practitioner's record is in active use.","comment":"If the practitioner is not in use by one organization, then it should mark the period on the PractitonerRole with an end date (even if they are active) as they may be active in another role.","requirements":"Need to be able to mark a practitioner record as not to be used because it was created in error.","min":0,"max":"1","base":{"path":"Practitioner.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"./statusCode"}]},{"id":"Practitioner.name","path":"Practitioner.name","short":"The name(s) associated with the practitioner","definition":"The name(s) associated with the practitioner.","comment":"The selection of the use property should ensure that there is a single usual name specified, and others use the nickname (alias), old, or other values as appropriate. \r\rIn general, select the value to be used in the ResourceReference.display based on this:\r\r1. There is more than 1 name\r2. Use = usual\r3. Period is current to the date of the usage\r4. Use = official\r5. Other order as decided by internal business rules.","requirements":"The name(s) that a Practitioner is known by. Where there are multiple, the name that the practitioner is usually known as should be used in the display.","min":1,"max":"*","base":{"path":"Practitioner.name","min":0,"max":"*"},"type":[{"code":"HumanName"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XCN Components"},{"identity":"rim","map":"./name"},{"identity":"servd","map":"./PreferredName (GivenNames, FamilyName, TitleCode)"}]},{"id":"Practitioner.name.id","path":"Practitioner.name.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.name.extension","path":"Practitioner.name.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.name.use","path":"Practitioner.name.use","short":"usual | official | temp | nickname | anonymous | old | maiden","definition":"Identifies the purpose for this name.","comment":"Applications can assume that a name is current unless it explicitly says that it is temporary or old.","requirements":"Allows the appropriate name for a particular context of use to be selected from among a set of names.","min":0,"max":"1","base":{"path":"HumanName.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old name etc.for a current/permanent one","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"NameUse"}],"strength":"required","description":"The use of a human name.","valueSet":"http://hl7.org/fhir/ValueSet/name-use|4.0.1"},"mapping":[{"identity":"v2","map":"XPN.7, but often indicated by which field contains the name"},{"identity":"rim","map":"unique(./use)"},{"identity":"servd","map":"./NamePurpose"}]},{"id":"Practitioner.name.text","path":"Practitioner.name.text","short":"Text representation of the full name","definition":"Specifies the entire name as it should be displayed e.g. on an application UI. This may be provided instead of or as well as the specific parts.","comment":"Can provide both a text representation and parts. Applications updating a name SHALL ensure that when both text and parts are present, no content is included in the text that isn't found in a part.","requirements":"A renderable, unencoded form.","min":0,"max":"1","base":{"path":"HumanName.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"implied by XPN.11"},{"identity":"rim","map":"./formatted"}]},{"id":"Practitioner.name.family","path":"Practitioner.name.family","short":"Family name (often called 'Surname')","definition":"The part of a name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.","comment":"Family Name may be decomposed into specific parts using extensions (de, nl, es related cultures).","alias":["surname"],"min":1,"max":"1","base":{"path":"HumanName.family","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.1/FN.1"},{"identity":"rim","map":"./part[partType = FAM]"},{"identity":"servd","map":"./FamilyName"}]},{"id":"Practitioner.name.given","path":"Practitioner.name.given","short":"Given names (not always 'first'). Includes middle names","definition":"Given name.","comment":"If only initials are recorded, they may be used in place of the full name parts. Initials may be separated into multiple given names but often aren't due to paractical limitations. This element is not called \"first name\" since given names do not always come first.","alias":["first name","middle name"],"min":0,"max":"*","base":{"path":"HumanName.given","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Given Names appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.2 + XPN.3"},{"identity":"rim","map":"./part[partType = GIV]"},{"identity":"servd","map":"./GivenNames"}]},{"id":"Practitioner.name.prefix","path":"Practitioner.name.prefix","short":"Parts that come before the name","definition":"Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the start of the name.","min":0,"max":"*","base":{"path":"HumanName.prefix","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Prefixes appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.5"},{"identity":"rim","map":"./part[partType = PFX]"},{"identity":"servd","map":"./TitleCode"}]},{"id":"Practitioner.name.suffix","path":"Practitioner.name.suffix","short":"Parts that come after the name","definition":"Part of the name that is acquired as a title due to academic, legal, employment or nobility status, etc. and that appears at the end of the name.","min":0,"max":"*","base":{"path":"HumanName.suffix","min":0,"max":"*"},"type":[{"code":"string"}],"orderMeaning":"Suffixes appear in the correct order for presenting the name","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN/4"},{"identity":"rim","map":"./part[partType = SFX]"}]},{"id":"Practitioner.name.period","path":"Practitioner.name.period","short":"Time period when name was/is in use","definition":"Indicates the period of time when this name was valid for the named person.","requirements":"Allows names to be placed in historical context.","min":0,"max":"1","base":{"path":"HumanName.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XPN.13 + XPN.14"},{"identity":"rim","map":"./usablePeriod[type=\"IVL\"]"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"Practitioner.telecom","path":"Practitioner.telecom","short":"A contact detail for the practitioner (that apply to all roles)","definition":"A contact detail for the practitioner, e.g. a telephone number or an email address.","comment":"Person may have multiple ways to be contacted with different uses or applicable periods. May need to have options for contacting the person urgently and to help with identification. These typically will have home numbers, or mobile numbers that are not role specific.","requirements":"Need to know how to reach a practitioner independent to any roles the practitioner may have.","min":0,"max":"*","base":{"path":"Practitioner.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"PRT-15, STF-10, ROL-12"},{"identity":"rim","map":"./telecom"},{"identity":"servd","map":"./ContactPoints"}]},{"id":"Practitioner.address","path":"Practitioner.address","short":"Address(es) of the practitioner that are not role specific (typically home address)","definition":"Address(es) of the practitioner that are not role specific (typically home address). \rWork addresses are not typically entered in this property as they are usually role dependent.","comment":"The PractitionerRole does not have an address value on it, as it is expected that the location property be used for this purpose (which has an address).","requirements":"The home/mailing address of the practitioner is often required for employee administration purposes, and also for some rostering services where the start point (practitioners home) can be used in calculations.","min":0,"max":"*","base":{"path":"Practitioner.address","min":0,"max":"*"},"type":[{"code":"Address"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"ORC-24, STF-11, ROL-11, PRT-14"},{"identity":"rim","map":"./addr"},{"identity":"servd","map":"./Addresses"}]},{"id":"Practitioner.gender","path":"Practitioner.gender","short":"male | female | other | unknown","definition":"Administrative Gender - the gender that the person is considered to have for administration and record keeping purposes.","requirements":"Needed to address the person correctly.","min":0,"max":"1","base":{"path":"Practitioner.gender","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"AdministrativeGender"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"required","description":"The gender of a person used for administrative purposes.","valueSet":"http://hl7.org/fhir/ValueSet/administrative-gender|4.0.1"},"mapping":[{"identity":"v2","map":"STF-5"},{"identity":"rim","map":"./administrativeGender"},{"identity":"servd","map":"./GenderCode"}]},{"id":"Practitioner.birthDate","path":"Practitioner.birthDate","short":"The date on which the practitioner was born","definition":"The date of birth for the practitioner.","requirements":"Needed for identification.","min":0,"max":"1","base":{"path":"Practitioner.birthDate","min":0,"max":"1"},"type":[{"code":"date"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"STF-6"},{"identity":"rim","map":"./birthTime"},{"identity":"servd","map":"(not represented in ServD)"}]},{"id":"Practitioner.photo","path":"Practitioner.photo","short":"Image of the person","definition":"Image of the person.","requirements":"Many EHR systems have the capability to capture an image of patients and personnel. Fits with newer social media usage too.","min":0,"max":"*","base":{"path":"Practitioner.photo","min":0,"max":"*"},"type":[{"code":"Attachment"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"./subjectOf/ObservationEvent[code=\"photo\"]/value"},{"identity":"servd","map":"./ImageURI (only supports the URI reference)"}]},{"id":"Practitioner.qualification","path":"Practitioner.qualification","short":"Certification, licenses, or training pertaining to the provision of care","definition":"The official certifications, training, and licenses that authorize or otherwise pertain to the provision of care by the practitioner. For example, a medical license issued by a medical board authorizing the practitioner to practice medicine within a certian locality.","min":0,"max":"*","base":{"path":"Practitioner.qualification","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"CER?"},{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].code"},{"identity":"servd","map":"./Qualifications"}]},{"id":"Practitioner.qualification.id","path":"Practitioner.qualification.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.qualification.extension","path":"Practitioner.qualification.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Practitioner.qualification.modifierExtension","path":"Practitioner.qualification.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Practitioner.qualification.identifier","path":"Practitioner.qualification.identifier","short":"An identifier for this qualification for the practitioner","definition":"An identifier that applies to this person's qualification in this role.","requirements":"Often, specific identities are assigned for the qualification.","min":0,"max":"*","base":{"path":"Practitioner.qualification.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].id"}]},{"id":"Practitioner.qualification.code","path":"Practitioner.qualification.code","short":"Coded representation of the qualification","definition":"Coded representation of the qualification.","min":1,"max":"1","base":{"path":"Practitioner.qualification.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Qualification"}],"strength":"example","description":"Specific qualification the practitioner has to provide a service.","valueSet":"http://terminology.hl7.org/ValueSet/v2-2.7-0360"},"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].code"},{"identity":"servd","map":"./Qualifications.Value"}]},{"id":"Practitioner.qualification.period","path":"Practitioner.qualification.period","short":"Period during which the qualification is valid","definition":"Period during which the qualification is valid.","requirements":"Qualifications are often for a limited period of time, and can be revoked.","min":0,"max":"1","base":{"path":"Practitioner.qualification.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].effectiveTime"},{"identity":"servd","map":"./Qualifications.StartDate and ./Qualifications.EndDate"}]},{"id":"Practitioner.qualification.issuer","path":"Practitioner.qualification.issuer","short":"Organization that regulates and issues the qualification","definition":"Organization that regulates and issues the qualification.","min":0,"max":"1","base":{"path":"Practitioner.qualification.issuer","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".playingEntity.playingRole[classCode=QUAL].scoper"}]},{"id":"Practitioner.communication","path":"Practitioner.communication","short":"A language the practitioner can use in patient communication","definition":"A language the practitioner can use in patient communication.","comment":"The structure aa-BB with this exact casing is one the most widely used notations for locale. However not all systems code this but instead have it as free text. Hence CodeableConcept instead of code as the data type.","requirements":"Knowing which language a practitioner speaks can help in facilitating communication with patients.","min":0,"max":"*","base":{"path":"Practitioner.communication","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"},"mapping":[{"identity":"v2","map":"PID-15, NK1-20, LAN-2"},{"identity":"rim","map":"./languageCommunication"},{"identity":"servd","map":"./Languages.LanguageSpokenCode"}]}]},"differential":{"element":[{"id":"Practitioner","path":"Practitioner","definition":"This is basic constraint on provider for use in US Core resources.","alias":["Provider"],"mustSupport":false},{"id":"Practitioner.identifier","path":"Practitioner.identifier","slicing":{"discriminator":[{"type":"pattern","path":"$this"}],"rules":"open"},"comment":"NPI must be supported as the identifier system in the US, Tax id is allowed, Local id is allowed in addition to an another identifier supplied by a jurisdictional authority such as a practitioner's *Drug Enforcement Administration (DEA)* number.","min":1,"max":"*","type":[{"code":"Identifier"}],"mustSupport":true},{"id":"Practitioner.identifier.system","path":"Practitioner.identifier.system","min":1,"max":"1","type":[{"code":"uri"}],"mustSupport":true},{"id":"Practitioner.identifier.value","path":"Practitioner.identifier.value","min":1,"max":"1","type":[{"code":"string"}],"mustSupport":true},{"id":"Practitioner.identifier:NPI","path":"Practitioner.identifier","sliceName":"NPI","min":0,"max":"1","type":[{"code":"Identifier"}],"patternIdentifier":{"system":"http://hl7.org/fhir/sid/us-npi"},"mustSupport":true},{"id":"Practitioner.name","path":"Practitioner.name","min":1,"max":"*","type":[{"code":"HumanName"}],"mustSupport":true},{"id":"Practitioner.name.family","path":"Practitioner.name.family","min":1,"max":"1","type":[{"code":"string"}],"mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-practitionerrole.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-practitionerrole.json new file mode 100755 index 000000000..744d39961 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-practitionerrole.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-practitionerrole","text":{"status":"generated","div":""},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole","version":"3.1.0","name":"USCorePractitionerRoleProfile","title":"US Core PractitionerRole Profile","status":"active","experimental":false,"date":"2019-08-11T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"The practitioner roles referenced in the US Core profiles.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"servd","uri":"http://www.omg.org/spec/ServD/1.0/","name":"ServD"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"}],"kind":"resource","abstract":false,"type":"PractitionerRole","baseDefinition":"http://hl7.org/fhir/StructureDefinition/PractitionerRole","derivation":"constraint","snapshot":{"element":[{"id":"PractitionerRole","path":"PractitionerRole","short":"Roles/organizations the practitioner is associated with","definition":"This is basic constraint on PractitionerRole for use in US Core resources.","min":0,"max":"*","base":{"path":"PractitionerRole","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"pd-1","severity":"error","human":"SHALL have contact information or a reference to an Endpoint","expression":"telecom or endpoint","xpath":"exists(f:telecom) or exists(f:endpoint)"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"v2","map":"PRD (as one example)"},{"identity":"rim","map":"Role"},{"identity":"servd","map":"ServiceSiteProvider"}]},{"id":"PractitionerRole.id","path":"PractitionerRole.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"PractitionerRole.meta","path":"PractitionerRole.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"PractitionerRole.implicitRules","path":"PractitionerRole.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"PractitionerRole.language","path":"PractitionerRole.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"PractitionerRole.text","path":"PractitionerRole.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"PractitionerRole.contained","path":"PractitionerRole.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.extension","path":"PractitionerRole.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.modifierExtension","path":"PractitionerRole.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.identifier","path":"PractitionerRole.identifier","short":"Business Identifiers that are specific to a role/location","definition":"Business Identifiers that are specific to a role/location.","requirements":"Often, specific identities are assigned for the agent.","min":0,"max":"*","base":{"path":"PractitionerRole.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"PRD-7 (or XCN.1)"},{"identity":"rim","map":".id"},{"identity":"servd","map":"./Identifiers"}]},{"id":"PractitionerRole.active","path":"PractitionerRole.active","short":"Whether this practitioner role record is in active use","definition":"Whether this practitioner role record is in active use.","comment":"If this value is false, you may refer to the period to see when the role was in active use. If there is no period specified, no inference can be made about when it was active.","requirements":"Need to be able to mark a practitioner role record as not to be used because it was created in error, or otherwise no longer in active use.","min":0,"max":"1","base":{"path":"PractitionerRole.active","min":0,"max":"1"},"type":[{"code":"boolean"}],"meaningWhenMissing":"This resource is generally assumed to be active if no value is provided for the active element","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.status"},{"identity":"v2","map":"STF-7"},{"identity":"rim","map":".statusCode"}]},{"id":"PractitionerRole.period","path":"PractitionerRole.period","short":"The period during which the practitioner is authorized to perform in these role(s)","definition":"The period during which the person is authorized to act as a practitioner in these role(s) for the organization.","requirements":"Even after the agencies is revoked, the fact that it existed must still be recorded.","min":0,"max":"1","base":{"path":"PractitionerRole.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"PRD-8/9 / PRA-5.4"},{"identity":"rim","map":".performance[@typeCode <= 'PPRF'].ActDefinitionOrEvent.effectiveTime"},{"identity":"servd","map":"(ServD maps Practitioners and Organizations via another entity, so this concept is not available)"}]},{"id":"PractitionerRole.practitioner","path":"PractitionerRole.practitioner","short":"Practitioner that is able to provide the defined services for the organization","definition":"Practitioner that is able to provide the defined services for the organization.","min":1,"max":"1","base":{"path":"PractitionerRole.practitioner","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".player"}]},{"id":"PractitionerRole.organization","path":"PractitionerRole.organization","short":"Organization where the roles are available","definition":"The organization where the Practitioner performs the roles associated.","min":1,"max":"1","base":{"path":"PractitionerRole.organization","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".scoper"}]},{"id":"PractitionerRole.code","path":"PractitionerRole.code","short":"Roles which this practitioner may perform","definition":"Roles which this practitioner is authorized to perform for the organization.","comment":"A person may have more than one role.","requirements":"Need to know what authority the practitioner has - what can they do?","min":0,"max":"*","base":{"path":"PractitionerRole.code","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Provider role codes consisting of NUCC Health Care Provider Taxonomy Code Set for providers.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-provider-role"},"mapping":[{"identity":"v2","map":"PRD-1 / STF-18 / PRA-3 / PRT-4 / ROL-3 / ORC-12 / OBR-16 / PV1-7 / PV1-8 / PV1-9 / PV1-17"},{"identity":"rim","map":".code"},{"identity":"servd","map":"(ServD maps Practitioners and Organizations via another entity, so this concept is not available)"}]},{"id":"PractitionerRole.specialty","path":"PractitionerRole.specialty","short":"Specific specialty of the practitioner","definition":"Specific specialty of the practitioner.","min":0,"max":"*","base":{"path":"PractitionerRole.specialty","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Provider specialty codes consist of NUCC Health Care Provider Taxonomy Code Set for providers.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-provider-specialty"},"mapping":[{"identity":"v2","map":"PRA-5"},{"identity":"rim","map":".player.HealthCareProvider[@classCode = 'PROV'].code"},{"identity":"servd","map":"./Specialty"}]},{"id":"PractitionerRole.location","path":"PractitionerRole.location","short":"The location(s) at which this practitioner provides care","definition":"The location(s) at which this practitioner provides care.","min":0,"max":"*","base":{"path":"PractitionerRole.location","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.where[x]"},{"identity":"rim","map":".performance.ActDefinitionOrEvent.ServiceDeliveryLocation[@classCode = 'SDLOC']"},{"identity":"servd","map":"(ServD maps Practitioners and Organizations via another entity, so this concept is not available)
    However these are accessed via the Site.ServiceSite.ServiceSiteProvider record. (The Site has the location)"}]},{"id":"PractitionerRole.healthcareService","path":"PractitionerRole.healthcareService","short":"The list of healthcare services that this worker provides for this role's Organization/Location(s)","definition":"The list of healthcare services that this worker provides for this role's Organization/Location(s).","min":0,"max":"*","base":{"path":"PractitionerRole.healthcareService","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/HealthcareService"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"EDU-2 / AFF-3"},{"identity":"rim","map":".player.QualifiedEntity[@classCode = 'QUAL'].code"}]},{"id":"PractitionerRole.telecom","path":"PractitionerRole.telecom","short":"Contact details that are specific to the role/location/service","definition":"Contact details that are specific to the role/location/service.","requirements":"Often practitioners have a dedicated line for each location (or service) that they work at, and need to be able to define separate contact details for each of these.","min":0,"max":"*","base":{"path":"PractitionerRole.telecom","min":0,"max":"*"},"type":[{"code":"ContactPoint"}],"condition":["pd-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":".telecom"}]},{"id":"PractitionerRole.telecom.id","path":"PractitionerRole.telecom.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"PractitionerRole.telecom.extension","path":"PractitionerRole.telecom.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"PractitionerRole.telecom.system","path":"PractitionerRole.telecom.system","short":"phone | fax | email | pager | url | sms | other","definition":"Telecommunications form for contact point - what communications system is required to make use of the contact.","min":1,"max":"1","base":{"path":"ContactPoint.system","min":0,"max":"1"},"type":[{"code":"code"}],"condition":["cpt-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ContactPointSystem"}],"strength":"required","description":"Telecommunications form for contact point.","valueSet":"http://hl7.org/fhir/ValueSet/contact-point-system|4.0.1"},"mapping":[{"identity":"v2","map":"XTN.3"},{"identity":"rim","map":"./scheme"},{"identity":"servd","map":"./ContactPointType"}]},{"id":"PractitionerRole.telecom.value","path":"PractitionerRole.telecom.value","short":"The actual contact point details","definition":"The actual contact point details, in a form that is meaningful to the designated communication system (i.e. phone number or email address).","comment":"Additional text data such as phone extension numbers, or notes about use of the contact are sometimes included in the value.","requirements":"Need to support legacy numbers that are not in a tightly controlled format.","min":1,"max":"1","base":{"path":"ContactPoint.value","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"XTN.1 (or XTN.12)"},{"identity":"rim","map":"./url"},{"identity":"servd","map":"./Value"}]},{"id":"PractitionerRole.telecom.use","path":"PractitionerRole.telecom.use","short":"home | work | temp | old | mobile - purpose of this contact point","definition":"Identifies the purpose for the contact point.","comment":"Applications can assume that a contact is current unless it explicitly says that it is temporary or old.","requirements":"Need to track the way a person uses this contact, so a user can choose which is appropriate for their purpose.","min":0,"max":"1","base":{"path":"ContactPoint.use","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because applications should not mistake a temporary or old contact etc.for a current/permanent one","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ContactPointUse"}],"strength":"required","description":"Use of contact point.","valueSet":"http://hl7.org/fhir/ValueSet/contact-point-use|4.0.1"},"mapping":[{"identity":"v2","map":"XTN.2 - but often indicated by field"},{"identity":"rim","map":"unique(./use)"},{"identity":"servd","map":"./ContactPointPurpose"}]},{"id":"PractitionerRole.telecom.rank","path":"PractitionerRole.telecom.rank","short":"Specify preferred order of use (1 = highest)","definition":"Specifies a preferred order in which to use a set of contacts. ContactPoints with lower rank values are more preferred than those with higher rank values.","comment":"Note that rank does not necessarily follow the order in which the contacts are represented in the instance.","min":0,"max":"1","base":{"path":"ContactPoint.rank","min":0,"max":"1"},"type":[{"code":"positiveInt"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"n/a"},{"identity":"rim","map":"n/a"}]},{"id":"PractitionerRole.telecom.period","path":"PractitionerRole.telecom.period","short":"Time period when the contact point was/is in use","definition":"Time period when the contact point was/is in use.","min":0,"max":"1","base":{"path":"ContactPoint.period","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"./usablePeriod[type=\"IVL\"]"},{"identity":"servd","map":"./StartDate and ./EndDate"}]},{"id":"PractitionerRole.availableTime","path":"PractitionerRole.availableTime","short":"Times the Service Site is available","definition":"A collection of times the practitioner is available or performing this role at the location and/or healthcareservice.","comment":"More detailed availability information may be provided in associated Schedule/Slot resources.","min":0,"max":"*","base":{"path":"PractitionerRole.availableTime","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"PractitionerRole.availableTime.id","path":"PractitionerRole.availableTime.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"PractitionerRole.availableTime.extension","path":"PractitionerRole.availableTime.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"PractitionerRole.availableTime.modifierExtension","path":"PractitionerRole.availableTime.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.availableTime.daysOfWeek","path":"PractitionerRole.availableTime.daysOfWeek","short":"mon | tue | wed | thu | fri | sat | sun","definition":"Indicates which days of the week are available between the start and end Times.","min":0,"max":"*","base":{"path":"PractitionerRole.availableTime.daysOfWeek","min":0,"max":"*"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DaysOfWeek"}],"strength":"required","description":"The days of the week.","valueSet":"http://hl7.org/fhir/ValueSet/days-of-week|4.0.1"},"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"PractitionerRole.availableTime.allDay","path":"PractitionerRole.availableTime.allDay","short":"Always available? e.g. 24 hour service","definition":"Is this always available? (hence times are irrelevant) e.g. 24 hour service.","min":0,"max":"1","base":{"path":"PractitionerRole.availableTime.allDay","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"PractitionerRole.availableTime.availableStartTime","path":"PractitionerRole.availableTime.availableStartTime","short":"Opening time of day (ignored if allDay = true)","definition":"The opening time of day. Note: If the AllDay flag is set, then this time is ignored.","comment":"The timezone is expected to be for where this HealthcareService is provided at.","min":0,"max":"1","base":{"path":"PractitionerRole.availableTime.availableStartTime","min":0,"max":"1"},"type":[{"code":"time"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"PractitionerRole.availableTime.availableEndTime","path":"PractitionerRole.availableTime.availableEndTime","short":"Closing time of day (ignored if allDay = true)","definition":"The closing time of day. Note: If the AllDay flag is set, then this time is ignored.","comment":"The timezone is expected to be for where this HealthcareService is provided at.","min":0,"max":"1","base":{"path":"PractitionerRole.availableTime.availableEndTime","min":0,"max":"1"},"type":[{"code":"time"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"PractitionerRole.notAvailable","path":"PractitionerRole.notAvailable","short":"Not available during this time due to provided reason","definition":"The practitioner is not available or performing this role during this period of time due to the provided reason.","min":0,"max":"*","base":{"path":"PractitionerRole.notAvailable","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"PractitionerRole.notAvailable.id","path":"PractitionerRole.notAvailable.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"PractitionerRole.notAvailable.extension","path":"PractitionerRole.notAvailable.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"PractitionerRole.notAvailable.modifierExtension","path":"PractitionerRole.notAvailable.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"PractitionerRole.notAvailable.description","path":"PractitionerRole.notAvailable.description","short":"Reason presented to the user explaining why time not available","definition":"The reason that can be presented to the user as to why this time is not available.","min":1,"max":"1","base":{"path":"PractitionerRole.notAvailable.description","min":1,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"PractitionerRole.notAvailable.during","path":"PractitionerRole.notAvailable.during","short":"Service not available from this date","definition":"Service is not available (seasonally or for a public holiday) from this date.","min":0,"max":"1","base":{"path":"PractitionerRole.notAvailable.during","min":0,"max":"1"},"type":[{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"PractitionerRole.availabilityExceptions","path":"PractitionerRole.availabilityExceptions","short":"Description of availability exceptions","definition":"A description of site availability exceptions, e.g. public holiday availability. Succinctly describing all possible exceptions to normal site availability as details in the available Times and not available Times.","min":0,"max":"1","base":{"path":"PractitionerRole.availabilityExceptions","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".effectiveTime"}]},{"id":"PractitionerRole.endpoint","path":"PractitionerRole.endpoint","short":"Technical endpoints providing access to services operated for the practitioner with this role","definition":"Technical endpoints providing access to services operated for the practitioner with this role.","requirements":"Organizations have multiple systems that provide various services and ,ay also be different for practitioners too.\r\rSo the endpoint satisfies the need to be able to define the technical connection details for how to connect to them, and for what purpose.","min":0,"max":"*","base":{"path":"PractitionerRole.endpoint","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Endpoint"]}],"condition":["pd-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]}]},"differential":{"element":[{"id":"PractitionerRole","path":"PractitionerRole","definition":"This is basic constraint on PractitionerRole for use in US Core resources.","constraint":[{"key":"pd-1","severity":"error","human":"SHALL have contact information or a reference to an Endpoint","expression":"telecom or endpoint","xpath":"exists(f:telecom) or exists(f:endpoint)"}],"mustSupport":false},{"id":"PractitionerRole.practitioner","path":"PractitionerRole.practitioner","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner"]}],"mustSupport":true},{"id":"PractitionerRole.organization","path":"PractitionerRole.organization","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"mustSupport":true},{"id":"PractitionerRole.code","path":"PractitionerRole.code","min":0,"max":"*","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","description":"Provider role codes consisting of NUCC Health Care Provider Taxonomy Code Set for providers.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-provider-role"}},{"id":"PractitionerRole.specialty","path":"PractitionerRole.specialty","min":0,"max":"*","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","description":"Provider specialty codes consist of NUCC Health Care Provider Taxonomy Code Set for providers.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-provider-specialty"}},{"id":"PractitionerRole.location","path":"PractitionerRole.location","min":0,"max":"*","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"mustSupport":true},{"id":"PractitionerRole.telecom","path":"PractitionerRole.telecom","min":0,"max":"*","type":[{"code":"ContactPoint"}],"condition":["pd-1"],"mustSupport":true},{"id":"PractitionerRole.telecom.system","path":"PractitionerRole.telecom.system","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true},{"id":"PractitionerRole.telecom.value","path":"PractitionerRole.telecom.value","min":1,"max":"1","type":[{"code":"string"}],"mustSupport":true},{"id":"PractitionerRole.endpoint","path":"PractitionerRole.endpoint","min":0,"max":"*","condition":["pd-1"],"mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-procedure.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-procedure.json new file mode 100755 index 000000000..11e37c490 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-procedure.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-procedure","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Procedure 0..*
    \".\"\".\"\".\" status S1..1codeBinding: EventStatus (required)
    \".\"\".\"\".\" code S1..1CodeableConceptProcedure codes from SNOMED CT, CPT, or HCPCS II
    Binding: US Core Procedure Codes (extensible)
    \".\"\".\"\".\" subject S1..1Reference(US Core Patient Profile)
    \".\"\".\"\".\" performed[x] S1..1
    \".\"\".\"\".\"\".\" performedDateTimedateTime
    \".\"\".\"\".\"\".\" performedPeriodPeriod

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure","version":"3.1.0","name":"USCoreProcedureProfile","title":"US Core Procedure Profile","status":"active","experimental":false,"date":"2019-08-26T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Procedure resource for the minimal set of data to query and retrieve patient's procedure information.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"}],"kind":"resource","abstract":false,"type":"Procedure","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Procedure","derivation":"constraint","snapshot":{"element":[{"id":"Procedure","path":"Procedure","short":"An action that is being or was performed on a patient","definition":"The US Core Condition Profile is based upon the core FHIR Procedure Resource and created to meet the 2015 Edition Common Clinical Data Set 'Procedures' requirements.","min":0,"max":"*","base":{"path":"Procedure","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"rim","map":"Procedure[moodCode=EVN]"},{"identity":"argonaut-dq-dstu2","map":"Procedure"}]},{"id":"Procedure.id","path":"Procedure.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Procedure.meta","path":"Procedure.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Procedure.implicitRules","path":"Procedure.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Procedure.language","path":"Procedure.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Procedure.text","path":"Procedure.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Procedure.contained","path":"Procedure.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Procedure.extension","path":"Procedure.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Procedure.modifierExtension","path":"Procedure.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Procedure.identifier","path":"Procedure.identifier","short":"External Identifiers for this procedure","definition":"Business identifiers assigned to this procedure by the performer or other systems which remain constant as the resource is updated and is propagated from server to server.","comment":"This is a business identifier, not a resource identifier (see [discussion](http://hl7.org/fhir/R4/resource.html#identifiers)). It is best practice for the identifier to only appear on a single resource instance, however business practices may occasionally dictate that multiple resource instances with the same identifier can exist - possibly even with different resource types. For example, multiple Patient and Person resource instances might share the same social insurance number.","requirements":"Allows identification of the procedure as it is known by various participating systems and in a way that remains consistent across servers.","min":0,"max":"*","base":{"path":"Procedure.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"Some combination of ORC-2 / ORC-3 / OBR-2 / OBR-3 / IPC-1 / IPC-2 / IPC-3 / IPC-4"},{"identity":"rim","map":".id"}]},{"id":"Procedure.instantiatesCanonical","path":"Procedure.instantiatesCanonical","short":"Instantiates FHIR protocol or definition","definition":"The URL pointing to a FHIR-defined protocol, guideline, order set or other definition that is adhered to in whole or in part by this Procedure.","min":0,"max":"*","base":{"path":"Procedure.instantiatesCanonical","min":0,"max":"*"},"type":[{"code":"canonical","targetProfile":["http://hl7.org/fhir/StructureDefinition/PlanDefinition","http://hl7.org/fhir/StructureDefinition/ActivityDefinition","http://hl7.org/fhir/StructureDefinition/Measure","http://hl7.org/fhir/StructureDefinition/OperationDefinition","http://hl7.org/fhir/StructureDefinition/Questionnaire"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.instantiatesCanonical"},{"identity":"rim","map":".outboundRelationship[typeCode=DEFN].target"}]},{"id":"Procedure.instantiatesUri","path":"Procedure.instantiatesUri","short":"Instantiates external protocol or definition","definition":"The URL pointing to an externally maintained protocol, guideline, order set or other definition that is adhered to in whole or in part by this Procedure.","comment":"This might be an HTML page, PDF, etc. or could just be a non-resolvable URI identifier.","min":0,"max":"*","base":{"path":"Procedure.instantiatesUri","min":0,"max":"*"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.instantiatesUri"},{"identity":"rim","map":".outboundRelationship[typeCode=DEFN].target"}]},{"id":"Procedure.basedOn","path":"Procedure.basedOn","short":"A request for this procedure","definition":"A reference to a resource that contains details of the request for this procedure.","alias":["fulfills"],"min":0,"max":"*","base":{"path":"Procedure.basedOn","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan","http://hl7.org/fhir/StructureDefinition/ServiceRequest"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.basedOn"},{"identity":"rim","map":".outboundRelationship[typeCode=FLFS].target[classCode=(various e.g. PROC, OBS, PCPR, ACT, moodCode=RQO].code"}]},{"id":"Procedure.partOf","path":"Procedure.partOf","short":"Part of referenced event","definition":"A larger event of which this particular procedure is a component or step.","comment":"The MedicationAdministration resource has a partOf reference to Procedure, but this is not a circular reference. For example, the anesthesia MedicationAdministration is part of the surgical Procedure (MedicationAdministration.partOf = Procedure). For example, the procedure to insert the IV port for an IV medication administration is part of the medication administration (Procedure.partOf = MedicationAdministration).","alias":["container"],"min":0,"max":"*","base":{"path":"Procedure.partOf","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Procedure","http://hl7.org/fhir/StructureDefinition/Observation","http://hl7.org/fhir/StructureDefinition/MedicationAdministration"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.partOf"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[classCode=SBADM or PROC or OBS, moodCode=EVN]"}]},{"id":"Procedure.status","path":"Procedure.status","short":"preparation | in-progress | not-done | on-hold | stopped | completed | entered-in-error | unknown","definition":"A code specifying the state of the procedure. Generally, this will be the in-progress or completed state.","comment":"The \"unknown\" code is not to be used to convey other statuses. The \"unknown\" code should be used when one of the statuses applies, but the authoring system doesn't know the current state of the procedure.\n\nThis element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.","min":1,"max":"1","base":{"path":"Procedure.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labelled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/event-status"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"rim","map":"statusCode"},{"identity":"argonaut-dq-dstu2","map":"Procedure.status"}]},{"id":"Procedure.statusReason","path":"Procedure.statusReason","short":"Reason for current status","definition":"Captures the reason for the current state of the procedure.","comment":"This is generally only used for \"exception\" statuses such as \"not-done\", \"suspended\" or \"aborted\". The reason for performing the event at all is captured in reasonCode, not here.","alias":["Suspended Reason","Cancelled Reason"],"min":0,"max":"1","base":{"path":"Procedure.statusReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProcedureNegationReason"}],"strength":"example","description":"A code that identifies the reason a procedure was not performed.","valueSet":"http://hl7.org/fhir/ValueSet/procedure-not-performed-reason"},"mapping":[{"identity":"workflow","map":"Event.statusReason"},{"identity":"rim","map":".reason.Observation.value"}]},{"id":"Procedure.category","path":"Procedure.category","short":"Classification of the procedure","definition":"A code that classifies the procedure for searching, sorting and display purposes (e.g. \"Surgical Procedure\").","min":0,"max":"1","base":{"path":"Procedure.category","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProcedureCategory"}],"strength":"example","description":"A code that classifies a procedure for searching, sorting and display purposes.","valueSet":"http://hl7.org/fhir/ValueSet/procedure-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"}]},{"id":"Procedure.code","path":"Procedure.code","short":"Procedure codes from SNOMED CT, CPT, or HCPCS II","definition":"The specific procedure that is performed. Use text if the exact nature of the procedure cannot be coded (e.g. \"Laparoscopic Appendectomy\").","requirements":"0..1 to account for primarily narrative only resources.","alias":["type"],"min":1,"max":"1","base":{"path":"Procedure.code","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"Codes describing the type of Procedure","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-procedure-code"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"v2","map":"OBR-44/OBR-45"},{"identity":"rim","map":".code"},{"identity":"argonaut-dq-dstu2","map":"Procedure.code"}]},{"id":"Procedure.subject","path":"Procedure.subject","short":"Who the procedure was performed on","definition":"The person, animal or group on which the procedure was performed.","alias":["patient"],"min":1,"max":"1","base":{"path":"Procedure.subject","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":".participation[typeCode=SBJ].role"},{"identity":"w5","map":"FiveWs.subject"},{"identity":"argonaut-dq-dstu2","map":"Procedure.subject"}]},{"id":"Procedure.encounter","path":"Procedure.encounter","short":"Encounter created as part of","definition":"The Encounter during which this Procedure was created or performed or to which the creation of this record is tightly associated.","comment":"This will typically be the encounter the event occurred within, but some activities may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter.","min":0,"max":"1","base":{"path":"Procedure.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1-19"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN]"}]},{"id":"Procedure.performed[x]","path":"Procedure.performed[x]","short":"When the procedure was performed","definition":"Estimated or actual date, date-time, period, or age when the procedure was performed. Allows a period to support complex procedures that span more than one date, and also allows for the length of the procedure to be captured.","comment":"Age is generally used when the patient reports an age at which the procedure was performed. Range is generally used when the patient reports an age range when the procedure was performed, such as sometime between 20-25 years old. dateTime supports a range of precision due to some procedures being reported as past procedures that might not have millisecond precision while other procedures performed and documented during the encounter might have more precise UTC timestamps with timezone.","min":1,"max":"1","base":{"path":"Procedure.performed[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"OBR-7"},{"identity":"rim","map":".effectiveTime"},{"identity":"argonaut-dq-dstu2","map":"Procedure.performed[x]"}]},{"id":"Procedure.recorder","path":"Procedure.recorder","short":"Who recorded the procedure","definition":"Individual who recorded the record and takes responsibility for its content.","min":0,"max":"1","base":{"path":"Procedure.recorder","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.author"},{"identity":"rim","map":".participation[typeCode=AUT].role"}]},{"id":"Procedure.asserter","path":"Procedure.asserter","short":"Person who asserts this procedure","definition":"Individual who is making the procedure statement.","min":0,"max":"1","base":{"path":"Procedure.asserter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.source"},{"identity":"rim","map":".participation[typeCode=INF].role"}]},{"id":"Procedure.performer","path":"Procedure.performer","short":"The people who performed the procedure","definition":"Limited to \"real\" people rather than equipment.","min":0,"max":"*","base":{"path":"Procedure.performer","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer"},{"identity":"rim","map":".participation[typeCode=PRF]"}]},{"id":"Procedure.performer.id","path":"Procedure.performer.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Procedure.performer.extension","path":"Procedure.performer.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Procedure.performer.modifierExtension","path":"Procedure.performer.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Procedure.performer.function","path":"Procedure.performer.function","short":"Type of performance","definition":"Distinguishes the type of involvement of the performer in the procedure. For example, surgeon, anaesthetist, endoscopist.","requirements":"Allows disambiguation of the types of involvement of different performers.","min":0,"max":"1","base":{"path":"Procedure.performer.function","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProcedurePerformerRole"}],"strength":"example","description":"A code that identifies the role of a performer of the procedure.","valueSet":"http://hl7.org/fhir/ValueSet/performer-role"},"mapping":[{"identity":"workflow","map":"Event.performer.function"},{"identity":"v2","map":"Some combination of STF-18 / PRA-3 / PRT-4 / ROL-3 / ORC-12 / OBR-16 / PV1-7 / PV1-8 / PV1-9 / PV1-17 / OBX-25"},{"identity":"rim","map":".functionCode"}]},{"id":"Procedure.performer.actor","path":"Procedure.performer.actor","short":"The reference to the practitioner","definition":"The practitioner who was involved in the procedure.","requirements":"A reference to Device supports use cases, such as pacemakers.","min":1,"max":"1","base":{"path":"Procedure.performer.actor","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Device"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"ORC-19/PRT-5"},{"identity":"rim","map":".role"}]},{"id":"Procedure.performer.onBehalfOf","path":"Procedure.performer.onBehalfOf","short":"Organization the device or practitioner was acting for","definition":"The organization the device or practitioner was acting on behalf of.","requirements":"Practitioners and Devices can be associated with multiple organizations. This element indicates which organization they were acting on behalf of when performing the action.","min":0,"max":"1","base":{"path":"Procedure.performer.onBehalfOf","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".scoper"}]},{"id":"Procedure.location","path":"Procedure.location","short":"Where the procedure happened","definition":"The location where the procedure actually happened. E.g. a newborn at home, a tracheostomy at a restaurant.","requirements":"Ties a procedure to where the records are likely kept.","min":0,"max":"1","base":{"path":"Procedure.location","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.where[x]"},{"identity":"rim","map":".participation[typeCode=LOC].role[classCode=SDLOC]"}]},{"id":"Procedure.reasonCode","path":"Procedure.reasonCode","short":"Coded reason procedure performed","definition":"The coded reason why the procedure was performed. This may be a coded entity of some type, or may simply be present as text.","comment":"Use Procedure.reasonCode when a code sufficiently describes the reason. Use Procedure.reasonReference when referencing a resource, which allows more information to be conveyed, such as onset date. Procedure.reasonCode and Procedure.reasonReference are not meant to be duplicative. For a single reason, either Procedure.reasonCode or Procedure.reasonReference can be used. Procedure.reasonCode may be a summary code, or Procedure.reasonReference may be used to reference a very precise definition of the reason using Condition | Observation | Procedure | DiagnosticReport | DocumentReference. Both Procedure.reasonCode and Procedure.reasonReference can be used if they are describing different reasons for the procedure.","min":0,"max":"*","base":{"path":"Procedure.reasonCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProcedureReason"}],"strength":"example","description":"A code that identifies the reason a procedure is required.","valueSet":"http://hl7.org/fhir/ValueSet/procedure-reason"},"mapping":[{"identity":"workflow","map":"Event.reasonCode"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"rim","map":".reasonCode"}]},{"id":"Procedure.reasonReference","path":"Procedure.reasonReference","short":"The justification that the procedure was performed","definition":"The justification of why the procedure was performed.","comment":"It is possible for a procedure to be a reason (such as C-Section) for another procedure (such as an epidural). Other examples include endoscopy for dilatation and biopsy (a combination of diagnostic and therapeutic use). \nUse Procedure.reasonCode when a code sufficiently describes the reason. Use Procedure.reasonReference when referencing a resource, which allows more information to be conveyed, such as onset date. Procedure.reasonCode and Procedure.reasonReference are not meant to be duplicative. For a single reason, either Procedure.reasonCode or Procedure.reasonReference can be used. Procedure.reasonCode may be a summary code, or Procedure.reasonReference may be used to reference a very precise definition of the reason using Condition | Observation | Procedure | DiagnosticReport | DocumentReference. Both Procedure.reasonCode and Procedure.reasonReference can be used if they are describing different reasons for the procedure.","min":0,"max":"*","base":{"path":"Procedure.reasonReference","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Condition","http://hl7.org/fhir/StructureDefinition/Observation","http://hl7.org/fhir/StructureDefinition/Procedure","http://hl7.org/fhir/StructureDefinition/DiagnosticReport","http://hl7.org/fhir/StructureDefinition/DocumentReference"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.reasonReference"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"rim","map":".reasonCode"}]},{"id":"Procedure.bodySite","path":"Procedure.bodySite","short":"Target body sites","definition":"Detailed and structured anatomical location information. Multiple locations are allowed - e.g. multiple punch biopsies of a lesion.","comment":"If the use case requires attributes from the BodySite resource (e.g. to identify and track separately) then use the standard extension [procedure-targetbodystructure](http://hl7.org/fhir/R4/extension-procedure-targetbodystructure.html).","min":0,"max":"*","base":{"path":"Procedure.bodySite","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BodySite"}],"strength":"example","description":"Codes describing anatomical locations. May include laterality.","valueSet":"http://hl7.org/fhir/ValueSet/body-site"},"mapping":[{"identity":"v2","map":"OBX-20"},{"identity":"rim","map":".targetSiteCode"}]},{"id":"Procedure.outcome","path":"Procedure.outcome","short":"The result of procedure","definition":"The outcome of the procedure - did it resolve the reasons for the procedure being performed?","comment":"If outcome contains narrative text only, it can be captured using the CodeableConcept.text.","min":0,"max":"1","base":{"path":"Procedure.outcome","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProcedureOutcome"}],"strength":"example","description":"An outcome of a procedure - whether it was resolved or otherwise.","valueSet":"http://hl7.org/fhir/ValueSet/procedure-outcome"},"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode=OUT].target.text"}]},{"id":"Procedure.report","path":"Procedure.report","short":"Any report resulting from the procedure","definition":"This could be a histology result, pathology report, surgical report, etc.","comment":"There could potentially be multiple reports - e.g. if this was a procedure which took multiple biopsies resulting in a number of anatomical pathology reports.","min":0,"max":"*","base":{"path":"Procedure.report","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/DiagnosticReport","http://hl7.org/fhir/StructureDefinition/DocumentReference","http://hl7.org/fhir/StructureDefinition/Composition"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN]"}]},{"id":"Procedure.complication","path":"Procedure.complication","short":"Complication following the procedure","definition":"Any complications that occurred during the procedure, or in the immediate post-performance period. These are generally tracked separately from the notes, which will typically describe the procedure itself rather than any 'post procedure' issues.","comment":"If complications are only expressed by the narrative text, they can be captured using the CodeableConcept.text.","min":0,"max":"*","base":{"path":"Procedure.complication","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProcedureComplication"}],"strength":"example","description":"Codes describing complications that resulted from a procedure.","valueSet":"http://hl7.org/fhir/ValueSet/condition-code"},"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode=OUTC].target[classCode=OBS, code=\"complication\", moodCode=EVN].value"}]},{"id":"Procedure.complicationDetail","path":"Procedure.complicationDetail","short":"A condition that is a result of the procedure","definition":"Any complications that occurred during the procedure, or in the immediate post-performance period.","requirements":"This is used to document a condition that is a result of the procedure, not the condition that was the reason for the procedure.","min":0,"max":"*","base":{"path":"Procedure.complicationDetail","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Condition"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode=OUTC].target[classCode=OBS, code=\"complication\", moodCode=EVN].value"}]},{"id":"Procedure.followUp","path":"Procedure.followUp","short":"Instructions for follow up","definition":"If the procedure required specific follow up - e.g. removal of sutures. The follow up may be represented as a simple note or could potentially be more complex, in which case the CarePlan resource can be used.","min":0,"max":"*","base":{"path":"Procedure.followUp","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProcedureFollowUp"}],"strength":"example","description":"Specific follow up required for a procedure e.g. removal of sutures.","valueSet":"http://hl7.org/fhir/ValueSet/procedure-followup"},"mapping":[{"identity":"rim","map":".outboundRelationship[typeCode=COMP].target[classCode=ACT, moodCode=INT].code"}]},{"id":"Procedure.note","path":"Procedure.note","short":"Additional information about the procedure","definition":"Any other notes and comments about the procedure.","min":0,"max":"*","base":{"path":"Procedure.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.note"},{"identity":"v2","map":"NTE"},{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"annotation\"].value"}]},{"id":"Procedure.focalDevice","path":"Procedure.focalDevice","short":"Manipulated, implanted, or removed device","definition":"A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure.","min":0,"max":"*","base":{"path":"Procedure.focalDevice","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".participation[typeCode=DEV].role[classCode=MANU]"}]},{"id":"Procedure.focalDevice.id","path":"Procedure.focalDevice.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Procedure.focalDevice.extension","path":"Procedure.focalDevice.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Procedure.focalDevice.modifierExtension","path":"Procedure.focalDevice.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Procedure.focalDevice.action","path":"Procedure.focalDevice.action","short":"Kind of change to device","definition":"The kind of change that happened to the device during the procedure.","min":0,"max":"1","base":{"path":"Procedure.focalDevice.action","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"DeviceActionKind"}],"strength":"preferred","description":"A kind of change that happened to the device during the procedure.","valueSet":"http://hl7.org/fhir/ValueSet/device-action"},"mapping":[{"identity":"rim","map":".inboundRelationship[typeCode=SUBJ].source[classCode=OBS, moodCode=EVN, code=\"procedure device action\"].value=:procedure device action codes"}]},{"id":"Procedure.focalDevice.manipulated","path":"Procedure.focalDevice.manipulated","short":"Device that was changed","definition":"The device that was manipulated (changed) during the procedure.","min":1,"max":"1","base":{"path":"Procedure.focalDevice.manipulated","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Device"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".participation[typeCode=DEV].role[classCode=SDLOC]"}]},{"id":"Procedure.usedReference","path":"Procedure.usedReference","short":"Items used during procedure","definition":"Identifies medications, devices and any other substance used as part of the procedure.","comment":"For devices actually implanted or removed, use Procedure.device.","requirements":"Used for tracking contamination, etc.","min":0,"max":"*","base":{"path":"Procedure.usedReference","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Medication","http://hl7.org/fhir/StructureDefinition/Substance"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":".participation[typeCode=DEV].role[classCode=MANU] or\n.participation[typeCode=CSM].role[classCode=ADMM] (for Medication or Substance)"}]},{"id":"Procedure.usedCode","path":"Procedure.usedCode","short":"Coded items used during the procedure","definition":"Identifies coded items that were used as part of the procedure.","comment":"For devices actually implanted or removed, use Procedure.device.","min":0,"max":"*","base":{"path":"Procedure.usedCode","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProcedureUsed"}],"strength":"example","description":"Codes describing items used during a procedure.","valueSet":"http://hl7.org/fhir/ValueSet/device-kind"},"mapping":[{"identity":"rim","map":"participation[typeCode=Dev].role[classCode=MANU]"}]}]},"differential":{"element":[{"id":"Procedure","path":"Procedure","definition":"The US Core Condition Profile is based upon the core FHIR Procedure Resource and created to meet the 2015 Edition Common Clinical Data Set 'Procedures' requirements.","mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Procedure"}]},{"id":"Procedure.status","path":"Procedure.status","min":1,"max":"1","type":[{"code":"code"}],"mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/event-status"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Procedure.status"}]},{"id":"Procedure.code","path":"Procedure.code","short":"Procedure codes from SNOMED CT, CPT, or HCPCS II","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","description":"Codes describing the type of Procedure","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-procedure-code"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Procedure.code"}]},{"id":"Procedure.subject","path":"Procedure.subject","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Procedure.subject"}]},{"id":"Procedure.performed[x]","path":"Procedure.performed[x]","min":1,"max":"1","type":[{"code":"dateTime"},{"code":"Period"}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Procedure.performed[x]"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-provenance.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-provenance.json new file mode 100755 index 000000000..cf153b5e5 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-provenance.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-provenance","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Provenance 0..*US Core Provenance
    \".\"\".\"\".\" target S1..*Reference(Resource)The Resource this Provenance record supports
    \".\"\".\"\".\" recorded S1..1instantTimestamp when the activity was recorded / updated
    \".\"\".\"\".\" agent S1..*(Slice Definition)Slice: Unordered, Open by pattern:type
    \".\"\".\"\".\"\".\" agent:All Slices Content/Rules for all slices
    \".\"\".\"\".\"\".\"\".\" type S0..1CodeableConceptBinding: US Core Provenance Participant Type Codes (extensible)
    \".\"\".\"\".\"\".\"\".\" who S1..1Reference(US Core Practitioner Profile | PractitionerRole | RelatedPerson | US Core Patient Profile | Device | US Core Organization Profile)
    \".\"\".\"\".\"\".\"\".\" onBehalfOf SI0..1Reference(US Core Organization Profile)provenance-1: onBehalfOf SHALL be present when Provenance.agent.who is a Practitioner or Device
    \".\"\".\"\".\"\".\" agent:ProvenanceAuthor S0..*BackboneElement
    \".\"\".\"\".\"\".\"\".\" type S1..1CodeableConceptRequired Pattern: At least the following
    \".\"\".\"\".\"\".\"\".\"\".\" coding1..*CodingCode defined by a terminology system
    Fixed Value: (complex)
    \".\"\".\"\".\"\".\"\".\"\".\"\".\" system1..1uriIdentity of the terminology system
    Fixed Value: http://terminology.hl7.org/CodeSystem/provenance-participant-type
    \".\"\".\"\".\"\".\"\".\"\".\"\".\" code1..1codeSymbol in syntax defined by the system
    Fixed Value: author
    \".\"\".\"\".\"\".\" agent:ProvenanceTransmitter S0..1BackboneElement
    \".\"\".\"\".\"\".\"\".\" type S1..1CodeableConceptRequired Pattern: At least the following
    \".\"\".\"\".\"\".\"\".\"\".\" coding1..*CodingCode defined by a terminology system
    Fixed Value: (complex)
    \".\"\".\"\".\"\".\"\".\"\".\"\".\" system1..1uriIdentity of the terminology system
    Fixed Value: http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type
    \".\"\".\"\".\"\".\"\".\"\".\"\".\" code1..1codeSymbol in syntax defined by the system
    Fixed Value: transmitter

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance","version":"3.1.0","name":"USCoreProvenance","title":"US Core Provenance Profile","status":"active","date":"2019-08-05T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Draft set of requirements to satisfy Basic Provenance Requirements.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w3c.prov","uri":"http://www.w3.org/ns/prov","name":"W3C PROV"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"fhirauditevent","uri":"http://hl7.org/fhir/auditevent","name":"FHIR AuditEvent Mapping"}],"kind":"resource","abstract":false,"type":"Provenance","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Provenance","derivation":"constraint","snapshot":{"element":[{"id":"Provenance","path":"Provenance","short":"US Core Provenance","definition":"The US Core Provenance Profile is based upon the Argonaut Data Query requirements.","comment":"Some parties may be duplicated between the target resource and its provenance. For instance, the prescriber is usually (but not always) the author of the prescription resource. This resource is defined with close consideration for W3C Provenance.","alias":["History","Event","Activity","Basic Provenance"],"min":0,"max":"*","base":{"path":"Provenance","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"rim","map":"ControlAct[isNormalAct() and subsumes(CACT, classCode) and moodCode=EVN]"},{"identity":"w3c.prov","map":"Activity"}]},{"id":"Provenance.id","path":"Provenance.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Provenance.meta","path":"Provenance.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Provenance.implicitRules","path":"Provenance.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Provenance.language","path":"Provenance.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Provenance.text","path":"Provenance.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Provenance.contained","path":"Provenance.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Provenance.extension","path":"Provenance.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Provenance.modifierExtension","path":"Provenance.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Provenance.target","path":"Provenance.target","short":"The Resource this Provenance record supports","definition":"The Reference(s) that were generated or updated by the activity described in this resource. A provenance can point to more than one target if multiple resources were created/updated by the same activity.","comment":"Target references are usually version specific, but might not be, if a version has not been assigned or if the provenance information is part of the set of resources being maintained (i.e. a document). When using the RESTful API, the identity of the resource might not be known (especially not the version specific one); the client may either submit the resource first, and then the provenance, or it may submit both using a single transaction. See the notes on transaction for further discussion.","min":1,"max":"*","base":{"path":"Provenance.target","min":1,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"rim","map":"./outboundRelationship[isNormalActRelationship() and typeCode=SUBJ]/target OR ./participation[isNormalParticipation() and typeCode=SBJ]/role OR ./participation[isNormalParticipation() and typeCode=SBJ]/role[isNormalRole()]/player"},{"identity":"fhirauditevent","map":"AuditEvent.entity.reference"},{"identity":"w3c.prov","map":"Entity Created/Updated"}]},{"id":"Provenance.occurred[x]","path":"Provenance.occurred[x]","short":"When the activity occurred","definition":"The period during which the activity occurred.","comment":"The period can be a little arbitrary; where possible, the time should correspond to human assessment of the activity time.","min":0,"max":"1","base":{"path":"Provenance.occurred[x]","min":0,"max":"1"},"type":[{"code":"Period"},{"code":"dateTime"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.occurred[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"rim","map":"./effectiveTime[type=IVL_TS]"},{"identity":"w3c.prov","map":"Activity.startTime & Activity.endTime"}]},{"id":"Provenance.recorded","path":"Provenance.recorded","short":"Timestamp when the activity was recorded / updated","definition":"The instant of time at which the activity was recorded.","comment":"This can be a little different from the time stamp on the resource if there is a delay between recording the event and updating the provenance and target resource.","min":1,"max":"1","base":{"path":"Provenance.recorded","min":1,"max":"1"},"type":[{"code":"instant"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"rim","map":"unique(./participation[isNormalParticipation() and typeCode=AUT]/time[type=TS])"},{"identity":"fhirauditevent","map":"AuditEvent.recorded"},{"identity":"w3c.prov","map":"Activity.when"}]},{"id":"Provenance.policy","path":"Provenance.policy","short":"Policy or plan the activity was defined by","definition":"Policy or plan the activity was defined by. Typically, a single activity may have multiple applicable policy documents, such as patient consent, guarantor funding, etc.","comment":"For example: Where an OAuth token authorizes, the unique identifier from the OAuth token is placed into the policy element Where a policy engine (e.g. XACML) holds policy logic, the unique policy identifier is placed into the policy element.","min":0,"max":"*","base":{"path":"Provenance.policy","min":0,"max":"*"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"./inboundRelationship[isNormalActRelationship() and typeCode=\"SUBJ\"]/source[isNormalAct and subsumes(POLICY, classCode) and moodCode=EVN]/text[typeCode='ED'/tel"},{"identity":"fhirauditevent","map":"AuditEvent.agent.policy"}]},{"id":"Provenance.location","path":"Provenance.location","short":"Where the activity occurred, if relevant","definition":"Where the activity occurred, if relevant.","min":0,"max":"1","base":{"path":"Provenance.location","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Location"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.location"},{"identity":"w5","map":"FiveWs.where[x]"},{"identity":"rim","map":"unique(./participation[isNormalParticipation() and typeCode=LOC]/role[isNormalRole() and subsumes(SDLOC, classCode)]/player[isNormalEntity and classCode=\"LOC\" and determinerCode=\"INST\"]"},{"identity":"fhirauditevent","map":"AuditEvent.agent.location"},{"identity":"w3c.prov","map":"Activity.location"}]},{"id":"Provenance.reason","path":"Provenance.reason","short":"Reason the activity is occurring","definition":"The reason that the activity was taking place.","min":0,"max":"*","base":{"path":"Provenance.reason","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProvenanceReason"}],"strength":"extensible","description":"The reason the activity took place.","valueSet":"http://terminology.hl7.org/ValueSet/v3-PurposeOfUse"},"mapping":[{"identity":"workflow","map":"Event.reasonCode"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"rim","map":"unique(./reasonCode)"},{"identity":"fhirauditevent","map":"AuditEvent.purposeOfEvent"},{"identity":"w3c.prov","map":"Activity.Activity"}]},{"id":"Provenance.activity","path":"Provenance.activity","short":"Activity that occurred","definition":"An activity is something that occurs over a period of time and acts upon or with entities; it may include consuming, processing, transforming, modifying, relocating, using, or generating entities.","min":0,"max":"1","base":{"path":"Provenance.activity","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProvenanceActivity"}],"strength":"extensible","description":"The activity that took place.","valueSet":"http://hl7.org/fhir/ValueSet/provenance-activity-type"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.why[x]"},{"identity":"rim","map":"Act.code"},{"identity":"w3c.prov","map":"Activity.Activity"}]},{"id":"Provenance.agent","path":"Provenance.agent","slicing":{"discriminator":[{"type":"pattern","path":"type"}],"rules":"open"},"short":"Actor involved","definition":"An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.","comment":"Several agents may be associated (i.e. has some responsibility for an activity) with an activity and vice-versa.","requirements":"An agent can be a person, an organization, software, device, or other entities that may be ascribed responsibility.","min":1,"max":"*","base":{"path":"Provenance.agent","min":1,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.performer"},{"identity":"w5","map":"FiveWs.who"},{"identity":"rim","map":"./participation[isNormalParticipation()] OR ./outboundRelationship[isNormalActRelationship() and typeCode='DRIV']"},{"identity":"fhirauditevent","map":"AuditEvent.agent"},{"identity":"w3c.prov","map":"Agent"}]},{"id":"Provenance.agent.id","path":"Provenance.agent.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Provenance.agent.extension","path":"Provenance.agent.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Provenance.agent.modifierExtension","path":"Provenance.agent.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Provenance.agent.type","path":"Provenance.agent.type","short":"How the agent participated","definition":"The participation the agent had with respect to the activity.","comment":"For example: author, performer, enterer, attester, etc.","min":0,"max":"1","base":{"path":"Provenance.agent.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-provenance-participant-type"},"mapping":[{"identity":"workflow","map":"Event.performer.function"},{"identity":"rim","map":".role"},{"identity":"fhirauditevent","map":"AuditEvent.agent.type"},{"identity":"w3c.prov","map":"Agent.Attribution"}]},{"id":"Provenance.agent.role","path":"Provenance.agent.role","short":"What the agents role was","definition":"The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity.","comment":"For example: doctor, nurse, clerk, etc.","min":0,"max":"*","base":{"path":"Provenance.agent.role","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProvenanceAgentRole"}],"strength":"example","description":"The role that a provenance agent played with respect to the activity.","valueSet":"http://hl7.org/fhir/ValueSet/security-role-type"},"mapping":[{"identity":"rim","map":".typecode"},{"identity":"fhirauditevent","map":"AuditEvent.agent.role"}]},{"id":"Provenance.agent.who","path":"Provenance.agent.who","short":"Who participated","definition":"The individual, device or organization that participated in the event.","comment":"whoIdentity should be used when the agent is not a Resource type.","min":1,"max":"1","base":{"path":"Provenance.agent.who","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"rim","map":".id"}]},{"id":"Provenance.agent.onBehalfOf","path":"Provenance.agent.onBehalfOf","short":"Who the agent is representing","definition":"The individual, device, or organization for whom the change was made.","comment":"onBehalfOfIdentity should be used when the agent is not a Resource type.","min":0,"max":"1","base":{"path":"Provenance.agent.onBehalfOf","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"provenance-1","severity":"error","human":"onBehalfOf SHALL be present when Provenance.agent.who is a Practitioner or Device","expression":"($this.agent.who.resolve().is Practitioner or Device) implies exists()"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Person, Practitioner, Organization, Device :* .role [classCode = RoleClassMutualRelationship; role.code and * .scopes[Role](classCode=IDENT) and *.plays [Role.Code]"}]},{"id":"Provenance.agent:ProvenanceAuthor","path":"Provenance.agent","sliceName":"ProvenanceAuthor","short":"Actor involved","definition":"An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking place.","comment":"Several agents may be associated (i.e. has some responsibility for an activity) with an activity and vice-versa.","requirements":"An agent can be a person, an organization, software, device, or other entities that may be ascribed responsibility.","min":0,"max":"*","base":{"path":"Provenance.agent","min":1,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.performer"},{"identity":"w5","map":"FiveWs.who"},{"identity":"rim","map":"./participation[isNormalParticipation()] OR ./outboundRelationship[isNormalActRelationship() and typeCode='DRIV']"},{"identity":"fhirauditevent","map":"AuditEvent.agent"},{"identity":"w3c.prov","map":"Agent"}]},{"id":"Provenance.agent:ProvenanceAuthor.id","path":"Provenance.agent.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Provenance.agent:ProvenanceAuthor.extension","path":"Provenance.agent.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Provenance.agent:ProvenanceAuthor.modifierExtension","path":"Provenance.agent.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Provenance.agent:ProvenanceAuthor.type","path":"Provenance.agent.type","short":"How the agent participated","definition":"The participation the agent had with respect to the activity.","comment":"For example: author, performer, enterer, attester, etc.","min":1,"max":"1","base":{"path":"Provenance.agent.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/provenance-participant-type","code":"author"}]},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProvenanceAgentType"}],"strength":"extensible","description":"The type of participation that a provenance agent played with respect to the activity.","valueSet":"http://hl7.org/fhir/ValueSet/provenance-agent-type"},"mapping":[{"identity":"workflow","map":"Event.performer.function"},{"identity":"rim","map":".role"},{"identity":"fhirauditevent","map":"AuditEvent.agent.type"},{"identity":"w3c.prov","map":"Agent.Attribution"}]},{"id":"Provenance.agent:ProvenanceAuthor.role","path":"Provenance.agent.role","short":"What the agents role was","definition":"The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity.","comment":"For example: doctor, nurse, clerk, etc.","min":0,"max":"*","base":{"path":"Provenance.agent.role","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProvenanceAgentRole"}],"strength":"example","description":"The role that a provenance agent played with respect to the activity.","valueSet":"http://hl7.org/fhir/ValueSet/security-role-type"},"mapping":[{"identity":"rim","map":".typecode"},{"identity":"fhirauditevent","map":"AuditEvent.agent.role"}]},{"id":"Provenance.agent:ProvenanceAuthor.who","path":"Provenance.agent.who","short":"Who participated","definition":"The individual, device or organization that participated in the event.","comment":"whoIdentity should be used when the agent is not a Resource type.","min":1,"max":"1","base":{"path":"Provenance.agent.who","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"rim","map":".id"}]},{"id":"Provenance.agent:ProvenanceAuthor.onBehalfOf","path":"Provenance.agent.onBehalfOf","short":"Who the agent is representing","definition":"The individual, device, or organization for whom the change was made.","comment":"onBehalfOfIdentity should be used when the agent is not a Resource type.","min":0,"max":"1","base":{"path":"Provenance.agent.onBehalfOf","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Person, Practitioner, Organization, Device :* .role [classCode = RoleClassMutualRelationship; role.code and * .scopes[Role](classCode=IDENT) and *.plays [Role.Code]"}]},{"id":"Provenance.agent:ProvenanceTransmitter","path":"Provenance.agent","sliceName":"ProvenanceTransmitter","short":"Actor involved","definition":"The entity that provided the copy to your system.","comment":"Several agents may be associated (i.e. has some responsibility for an activity) with an activity and vice-versa.","requirements":"An agent can be a person, an organization, software, device, or other entities that may be ascribed responsibility.","min":0,"max":"1","base":{"path":"Provenance.agent","min":1,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"workflow","map":"Event.performer"},{"identity":"w5","map":"FiveWs.who"},{"identity":"rim","map":"./participation[isNormalParticipation()] OR ./outboundRelationship[isNormalActRelationship() and typeCode='DRIV']"},{"identity":"fhirauditevent","map":"AuditEvent.agent"},{"identity":"w3c.prov","map":"Agent"}]},{"id":"Provenance.agent:ProvenanceTransmitter.id","path":"Provenance.agent.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Provenance.agent:ProvenanceTransmitter.extension","path":"Provenance.agent.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Provenance.agent:ProvenanceTransmitter.modifierExtension","path":"Provenance.agent.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Provenance.agent:ProvenanceTransmitter.type","path":"Provenance.agent.type","short":"How the agent participated","definition":"The participation the agent had with respect to the activity.","comment":"For example: author, performer, enterer, attester, etc.","min":1,"max":"1","base":{"path":"Provenance.agent.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type","code":"transmitter"}]},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProvenanceAgentType"}],"strength":"extensible","description":"The type of participation that a provenance agent played with respect to the activity.","valueSet":"http://hl7.org/fhir/ValueSet/provenance-agent-type"},"mapping":[{"identity":"workflow","map":"Event.performer.function"},{"identity":"rim","map":".role"},{"identity":"fhirauditevent","map":"AuditEvent.agent.type"},{"identity":"w3c.prov","map":"Agent.Attribution"}]},{"id":"Provenance.agent:ProvenanceTransmitter.role","path":"Provenance.agent.role","short":"What the agents role was","definition":"The function of the agent with respect to the activity. The security role enabling the agent with respect to the activity.","comment":"For example: doctor, nurse, clerk, etc.","min":0,"max":"*","base":{"path":"Provenance.agent.role","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProvenanceAgentRole"}],"strength":"example","description":"The role that a provenance agent played with respect to the activity.","valueSet":"http://hl7.org/fhir/ValueSet/security-role-type"},"mapping":[{"identity":"rim","map":".typecode"},{"identity":"fhirauditevent","map":"AuditEvent.agent.role"}]},{"id":"Provenance.agent:ProvenanceTransmitter.who","path":"Provenance.agent.who","short":"Who participated","definition":"The individual, device or organization that participated in the event.","comment":"whoIdentity should be used when the agent is not a Resource type.","min":1,"max":"1","base":{"path":"Provenance.agent.who","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"rim","map":".id"}]},{"id":"Provenance.agent:ProvenanceTransmitter.onBehalfOf","path":"Provenance.agent.onBehalfOf","short":"Who the agent is representing","definition":"The individual, device, or organization for whom the change was made.","comment":"onBehalfOfIdentity should be used when the agent is not a Resource type.","min":0,"max":"1","base":{"path":"Provenance.agent.onBehalfOf","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Person, Practitioner, Organization, Device :* .role [classCode = RoleClassMutualRelationship; role.code and * .scopes[Role](classCode=IDENT) and *.plays [Role.Code]"}]},{"id":"Provenance.entity","path":"Provenance.entity","short":"An entity used in this activity","definition":"An entity used in this activity.","min":0,"max":"*","base":{"path":"Provenance.entity","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"./subjectOf"},{"identity":"fhirauditevent","map":"AuditEvent.entity"},{"identity":"w3c.prov","map":"Entity"}]},{"id":"Provenance.entity.id","path":"Provenance.entity.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Provenance.entity.extension","path":"Provenance.entity.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Provenance.entity.modifierExtension","path":"Provenance.entity.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Provenance.entity.role","path":"Provenance.entity.role","short":"derivation | revision | quotation | source | removal","definition":"How the entity was used during the activity.","min":1,"max":"1","base":{"path":"Provenance.entity.role","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ProvenanceEntityRole"}],"strength":"required","description":"How an entity was used in an activity.","valueSet":"http://hl7.org/fhir/ValueSet/provenance-entity-role|4.0.1"},"mapping":[{"identity":"rim","map":"./typeCode"},{"identity":"fhirauditevent","map":"AuditEvent.entity.lifecycle"},{"identity":"w3c.prov","map":"Entity.role"}]},{"id":"Provenance.entity.what","path":"Provenance.entity.what","short":"Identity of entity","definition":"Identity of the Entity used. May be a logical or physical uri and maybe absolute or relative.","comment":"whatIdentity should be used for entities that are not a Resource type.","min":1,"max":"1","base":{"path":"Provenance.entity.what","min":1,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"rim","map":"./text/reference"},{"identity":"fhirauditevent","map":"AuditEvent.entity.reference"},{"identity":"w3c.prov","map":"Entity.Identity"}]},{"id":"Provenance.entity.agent","path":"Provenance.entity.agent","short":"Entity is attributed to this agent","definition":"The entity is attributed to an agent to express the agent's responsibility for that entity, possibly along with other agents. This description can be understood as shorthand for saying that the agent was responsible for the activity which generated the entity.","comment":"A usecase where one Provenance.entity.agent is used where the Entity that was used in the creation/updating of the Target, is not in the context of the same custodianship as the Target, and thus the meaning of Provenance.entity.agent is to say that the entity referenced is managed elsewhere and that this Agent provided access to it. This would be similar to where the Entity being referenced is managed outside FHIR, such as through HL7 v2, v3, or XDS. This might be where the Entity being referenced is managed in another FHIR resource server. Thus it explains the Provenance of that Entity's use in the context of this Provenance activity.","min":0,"max":"*","base":{"path":"Provenance.entity.agent","min":0,"max":"*"},"contentReference":"#Provenance.agent:ProvenanceTransmitter","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"./author/role"}]},{"id":"Provenance.signature","path":"Provenance.signature","short":"Signature on target","definition":"A digital signature on the target Reference(s). The signer should match a Provenance.agent. The purpose of the signature is indicated.","min":0,"max":"*","base":{"path":"Provenance.signature","min":0,"max":"*"},"type":[{"code":"Signature"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"./signatureText"}]}]},"differential":{"element":[{"id":"Provenance","path":"Provenance","short":"US Core Provenance","definition":"The US Core Provenance Profile is based upon the Argonaut Data Query requirements.","alias":["Basic Provenance"],"mustSupport":false,"isModifier":false},{"id":"Provenance.target","path":"Provenance.target","short":"The Resource this Provenance record supports","min":1,"max":"*","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"mustSupport":true,"isModifier":false},{"id":"Provenance.recorded","path":"Provenance.recorded","short":"Timestamp when the activity was recorded / updated","definition":"The instant of time at which the activity was recorded.","min":1,"max":"1","type":[{"code":"instant"}],"mustSupport":true,"isModifier":false},{"id":"Provenance.agent","path":"Provenance.agent","slicing":{"discriminator":[{"type":"pattern","path":"type"}],"rules":"open"},"min":1,"max":"*","mustSupport":true,"isModifier":false},{"id":"Provenance.agent.type","path":"Provenance.agent.type","min":0,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"isModifier":false,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-provenance-participant-type"}},{"id":"Provenance.agent.who","path":"Provenance.agent.who","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"mustSupport":true,"isModifier":false},{"id":"Provenance.agent.onBehalfOf","path":"Provenance.agent.onBehalfOf","min":0,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization"]}],"constraint":[{"key":"provenance-1","severity":"error","human":"onBehalfOf SHALL be present when Provenance.agent.who is a Practitioner or Device","expression":"($this.agent.who.resolve().is Practitioner or Device) implies exists()"}],"mustSupport":true,"isModifier":false},{"id":"Provenance.agent:ProvenanceAuthor","path":"Provenance.agent","sliceName":"ProvenanceAuthor","min":0,"max":"*","mustSupport":true,"isModifier":false},{"id":"Provenance.agent:ProvenanceAuthor.type","path":"Provenance.agent.type","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/provenance-participant-type","code":"author"}]},"mustSupport":true,"isModifier":false},{"id":"Provenance.agent:ProvenanceTransmitter","path":"Provenance.agent","sliceName":"ProvenanceTransmitter","definition":"The entity that provided the copy to your system.","min":0,"max":"1","mustSupport":true,"isModifier":false},{"id":"Provenance.agent:ProvenanceTransmitter.type","path":"Provenance.agent.type","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type","code":"transmitter"}]},"mustSupport":true,"isModifier":false}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-pulse-oximetry.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-pulse-oximetry.json new file mode 100755 index 000000000..6f5fbfbe6 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-pulse-oximetry.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-pulse-oximetry","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Observation 0..*
    \".\"\".\"\".\" code S1..1CodeableConceptOxygen Saturation by Pulse Oximetry
    \".\"\".\"\".\"\".\" coding S0..*(Slice Definition)Slice: Unordered, Open by value:code, value:system
    \".\"\".\"\".\"\".\"\".\" coding:PulseOx S1..1Coding
    \".\"\".\"\".\"\".\"\".\"\".\" system S1..1uriFixed Value: http://loinc.org
    \".\"\".\"\".\"\".\"\".\"\".\" code S1..1codeFixed Value: 59408-5
    \".\"\".\"\".\" component S0..*(Slice Definition)Slice: Unordered, Open by pattern:code
    \".\"\".\"\".\"\".\" component:FlowRate S0..1BackboneElementInhaled oxygen flow rate
    \".\"\".\"\".\"\".\"\".\" code S1..1CodeableConceptRequired Pattern: At least the following
    \".\"\".\"\".\"\".\"\".\"\".\" coding1..*CodingCode defined by a terminology system
    Fixed Value: (complex)
    \".\"\".\"\".\"\".\"\".\"\".\"\".\" system1..1uriIdentity of the terminology system
    Fixed Value: http://loinc.org
    \".\"\".\"\".\"\".\"\".\"\".\"\".\" code1..1codeSymbol in syntax defined by the system
    Fixed Value: 3151-8
    \".\"\".\"\".\"\".\"\".\" valueQuantity S0..1Quantity
    \".\"\".\"\".\"\".\"\".\"\".\" value S0..1decimal
    \".\"\".\"\".\"\".\"\".\"\".\" unit S0..1string
    \".\"\".\"\".\"\".\"\".\"\".\" system S1..1uriFixed Value: http://unitsofmeasure.org
    \".\"\".\"\".\"\".\"\".\"\".\" code S1..1codeFixed Value: l/min
    \".\"\".\"\".\"\".\" component:Concentration S0..1BackboneElementInhaled oxygen concentration
    \".\"\".\"\".\"\".\"\".\" code S1..1CodeableConceptRequired Pattern: At least the following
    \".\"\".\"\".\"\".\"\".\"\".\" coding1..*CodingCode defined by a terminology system
    Fixed Value: (complex)
    \".\"\".\"\".\"\".\"\".\"\".\"\".\" system1..1uriIdentity of the terminology system
    Fixed Value: http://loinc.org
    \".\"\".\"\".\"\".\"\".\"\".\"\".\" code1..1codeSymbol in syntax defined by the system
    Fixed Value: 3150-0
    \".\"\".\"\".\"\".\"\".\" valueQuantity S0..1Quantity
    \".\"\".\"\".\"\".\"\".\"\".\" value S0..1decimal
    \".\"\".\"\".\"\".\"\".\"\".\" unit S0..1string
    \".\"\".\"\".\"\".\"\".\"\".\" system S1..1uriFixed Value: http://unitsofmeasure.org
    \".\"\".\"\".\"\".\"\".\"\".\" code S1..1codeFixed Value: %

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry","version":"3.1.0","name":"USCorePulseOximetryProfile","title":"US Core Pulse Oximetry Profile","status":"active","experimental":false,"date":"2019-08-20T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Observation resource for use in querying and retrieving inspired O2 by pulse oximetry observations.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"sct-concept","uri":"http://snomed.info/conceptdomain","name":"SNOMED CT Concept Domain Binding"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"sct-attr","uri":"http://snomed.org/attributebinding","name":"SNOMED CT Attribute Binding"}],"kind":"resource","abstract":false,"type":"Observation","baseDefinition":"http://hl7.org/fhir/StructureDefinition/oxygensat","derivation":"constraint","snapshot":{"element":[{"id":"Observation","path":"Observation","short":"FHIR Oxygen Saturation Profile","definition":"This profile defines how to represent pulse oximetry and inspired oxygen concentration based on the FHIR Core Vitals Profile.\nINSPIRED OXYGEN CONCENTRATION observations in FHIR using a standard LOINC code and UCUM units of measure.","comment":"Used for simple observations such as device measurements, laboratory atomic results, vital signs, height, weight, smoking status, comments, etc. Other resources are used to provide context for observations such as laboratory reports, etc.","alias":["Vital Signs","Measurement","Results","Tests"],"min":0,"max":"*","base":{"path":"Observation","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"obs-6","severity":"error","human":"dataAbsentReason SHALL only be present if Observation.value[x] is not present","expression":"dataAbsentReason.empty() or value.empty()","xpath":"not(exists(f:dataAbsentReason)) or (not(exists(*[starts-with(local-name(.), 'value')])))","source":"http://hl7.org/fhir/StructureDefinition/Observation"},{"key":"obs-7","severity":"error","human":"If Observation.code is the same as an Observation.component.code then the value element associated with the code SHALL NOT be present","expression":"value.empty() or component.code.where(coding.intersect(%resource.code.coding).exists()).empty()","xpath":"not(f:*[starts-with(local-name(.), 'value')] and (for $coding in f:code/f:coding return f:component/f:code/f:coding[f:code/@value=$coding/f:code/@value] [f:system/@value=$coding/f:system/@value]))","source":"http://hl7.org/fhir/StructureDefinition/Observation"},{"key":"vs-2","severity":"error","human":"If there is no component or hasMember element then either a value[x] or a data absent reason must be present.","expression":"(component.empty() and hasMember.empty()) implies (dataAbsentReason.exists() or value.exists())","xpath":"f:component or f:memberOF or f:*[starts-with(local-name(.), 'value')] or f:dataAbsentReason","source":"http://hl7.org/fhir/StructureDefinition/vitalsigns"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"sct-concept","map":"< 363787002 |Observable entity|"},{"identity":"v2","map":"OBX"},{"identity":"rim","map":"Observation[classCode=OBS, moodCode=EVN]"}]},{"id":"Observation.id","path":"Observation.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Observation.meta","path":"Observation.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Observation.implicitRules","path":"Observation.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Observation.language","path":"Observation.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Observation.text","path":"Observation.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Observation.contained","path":"Observation.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.extension","path":"Observation.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.modifierExtension","path":"Observation.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.identifier","path":"Observation.identifier","short":"Business Identifier for observation","definition":"A unique identifier assigned to this observation.","requirements":"Allows observations to be distinguished and referenced.","min":0,"max":"*","base":{"path":"Observation.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"OBX.21 For OBX segments from systems without OBX-21 support a combination of ORC/OBR and OBX must be negotiated between trading partners to uniquely identify the OBX segment. Depending on how V2 has been implemented each of these may be an option: 1) OBR-3 + OBX-3 + OBX-4 or 2) OBR-3 + OBR-4 + OBX-3 + OBX-4 or 2) some other way to uniquely ID the OBR/ORC + OBX-3 + OBX-4."},{"identity":"rim","map":"id"}]},{"id":"Observation.basedOn","path":"Observation.basedOn","short":"Fulfills plan, proposal or order","definition":"A plan, proposal or order that is fulfilled in whole or in part by this event. For example, a MedicationRequest may require a patient to have laboratory test performed before it is dispensed.","requirements":"Allows tracing of authorization for the event and tracking whether proposals/recommendations were acted upon.","alias":["Fulfills"],"min":0,"max":"*","base":{"path":"Observation.basedOn","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan","http://hl7.org/fhir/StructureDefinition/DeviceRequest","http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation","http://hl7.org/fhir/StructureDefinition/MedicationRequest","http://hl7.org/fhir/StructureDefinition/NutritionOrder","http://hl7.org/fhir/StructureDefinition/ServiceRequest"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.basedOn"},{"identity":"v2","map":"ORC"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[moodCode=EVN]"}]},{"id":"Observation.partOf","path":"Observation.partOf","short":"Part of referenced event","definition":"A larger event of which this particular Observation is a component or step. For example, an observation as part of a procedure.","comment":"To link an Observation to an Encounter use `encounter`. See the [Notes](http://hl7.org/fhir/observation.html#obsgrouping) below for guidance on referencing another Observation.","alias":["Container"],"min":0,"max":"*","base":{"path":"Observation.partOf","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/MedicationAdministration","http://hl7.org/fhir/StructureDefinition/MedicationDispense","http://hl7.org/fhir/StructureDefinition/MedicationStatement","http://hl7.org/fhir/StructureDefinition/Procedure","http://hl7.org/fhir/StructureDefinition/Immunization","http://hl7.org/fhir/StructureDefinition/ImagingStudy"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.partOf"},{"identity":"v2","map":"Varies by domain"},{"identity":"rim","map":".outboundRelationship[typeCode=FLFS].target"}]},{"id":"Observation.status","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint","valueString":"default: final"}],"path":"Observation.status","short":"registered | preliminary | final | amended +","definition":"The status of the result value.","comment":"This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.","requirements":"Need to track the status of individual results. Some results are finalized before the whole report is finalized.","min":1,"max":"1","base":{"path":"Observation.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Status"}],"strength":"required","valueSet":"http://hl7.org/fhir/ValueSet/observation-status|4.0.1"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"sct-concept","map":"< 445584004 |Report by finality status|"},{"identity":"v2","map":"OBX-11"},{"identity":"rim","map":"status Amended & Final are differentiated by whether it is the subject of a ControlAct event with a type of \"revise\""}]},{"id":"Observation.category","path":"Observation.category","slicing":{"discriminator":[{"type":"value","path":"coding.code"},{"type":"value","path":"coding.system"}],"ordered":false,"rules":"open"},"short":"Classification of type of observation","definition":"A code that classifies the general type of observation being made.","comment":"In addition to the required category valueset, this element allows various categorization schemes based on the owner’s definition of the category and effectively multiple categories can be used at once. The level of granularity is defined by the category concepts in the value set.","requirements":"Used for filtering what observations are retrieved and displayed.","min":1,"max":"*","base":{"path":"Observation.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCategory"}],"strength":"preferred","description":"Codes for high level observation categories.","valueSet":"http://hl7.org/fhir/ValueSet/observation-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"}]},{"id":"Observation.category:VSCat","path":"Observation.category","sliceName":"VSCat","short":"Classification of type of observation","definition":"A code that classifies the general type of observation being made.","comment":"In addition to the required category valueset, this element allows various categorization schemes based on the owner’s definition of the category and effectively multiple categories can be used at once. The level of granularity is defined by the category concepts in the value set.","requirements":"Used for filtering what observations are retrieved and displayed.","min":1,"max":"1","base":{"path":"Observation.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCategory"}],"strength":"preferred","description":"Codes for high level observation categories.","valueSet":"http://hl7.org/fhir/ValueSet/observation-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"}]},{"id":"Observation.category:VSCat.id","path":"Observation.category.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.extension","path":"Observation.category.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.coding","path":"Observation.category.coding","short":"Code defined by a terminology system","definition":"A reference to a code defined by a terminology system.","comment":"Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.","requirements":"Allows for alternative encodings within a code system, and translations to other code systems.","min":1,"max":"*","base":{"path":"CodeableConcept.coding","min":0,"max":"*"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1-8, C*E.10-22"},{"identity":"rim","map":"union(., ./translation)"},{"identity":"orim","map":"fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"}]},{"id":"Observation.category:VSCat.coding.id","path":"Observation.category.coding.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.coding.extension","path":"Observation.category.coding.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.category:VSCat.coding.system","path":"Observation.category.coding.system","short":"Identity of the terminology system","definition":"The identification of the code system that defines the meaning of the symbol in the code.","comment":"The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...). OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should reference to some definition that establishes the system clearly and unambiguously.","requirements":"Need to be unambiguous about the source of the definition of the symbol.","min":1,"max":"1","base":{"path":"Coding.system","min":0,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"http://terminology.hl7.org/CodeSystem/observation-category","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.3"},{"identity":"rim","map":"./codeSystem"},{"identity":"orim","map":"fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"}]},{"id":"Observation.category:VSCat.coding.version","path":"Observation.category.coding.version","short":"Version of the system - if relevant","definition":"The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.","comment":"Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.","min":0,"max":"1","base":{"path":"Coding.version","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.7"},{"identity":"rim","map":"./codeSystemVersion"},{"identity":"orim","map":"fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"}]},{"id":"Observation.category:VSCat.coding.code","path":"Observation.category.coding.code","short":"Symbol in syntax defined by the system","definition":"A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).","requirements":"Need to refer to a particular code in the system.","min":1,"max":"1","base":{"path":"Coding.code","min":0,"max":"1"},"type":[{"code":"code"}],"fixedCode":"vital-signs","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1"},{"identity":"rim","map":"./code"},{"identity":"orim","map":"fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"}]},{"id":"Observation.category:VSCat.coding.display","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.category.coding.display","short":"Representation defined by the system","definition":"A representation of the meaning of the code in the system, following the rules of the system.","requirements":"Need to be able to carry a human-readable meaning of the code for readers that do not know the system.","min":0,"max":"1","base":{"path":"Coding.display","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.2 - but note this is not well followed"},{"identity":"rim","map":"CV.displayName"},{"identity":"orim","map":"fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"}]},{"id":"Observation.category:VSCat.coding.userSelected","path":"Observation.category.coding.userSelected","short":"If this coding was chosen directly by the user","definition":"Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).","comment":"Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.","requirements":"This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.","min":0,"max":"1","base":{"path":"Coding.userSelected","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Sometimes implied by being first"},{"identity":"rim","map":"CD.codingRationale"},{"identity":"orim","map":"fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map; fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\\#true a [ fhir:source \"true\"; fhir:target dt:CDCoding.codingRationale\\#O ]"}]},{"id":"Observation.category:VSCat.text","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.category.text","short":"Plain text representation of the concept","definition":"A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.","comment":"Very often the text is the same as a displayName of one of the codings.","requirements":"The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.","min":0,"max":"1","base":{"path":"CodeableConcept.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.9. But note many systems use C*E.2 for this"},{"identity":"rim","map":"./originalText[mediaType/code=\"text/plain\"]/data"},{"identity":"orim","map":"fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"}]},{"id":"Observation.code","path":"Observation.code","short":"Oxygen Saturation by Pulse Oximetry","definition":"Oxygen Saturation.","comment":"The code (59408-5 Oxygen saturation in Arterial blood by Pulse oximetry) is included as an additional observation code to FHIR Core vital Oxygen Saturation code (2708-6 Oxygen saturation in Arterial blood -).","requirements":"5. SHALL contain exactly one [1..1] code, where the @code SHOULD be selected from ValueSet HITSP Vital Sign Result Type 2.16.840.1.113883.3.88.12.80.62 DYNAMIC (CONF:7301).","alias":["Name","Test"],"min":1,"max":"1","base":{"path":"Observation.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSigns"}],"strength":"extensible","description":"This identifies the vital sign result type.","valueSet":"http://hl7.org/fhir/ValueSet/observation-vitalsignresult"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR < 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"},{"identity":"sct-attr","map":"116680003 |Is a|"}]},{"id":"Observation.code.id","path":"Observation.code.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.code.extension","path":"Observation.code.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.code.coding","path":"Observation.code.coding","slicing":{"discriminator":[{"type":"value","path":"code"},{"type":"value","path":"system"}],"ordered":false,"rules":"open"},"short":"Code defined by a terminology system","definition":"A reference to a code defined by a terminology system.","comment":"Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.","requirements":"Allows for alternative encodings within a code system, and translations to other code systems.","min":0,"max":"*","base":{"path":"CodeableConcept.coding","min":0,"max":"*"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1-8, C*E.10-22"},{"identity":"rim","map":"union(., ./translation)"},{"identity":"orim","map":"fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"}]},{"id":"Observation.code.coding:OxygenSatCode","path":"Observation.code.coding","sliceName":"OxygenSatCode","short":"Code defined by a terminology system","definition":"A reference to a code defined by a terminology system.","comment":"Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.","requirements":"Allows for alternative encodings within a code system, and translations to other code systems.","min":1,"max":"1","base":{"path":"CodeableConcept.coding","min":0,"max":"*"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1-8, C*E.10-22"},{"identity":"rim","map":"union(., ./translation)"},{"identity":"orim","map":"fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"}]},{"id":"Observation.code.coding:OxygenSatCode.id","path":"Observation.code.coding.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.code.coding:OxygenSatCode.extension","path":"Observation.code.coding.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.code.coding:OxygenSatCode.system","path":"Observation.code.coding.system","short":"Identity of the terminology system","definition":"The identification of the code system that defines the meaning of the symbol in the code.","comment":"The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...). OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should reference to some definition that establishes the system clearly and unambiguously.","requirements":"Need to be unambiguous about the source of the definition of the symbol.","min":1,"max":"1","base":{"path":"Coding.system","min":0,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"http://loinc.org","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.3"},{"identity":"rim","map":"./codeSystem"},{"identity":"orim","map":"fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"}]},{"id":"Observation.code.coding:OxygenSatCode.version","path":"Observation.code.coding.version","short":"Version of the system - if relevant","definition":"The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.","comment":"Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.","min":0,"max":"1","base":{"path":"Coding.version","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.7"},{"identity":"rim","map":"./codeSystemVersion"},{"identity":"orim","map":"fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"}]},{"id":"Observation.code.coding:OxygenSatCode.code","path":"Observation.code.coding.code","short":"Symbol in syntax defined by the system","definition":"A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).","requirements":"Need to refer to a particular code in the system.","min":1,"max":"1","base":{"path":"Coding.code","min":0,"max":"1"},"type":[{"code":"code"}],"fixedCode":"2708-6","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1"},{"identity":"rim","map":"./code"},{"identity":"orim","map":"fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"}]},{"id":"Observation.code.coding:OxygenSatCode.display","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.code.coding.display","short":"Representation defined by the system","definition":"A representation of the meaning of the code in the system, following the rules of the system.","requirements":"Need to be able to carry a human-readable meaning of the code for readers that do not know the system.","min":0,"max":"1","base":{"path":"Coding.display","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.2 - but note this is not well followed"},{"identity":"rim","map":"CV.displayName"},{"identity":"orim","map":"fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"}]},{"id":"Observation.code.coding:OxygenSatCode.userSelected","path":"Observation.code.coding.userSelected","short":"If this coding was chosen directly by the user","definition":"Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).","comment":"Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.","requirements":"This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.","min":0,"max":"1","base":{"path":"Coding.userSelected","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Sometimes implied by being first"},{"identity":"rim","map":"CD.codingRationale"},{"identity":"orim","map":"fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map; fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\\#true a [ fhir:source \"true\"; fhir:target dt:CDCoding.codingRationale\\#O ]"}]},{"id":"Observation.code.coding:PulseOx","path":"Observation.code.coding","sliceName":"PulseOx","short":"Code defined by a terminology system","definition":"A reference to a code defined by a terminology system.","comment":"Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.","requirements":"Allows for alternative encodings within a code system, and translations to other code systems.","min":1,"max":"1","base":{"path":"CodeableConcept.coding","min":0,"max":"*"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1-8, C*E.10-22"},{"identity":"rim","map":"union(., ./translation)"},{"identity":"orim","map":"fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"}]},{"id":"Observation.code.coding:PulseOx.id","path":"Observation.code.coding.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.code.coding:PulseOx.extension","path":"Observation.code.coding.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.code.coding:PulseOx.system","path":"Observation.code.coding.system","short":"Identity of the terminology system","definition":"The identification of the code system that defines the meaning of the symbol in the code.","comment":"The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...). OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should reference to some definition that establishes the system clearly and unambiguously.","requirements":"Need to be unambiguous about the source of the definition of the symbol.","min":1,"max":"1","base":{"path":"Coding.system","min":0,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"http://loinc.org","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.3"},{"identity":"rim","map":"./codeSystem"},{"identity":"orim","map":"fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"}]},{"id":"Observation.code.coding:PulseOx.version","path":"Observation.code.coding.version","short":"Version of the system - if relevant","definition":"The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured, and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.","comment":"Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.","min":0,"max":"1","base":{"path":"Coding.version","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.7"},{"identity":"rim","map":"./codeSystemVersion"},{"identity":"orim","map":"fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"}]},{"id":"Observation.code.coding:PulseOx.code","path":"Observation.code.coding.code","short":"Symbol in syntax defined by the system","definition":"A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).","requirements":"Need to refer to a particular code in the system.","min":1,"max":"1","base":{"path":"Coding.code","min":0,"max":"1"},"type":[{"code":"code"}],"fixedCode":"59408-5","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.1"},{"identity":"rim","map":"./code"},{"identity":"orim","map":"fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"}]},{"id":"Observation.code.coding:PulseOx.display","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.code.coding.display","short":"Representation defined by the system","definition":"A representation of the meaning of the code in the system, following the rules of the system.","requirements":"Need to be able to carry a human-readable meaning of the code for readers that do not know the system.","min":0,"max":"1","base":{"path":"Coding.display","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.2 - but note this is not well followed"},{"identity":"rim","map":"CV.displayName"},{"identity":"orim","map":"fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"}]},{"id":"Observation.code.coding:PulseOx.userSelected","path":"Observation.code.coding.userSelected","short":"If this coding was chosen directly by the user","definition":"Indicates that this coding was chosen by a user directly - e.g. off a pick list of available items (codes or displays).","comment":"Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.","requirements":"This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.","min":0,"max":"1","base":{"path":"Coding.userSelected","min":0,"max":"1"},"type":[{"code":"boolean"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Sometimes implied by being first"},{"identity":"rim","map":"CD.codingRationale"},{"identity":"orim","map":"fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map; fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\\#true a [ fhir:source \"true\"; fhir:target dt:CDCoding.codingRationale\\#O ]"}]},{"id":"Observation.code.text","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.code.text","short":"Plain text representation of the concept","definition":"A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.","comment":"Very often the text is the same as a displayName of one of the codings.","requirements":"The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.","min":0,"max":"1","base":{"path":"CodeableConcept.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"C*E.9. But note many systems use C*E.2 for this"},{"identity":"rim","map":"./originalText[mediaType/code=\"text/plain\"]/data"},{"identity":"orim","map":"fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"}]},{"id":"Observation.subject","path":"Observation.subject","short":"Who and/or what the observation is about","definition":"The patient, or group of patients, location, or device this observation is about and into whose record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation.","comment":"One would expect this element to be a cardinality of 1..1. The only circumstance in which the subject can be missing is when the observation is made by a device that does not know the patient. In this case, the observation SHALL be matched to a patient through some context/channel matching technique, and at this point, the observation should be updated.","requirements":"Observations have no value if you don't know who or what they're about.","min":1,"max":"1","base":{"path":"Observation.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":"participation[typeCode=RTGT] "},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"Observation.focus","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"path":"Observation.focus","short":"What the observation is about, when it is not about the subject of record","definition":"The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record. The focus of an observation could also be an existing condition, an intervention, the subject's diet, another observation of the subject, or a body structure such as tumor or implanted device. An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.","comment":"Typically, an observation is made about the subject - a patient, or group of patients, location, or device - and the distinction between the subject and what is directly measured for an observation is specified in the observation code itself ( e.g., \"Blood Glucose\") and does not need to be represented separately using this element. Use `specimen` if a reference to a specimen is required. If a code is required instead of a resource use either `bodysite` for bodysites or the standard extension [focusCode](http://hl7.org/fhir/extension-observation-focuscode.html).","min":0,"max":"*","base":{"path":"Observation.focus","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"participation[typeCode=SBJ]"},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"Observation.encounter","path":"Observation.encounter","short":"Healthcare event during which this observation is made","definition":"The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.","comment":"This will typically be the encounter the event occurred within, but some events may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter (e.g. pre-admission laboratory tests).","requirements":"For some observations it may be important to know the link between an observation and a particular encounter.","alias":["Context"],"min":0,"max":"1","base":{"path":"Observation.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1"},{"identity":"rim","map":"inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN]"}]},{"id":"Observation.effective[x]","path":"Observation.effective[x]","short":"Often just a dateTime for Vital Signs","definition":"Often just a dateTime for Vital Signs.","comment":"At least a date should be present unless this observation is a historical report. For recording imprecise or \"fuzzy\" times (For example, a blood glucose measurement taken \"after breakfast\") use the [Timing](http://hl7.org/fhir/datatypes.html#timing) datatype which allow the measurement to be tied to regular life events.","requirements":"Knowing when an observation was deemed true is important to its relevance as well as determining trends.","alias":["Occurrence"],"min":1,"max":"1","base":{"path":"Observation.effective[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Period"}],"condition":["vs-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"vs-1","severity":"error","human":"if Observation.effective[x] is dateTime and has a value then that value shall be precise to the day","expression":"($this as dateTime).toString().length() >= 8","xpath":"f:effectiveDateTime[matches(@value, '^\\d{4}-\\d{2}-\\d{2}')]"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"OBX-14, and/or OBX-19 after v2.4 (depends on who observation made)"},{"identity":"rim","map":"effectiveTime"}]},{"id":"Observation.issued","path":"Observation.issued","short":"Date/Time this version was made available","definition":"The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.","comment":"For Observations that don’t require review and verification, it may be the same as the [`lastUpdated` ](http://hl7.org/fhir/resource-definitions.html#Meta.lastUpdated) time of the resource itself. For Observations that do require review and verification for certain updates, it might not be the same as the `lastUpdated` time of the resource itself due to a non-clinically significant update that doesn’t require the new version to be reviewed and verified again.","min":0,"max":"1","base":{"path":"Observation.issued","min":0,"max":"1"},"type":[{"code":"instant"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"v2","map":"OBR.22 (or MSH.7), or perhaps OBX-19 (depends on who observation made)"},{"identity":"rim","map":"participation[typeCode=AUT].time"}]},{"id":"Observation.performer","path":"Observation.performer","short":"Who is responsible for the observation","definition":"Who was responsible for asserting the observed value as \"true\".","requirements":"May give a degree of confidence in the observation and also indicates where follow-up questions should be directed.","min":0,"max":"*","base":{"path":"Observation.performer","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/CareTeam","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"OBX.15 / (Practitioner) OBX-16, PRT-5:PRT-4='RO' / (Device) OBX-18 , PRT-10:PRT-4='EQUIP' / (Organization) OBX-23, PRT-8:PRT-4='PO'"},{"identity":"rim","map":"participation[typeCode=PRF]"}]},{"id":"Observation.value[x]","path":"Observation.value[x]","slicing":{"discriminator":[{"type":"type","path":"$this"}],"ordered":false,"rules":"closed"},"short":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","definition":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","comment":"An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":0,"max":"1","base":{"path":"Observation.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"}],"condition":["obs-7","vs-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"sct-concept","map":"< 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.value[x]:valueQuantity","path":"Observation.value[x]","sliceName":"valueQuantity","short":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","definition":"Vital Signs value are recorded using the Quantity data type. For supporting observations such as Cuff size could use other datatypes such as CodeableConcept.","comment":"An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":0,"max":"1","base":{"path":"Observation.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"}],"condition":["obs-7","vs-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"sct-concept","map":"< 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.value[x]:valueQuantity.id","path":"Observation.value[x].id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.value[x]:valueQuantity.extension","path":"Observation.value[x].extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.value[x]:valueQuantity.value","path":"Observation.value[x].value","short":"Numerical value (with implicit precision)","definition":"The value of the measured amount. The value includes an implicit precision in the presentation of the value.","comment":"The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books).","requirements":"Precision is handled implicitly in almost all cases of measurement.","min":1,"max":"1","base":{"path":"Quantity.value","min":0,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"SN.2 / CQ - N/A"},{"identity":"rim","map":"PQ.value, CO.value, MO.value, IVL.high or IVL.low depending on the value"}]},{"id":"Observation.value[x]:valueQuantity.comparator","path":"Observation.value[x].comparator","short":"< | <= | >= | > - how to understand the value","definition":"How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is \"<\" , then the real value is < stated value.","requirements":"Need a framework for handling measures where the value is <5ug/L or >400mg/L due to the limitations of measuring methodology.","min":0,"max":"1","base":{"path":"Quantity.comparator","min":0,"max":"1"},"type":[{"code":"code"}],"meaningWhenMissing":"If there is no comparator, then there is no modification of the value","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because the comparator modifies the interpretation of the value significantly. If there is no comparator, then there is no modification of the value","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"QuantityComparator"}],"strength":"required","description":"How the Quantity should be understood and represented.","valueSet":"http://hl7.org/fhir/ValueSet/quantity-comparator|4.0.1"},"mapping":[{"identity":"v2","map":"SN.1 / CQ.1"},{"identity":"rim","map":"IVL properties"}]},{"id":"Observation.value[x]:valueQuantity.unit","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.value[x].unit","short":"Unit representation","definition":"A human-readable form of the unit.","requirements":"There are many representations for units of measure and in many contexts, particular representations are fixed and required. I.e. mcg for micrograms.","min":1,"max":"1","base":{"path":"Quantity.unit","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"PQ.unit"}]},{"id":"Observation.value[x]:valueQuantity.system","path":"Observation.value[x].system","short":"System that defines coded unit form","definition":"The identification of the system that provides the coded form of the unit.","requirements":"Need to know the system that defines the coded form of the unit.","min":1,"max":"1","base":{"path":"Quantity.system","min":0,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"http://unitsofmeasure.org","condition":["qty-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"CO.codeSystem, PQ.translation.codeSystem"}]},{"id":"Observation.value[x]:valueQuantity.code","path":"Observation.value[x].code","short":"Coded responses from the common UCUM units for vital signs value set.","definition":"Coded responses from the common UCUM units for vital signs value set.","comment":"The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency. The context of use may additionally require a code from a particular system.","requirements":"Need a computable form of the unit that is fixed across all forms. UCUM provides this for quantities, but SNOMED CT provides many units of interest.","min":1,"max":"1","base":{"path":"Quantity.code","min":0,"max":"1"},"type":[{"code":"code"}],"fixedCode":"%","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"PQ.code, MO.currency, PQ.translation.code"}]},{"id":"Observation.dataAbsentReason","path":"Observation.dataAbsentReason","short":"Why the result is missing","definition":"Provides a reason why the expected value in the element Observation.value[x] is missing.","comment":"Null or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"specimen unsatisfactory\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Note that an observation may only be reported if there are values to report. For example differential cell counts values may be reported only when > 0. Because of these options, use-case agreements are required to interpret general observations for null or exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6","vs-2"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.interpretation","path":"Observation.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.note","path":"Observation.note","short":"Comments about the observation","definition":"Comments about the observation or the results.","comment":"May include general statements about the observation, or statements about significant, unexpected or unreliable results values, or information about its source when relevant to its interpretation.","requirements":"Need to be able to provide free text additional information.","min":0,"max":"*","base":{"path":"Observation.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NTE.3 (partner NTE to OBX, or sometimes another (child?) OBX)"},{"identity":"rim","map":"subjectOf.observationEvent[code=\"annotation\"].value"}]},{"id":"Observation.bodySite","path":"Observation.bodySite","short":"Observed body part","definition":"Indicates the site on the subject's body where the observation was made (i.e. the target site).","comment":"Only used if not implicit in code found in Observation.code. In many systems, this may be represented as a related observation instead of an inline component. \n\nIf the use case requires BodySite to be handled as a separate resource (e.g. to identify and track separately) then use the standard extension[ bodySite](http://hl7.org/fhir/extension-bodysite.html).","min":0,"max":"1","base":{"path":"Observation.bodySite","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BodySite"}],"strength":"example","description":"Codes describing anatomical locations. May include laterality.","valueSet":"http://hl7.org/fhir/ValueSet/body-site"},"mapping":[{"identity":"sct-concept","map":"< 123037004 |Body structure|"},{"identity":"v2","map":"OBX-20"},{"identity":"rim","map":"targetSiteCode"},{"identity":"sct-attr","map":"718497002 |Inherent location|"}]},{"id":"Observation.method","path":"Observation.method","short":"How it was done","definition":"Indicates the mechanism used to perform the observation.","comment":"Only used if not implicit in code for Observation.code.","requirements":"In some cases, method can impact results and is thus used for determining whether results can be compared or determining significance of results.","min":0,"max":"1","base":{"path":"Observation.method","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationMethod"}],"strength":"example","description":"Methods for simple observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-methods"},"mapping":[{"identity":"v2","map":"OBX-17"},{"identity":"rim","map":"methodCode"}]},{"id":"Observation.specimen","path":"Observation.specimen","short":"Specimen used for this observation","definition":"The specimen that was used when this observation was made.","comment":"Should only be used if not implicit in code found in `Observation.code`. Observations are not made on specimens themselves; they are made on a subject, but in many cases by the means of a specimen. Note that although specimens are often involved, they are not always tracked and reported explicitly. Also note that observation resources may be used in contexts that track the specimen explicitly (e.g. Diagnostic Report).","min":0,"max":"1","base":{"path":"Observation.specimen","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Specimen"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"sct-concept","map":"< 123038009 |Specimen|"},{"identity":"v2","map":"SPM segment"},{"identity":"rim","map":"participation[typeCode=SPC].specimen"},{"identity":"sct-attr","map":"704319004 |Inherent in|"}]},{"id":"Observation.device","path":"Observation.device","short":"(Measurement) Device","definition":"The device used to generate the observation data.","comment":"Note that this is not meant to represent a device involved in the transmission of the result, e.g., a gateway. Such devices may be documented using the Provenance resource where relevant.","min":0,"max":"1","base":{"path":"Observation.device","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/DeviceMetric"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"sct-concept","map":"< 49062001 |Device|"},{"identity":"v2","map":"OBX-17 / PRT -10"},{"identity":"rim","map":"participation[typeCode=DEV]"},{"identity":"sct-attr","map":"424226004 |Using device|"}]},{"id":"Observation.referenceRange","path":"Observation.referenceRange","short":"Provides guide for interpretation","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an \"OR\". In other words, to represent two distinct target populations, two `referenceRange` elements would be used.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.referenceRange","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"obs-3","severity":"error","human":"Must have at least a low or a high or text","expression":"low.exists() or high.exists() or text.exists()","xpath":"(exists(f:low) or exists(f:high)or exists(f:text))"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]},{"id":"Observation.referenceRange.id","path":"Observation.referenceRange.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.referenceRange.extension","path":"Observation.referenceRange.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.referenceRange.modifierExtension","path":"Observation.referenceRange.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.referenceRange.low","path":"Observation.referenceRange.low","short":"Low Range, if relevant","definition":"The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).","min":0,"max":"1","base":{"path":"Observation.referenceRange.low","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"condition":["obs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:IVL_PQ.low"}]},{"id":"Observation.referenceRange.high","path":"Observation.referenceRange.high","short":"High Range, if relevant","definition":"The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).","min":0,"max":"1","base":{"path":"Observation.referenceRange.high","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"condition":["obs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:IVL_PQ.high"}]},{"id":"Observation.referenceRange.type","path":"Observation.referenceRange.type","short":"Reference range qualifier","definition":"Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.","comment":"This SHOULD be populated if there is more than one range. If this element is not present then the normal range is assumed.","requirements":"Need to be able to say what kind of reference range this is - normal, recommended, therapeutic, etc., - for proper interpretation.","min":0,"max":"1","base":{"path":"Observation.referenceRange.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationRangeMeaning"}],"strength":"preferred","description":"Code for the meaning of a reference range.","valueSet":"http://hl7.org/fhir/ValueSet/referencerange-meaning"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values| OR \r< 365860008 |General clinical state finding| \rOR \r< 250171008 |Clinical history or observation findings| OR \r< 415229000 |Racial group| OR \r< 365400002 |Finding of puberty stage| OR\r< 443938003 |Procedure carried out on subject|"},{"identity":"v2","map":"OBX-10"},{"identity":"rim","map":"interpretationCode"}]},{"id":"Observation.referenceRange.appliesTo","path":"Observation.referenceRange.appliesTo","short":"Reference range population","definition":"Codes to indicate the target population this reference range applies to. For example, a reference range may be based on the normal population or a particular sex or race. Multiple `appliesTo` are interpreted as an \"AND\" of the target populations. For example, to represent a target population of African American females, both a code of female and a code for African American would be used.","comment":"This SHOULD be populated if there is more than one range. If this element is not present then the normal population is assumed.","requirements":"Need to be able to identify the target population for proper interpretation.","min":0,"max":"*","base":{"path":"Observation.referenceRange.appliesTo","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationRangeType"}],"strength":"example","description":"Codes identifying the population the reference range applies to.","valueSet":"http://hl7.org/fhir/ValueSet/referencerange-appliesto"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values| OR \r< 365860008 |General clinical state finding| \rOR \r< 250171008 |Clinical history or observation findings| OR \r< 415229000 |Racial group| OR \r< 365400002 |Finding of puberty stage| OR\r< 443938003 |Procedure carried out on subject|"},{"identity":"v2","map":"OBX-10"},{"identity":"rim","map":"interpretationCode"}]},{"id":"Observation.referenceRange.age","path":"Observation.referenceRange.age","short":"Applicable age range, if relevant","definition":"The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.","requirements":"Some analytes vary greatly over age.","min":0,"max":"1","base":{"path":"Observation.referenceRange.age","min":0,"max":"1"},"type":[{"code":"Range"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"outboundRelationship[typeCode=PRCN].targetObservationCriterion[code=\"age\"].value"}]},{"id":"Observation.referenceRange.text","path":"Observation.referenceRange.text","short":"Text based reference range in an observation","definition":"Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of \"Negative\" or a list or table of \"normals\".","min":0,"max":"1","base":{"path":"Observation.referenceRange.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:ST"}]},{"id":"Observation.hasMember","path":"Observation.hasMember","short":"Used when reporting vital signs panel components","definition":"Used when reporting vital signs panel components.","comment":"When using this element, an observation will typically have either a value or a set of related resources, although both may be present in some cases. For a discussion on the ways Observations can assembled in groups together, see [Notes](http://hl7.org/fhir/observation.html#obsgrouping) below. Note that a system may calculate results from [QuestionnaireResponse](http://hl7.org/fhir/questionnaireresponse.html) into a final score and represent the score as an Observation.","min":0,"max":"*","base":{"path":"Observation.hasMember","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","http://hl7.org/fhir/StructureDefinition/MolecularSequence","http://hl7.org/fhir/StructureDefinition/vitalsigns"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Relationships established by OBX-4 usage"},{"identity":"rim","map":"outBoundRelationship"}]},{"id":"Observation.derivedFrom","path":"Observation.derivedFrom","short":"Related measurements the observation is made from","definition":"The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.","comment":"All the reference choices that are listed in this element can represent clinical observations and other measurements that may be the source for a derived value. The most common reference will be another Observation. For a discussion on the ways Observations can assembled in groups together, see [Notes](http://hl7.org/fhir/observation.html#obsgrouping) below.","min":0,"max":"*","base":{"path":"Observation.derivedFrom","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/DocumentReference","http://hl7.org/fhir/StructureDefinition/ImagingStudy","http://hl7.org/fhir/StructureDefinition/Media","http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","http://hl7.org/fhir/StructureDefinition/MolecularSequence","http://hl7.org/fhir/StructureDefinition/vitalsigns"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Relationships established by OBX-4 usage"},{"identity":"rim","map":".targetObservation"}]},{"id":"Observation.component","path":"Observation.component","slicing":{"discriminator":[{"type":"pattern","path":"code"}],"rules":"open"},"short":"Used when reporting systolic and diastolic blood pressure.","definition":"Used when reporting systolic and diastolic blood pressure.","comment":"For a discussion on the ways Observations can be assembled in groups together see [Notes](http://hl7.org/fhir/observation.html#notes) below.","requirements":"Component observations share the same attributes in the Observation resource as the primary observation and are always treated a part of a single observation (they are not separable). However, the reference range for the primary observation value is not inherited by the component values and is required when appropriate for each component observation.","min":0,"max":"*","base":{"path":"Observation.component","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"vs-3","severity":"error","human":"If there is no a value a data absent reason must be present","expression":"value.exists() or dataAbsentReason.exists()","xpath":"f:*[starts-with(local-name(.), 'value')] or f:dataAbsentReason","source":"http://hl7.org/fhir/StructureDefinition/oxygensat"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"containment by OBX-4?"},{"identity":"rim","map":"outBoundRelationship[typeCode=COMP]"}]},{"id":"Observation.component.id","path":"Observation.component.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component.extension","path":"Observation.component.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component.modifierExtension","path":"Observation.component.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.component.code","path":"Observation.component.code","short":"Type of component observation (code / type)","definition":"Describes what was observed. Sometimes this is called the observation \"code\".","comment":"*All* code-value and component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation.","requirements":"Knowing what kind of observation is being made is essential to understanding the observation.","min":1,"max":"1","base":{"path":"Observation.component.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSigns"}],"strength":"extensible","description":"This identifies the vital sign result type.","valueSet":"http://hl7.org/fhir/ValueSet/observation-vitalsignresult"},"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR \r< 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"}]},{"id":"Observation.component.value[x]","path":"Observation.component.value[x]","short":"Vital Sign Value recorded with UCUM","definition":"Vital Sign Value recorded with UCUM.","comment":"Used when observation has a set of component observations. An observation may have both a value (e.g. an Apgar score) and component observations (the observations from which the Apgar score was derived). If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":0,"max":"1","base":{"path":"Observation.component.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"},{"code":"CodeableConcept"},{"code":"string"},{"code":"boolean"},{"code":"integer"},{"code":"Range"},{"code":"Ratio"},{"code":"SampledData"},{"code":"time"},{"code":"dateTime"},{"code":"Period"}],"condition":["vs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSignsUnits"}],"strength":"required","description":"Common UCUM units for recording Vital Signs.","valueSet":"http://hl7.org/fhir/ValueSet/ucum-vitals-common|4.0.1"},"mapping":[{"identity":"sct-concept","map":"363714003 |Interprets| < 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.component.dataAbsentReason","path":"Observation.component.dataAbsentReason","short":"Why the component result is missing","definition":"Provides a reason why the expected value in the element Observation.component.value[x] is missing.","comment":"\"Null\" or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"test not done\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Because of these options, use-case agreements are required to interpret general observations for exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.component.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6","vs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.component.interpretation","path":"Observation.component.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.component.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.component.referenceRange","path":"Observation.component.referenceRange","short":"Provides guide for interpretation of component result","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.component.referenceRange","min":0,"max":"*"},"contentReference":"#Observation.referenceRange","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]},{"id":"Observation.component:FlowRate","path":"Observation.component","sliceName":"FlowRate","short":"Inhaled oxygen flow rate","definition":"Used when reporting systolic and diastolic blood pressure.","comment":"For a discussion on the ways Observations can be assembled in groups together see [Notes](http://hl7.org/fhir/observation.html#notes) below.","requirements":"Component observations share the same attributes in the Observation resource as the primary observation and are always treated a part of a single observation (they are not separable). However, the reference range for the primary observation value is not inherited by the component values and is required when appropriate for each component observation.","min":0,"max":"1","base":{"path":"Observation.component","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"vs-3","severity":"error","human":"If there is no a value a data absent reason must be present","expression":"value.exists() or dataAbsentReason.exists()","xpath":"f:*[starts-with(local-name(.), 'value')] or f:dataAbsentReason","source":"http://hl7.org/fhir/StructureDefinition/oxygensat"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"containment by OBX-4?"},{"identity":"rim","map":"outBoundRelationship[typeCode=COMP]"}]},{"id":"Observation.component:FlowRate.id","path":"Observation.component.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component:FlowRate.extension","path":"Observation.component.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component:FlowRate.modifierExtension","path":"Observation.component.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.component:FlowRate.code","path":"Observation.component.code","short":"Type of component observation (code / type)","definition":"Describes what was observed. Sometimes this is called the observation \"code\".","comment":"*All* code-value and component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation.","requirements":"Knowing what kind of observation is being made is essential to understanding the observation.","min":1,"max":"1","base":{"path":"Observation.component.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"3151-8"}]},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSigns"}],"strength":"extensible","description":"This identifies the vital sign result type.","valueSet":"http://hl7.org/fhir/ValueSet/observation-vitalsignresult"},"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR \r< 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"}]},{"id":"Observation.component:FlowRate.value[x]","path":"Observation.component.value[x]","short":"Vital Sign Value recorded with UCUM","definition":"Vital Sign Value recorded with UCUM.","comment":"Used when observation has a set of component observations. An observation may have both a value (e.g. an Apgar score) and component observations (the observations from which the Apgar score was derived). If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":0,"max":"1","base":{"path":"Observation.component.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"}],"condition":["vs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSignsUnits"}],"strength":"required","description":"Common UCUM units for recording Vital Signs.","valueSet":"http://hl7.org/fhir/ValueSet/ucum-vitals-common|4.0.1"},"mapping":[{"identity":"sct-concept","map":"363714003 |Interprets| < 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.component:FlowRate.value[x].id","path":"Observation.component.value[x].id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component:FlowRate.value[x].extension","path":"Observation.component.value[x].extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component:FlowRate.value[x].value","path":"Observation.component.value[x].value","short":"Numerical value (with implicit precision)","definition":"The value of the measured amount. The value includes an implicit precision in the presentation of the value.","comment":"The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books).","requirements":"Precision is handled implicitly in almost all cases of measurement.","min":0,"max":"1","base":{"path":"Quantity.value","min":0,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"SN.2 / CQ - N/A"},{"identity":"rim","map":"PQ.value, CO.value, MO.value, IVL.high or IVL.low depending on the value"}]},{"id":"Observation.component:FlowRate.value[x].comparator","path":"Observation.component.value[x].comparator","short":"< | <= | >= | > - how to understand the value","definition":"How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is \"<\" , then the real value is < stated value.","requirements":"Need a framework for handling measures where the value is <5ug/L or >400mg/L due to the limitations of measuring methodology.","min":0,"max":"1","base":{"path":"Quantity.comparator","min":0,"max":"1"},"type":[{"code":"code"}],"meaningWhenMissing":"If there is no comparator, then there is no modification of the value","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because the comparator modifies the interpretation of the value significantly. If there is no comparator, then there is no modification of the value","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"QuantityComparator"}],"strength":"required","description":"How the Quantity should be understood and represented.","valueSet":"http://hl7.org/fhir/ValueSet/quantity-comparator|4.0.1"},"mapping":[{"identity":"v2","map":"SN.1 / CQ.1"},{"identity":"rim","map":"IVL properties"}]},{"id":"Observation.component:FlowRate.value[x].unit","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.component.value[x].unit","short":"Unit representation","definition":"A human-readable form of the unit.","requirements":"There are many representations for units of measure and in many contexts, particular representations are fixed and required. I.e. mcg for micrograms.","min":0,"max":"1","base":{"path":"Quantity.unit","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"PQ.unit"}]},{"id":"Observation.component:FlowRate.value[x].system","path":"Observation.component.value[x].system","short":"System that defines coded unit form","definition":"The identification of the system that provides the coded form of the unit.","requirements":"Need to know the system that defines the coded form of the unit.","min":1,"max":"1","base":{"path":"Quantity.system","min":0,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"http://unitsofmeasure.org","condition":["qty-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"CO.codeSystem, PQ.translation.codeSystem"}]},{"id":"Observation.component:FlowRate.value[x].code","path":"Observation.component.value[x].code","short":"Coded form of the unit","definition":"A computer processable form of the unit in some unit representation system.","comment":"The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency. The context of use may additionally require a code from a particular system.","requirements":"Need a computable form of the unit that is fixed across all forms. UCUM provides this for quantities, but SNOMED CT provides many units of interest.","min":1,"max":"1","base":{"path":"Quantity.code","min":0,"max":"1"},"type":[{"code":"code"}],"fixedCode":"l/min","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"PQ.code, MO.currency, PQ.translation.code"}]},{"id":"Observation.component:FlowRate.dataAbsentReason","path":"Observation.component.dataAbsentReason","short":"Why the component result is missing","definition":"Provides a reason why the expected value in the element Observation.component.value[x] is missing.","comment":"\"Null\" or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"test not done\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Because of these options, use-case agreements are required to interpret general observations for exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.component.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6","vs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.component:FlowRate.interpretation","path":"Observation.component.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.component.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.component:FlowRate.referenceRange","path":"Observation.component.referenceRange","short":"Provides guide for interpretation of component result","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.component.referenceRange","min":0,"max":"*"},"contentReference":"#Observation.referenceRange","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]},{"id":"Observation.component:Concentration","path":"Observation.component","sliceName":"Concentration","short":"Inhaled oxygen concentration","definition":"Used when reporting systolic and diastolic blood pressure.","comment":"For a discussion on the ways Observations can be assembled in groups together see [Notes](http://hl7.org/fhir/observation.html#notes) below.","requirements":"Component observations share the same attributes in the Observation resource as the primary observation and are always treated a part of a single observation (they are not separable). However, the reference range for the primary observation value is not inherited by the component values and is required when appropriate for each component observation.","min":0,"max":"1","base":{"path":"Observation.component","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"vs-3","severity":"error","human":"If there is no a value a data absent reason must be present","expression":"value.exists() or dataAbsentReason.exists()","xpath":"f:*[starts-with(local-name(.), 'value')] or f:dataAbsentReason","source":"http://hl7.org/fhir/StructureDefinition/oxygensat"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"containment by OBX-4?"},{"identity":"rim","map":"outBoundRelationship[typeCode=COMP]"}]},{"id":"Observation.component:Concentration.id","path":"Observation.component.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component:Concentration.extension","path":"Observation.component.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component:Concentration.modifierExtension","path":"Observation.component.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.component:Concentration.code","path":"Observation.component.code","short":"Type of component observation (code / type)","definition":"Describes what was observed. Sometimes this is called the observation \"code\".","comment":"*All* code-value and component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation.","requirements":"Knowing what kind of observation is being made is essential to understanding the observation.","min":1,"max":"1","base":{"path":"Observation.component.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"3150-0"}]},"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSigns"}],"strength":"extensible","description":"This identifies the vital sign result type.","valueSet":"http://hl7.org/fhir/ValueSet/observation-vitalsignresult"},"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR \r< 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"}]},{"id":"Observation.component:Concentration.value[x]","path":"Observation.component.value[x]","short":"Vital Sign Value recorded with UCUM","definition":"Vital Sign Value recorded with UCUM.","comment":"Used when observation has a set of component observations. An observation may have both a value (e.g. an Apgar score) and component observations (the observations from which the Apgar score was derived). If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/observation.html#notes) below.","requirements":"9. SHALL contain exactly one [1..1] value with @xsi:type=\"PQ\" (CONF:7305).","min":0,"max":"1","base":{"path":"Observation.component.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"}],"condition":["vs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"VitalSignsUnits"}],"strength":"required","description":"Common UCUM units for recording Vital Signs.","valueSet":"http://hl7.org/fhir/ValueSet/ucum-vitals-common|4.0.1"},"mapping":[{"identity":"sct-concept","map":"363714003 |Interprets| < 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.component:Concentration.value[x].id","path":"Observation.component.value[x].id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component:Concentration.value[x].extension","path":"Observation.component.value[x].extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component:Concentration.value[x].value","path":"Observation.component.value[x].value","short":"Numerical value (with implicit precision)","definition":"The value of the measured amount. The value includes an implicit precision in the presentation of the value.","comment":"The implicit precision in the value should always be honored. Monetary values have their own rules for handling precision (refer to standard accounting text books).","requirements":"Precision is handled implicitly in almost all cases of measurement.","min":0,"max":"1","base":{"path":"Quantity.value","min":0,"max":"1"},"type":[{"code":"decimal"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"SN.2 / CQ - N/A"},{"identity":"rim","map":"PQ.value, CO.value, MO.value, IVL.high or IVL.low depending on the value"}]},{"id":"Observation.component:Concentration.value[x].comparator","path":"Observation.component.value[x].comparator","short":"< | <= | >= | > - how to understand the value","definition":"How the value should be understood and represented - whether the actual value is greater or less than the stated value due to measurement issues; e.g. if the comparator is \"<\" , then the real value is < stated value.","requirements":"Need a framework for handling measures where the value is <5ug/L or >400mg/L due to the limitations of measuring methodology.","min":0,"max":"1","base":{"path":"Quantity.comparator","min":0,"max":"1"},"type":[{"code":"code"}],"meaningWhenMissing":"If there is no comparator, then there is no modification of the value","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This is labeled as \"Is Modifier\" because the comparator modifies the interpretation of the value significantly. If there is no comparator, then there is no modification of the value","isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"QuantityComparator"}],"strength":"required","description":"How the Quantity should be understood and represented.","valueSet":"http://hl7.org/fhir/ValueSet/quantity-comparator|4.0.1"},"mapping":[{"identity":"v2","map":"SN.1 / CQ.1"},{"identity":"rim","map":"IVL properties"}]},{"id":"Observation.component:Concentration.value[x].unit","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable","valueBoolean":true}],"path":"Observation.component.value[x].unit","short":"Unit representation","definition":"A human-readable form of the unit.","requirements":"There are many representations for units of measure and in many contexts, particular representations are fixed and required. I.e. mcg for micrograms.","min":0,"max":"1","base":{"path":"Quantity.unit","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"PQ.unit"}]},{"id":"Observation.component:Concentration.value[x].system","path":"Observation.component.value[x].system","short":"System that defines coded unit form","definition":"The identification of the system that provides the coded form of the unit.","requirements":"Need to know the system that defines the coded form of the unit.","min":1,"max":"1","base":{"path":"Quantity.system","min":0,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"http://unitsofmeasure.org","condition":["qty-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"CO.codeSystem, PQ.translation.codeSystem"}]},{"id":"Observation.component:Concentration.value[x].code","path":"Observation.component.value[x].code","short":"Coded form of the unit","definition":"A computer processable form of the unit in some unit representation system.","comment":"The preferred system is UCUM, but SNOMED CT can also be used (for customary units) or ISO 4217 for currency. The context of use may additionally require a code from a particular system.","requirements":"Need a computable form of the unit that is fixed across all forms. UCUM provides this for quantities, but SNOMED CT provides many units of interest.","min":1,"max":"1","base":{"path":"Quantity.code","min":0,"max":"1"},"type":[{"code":"code"}],"fixedCode":"%","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"(see OBX.6 etc.) / CQ.2"},{"identity":"rim","map":"PQ.code, MO.currency, PQ.translation.code"}]},{"id":"Observation.component:Concentration.dataAbsentReason","path":"Observation.component.dataAbsentReason","short":"Why the component result is missing","definition":"Provides a reason why the expected value in the element Observation.component.value[x] is missing.","comment":"\"Null\" or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"test not done\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Because of these options, use-case agreements are required to interpret general observations for exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.component.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6","vs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.component:Concentration.interpretation","path":"Observation.component.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.component.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.component:Concentration.referenceRange","path":"Observation.component.referenceRange","short":"Provides guide for interpretation of component result","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.component.referenceRange","min":0,"max":"*"},"contentReference":"#Observation.referenceRange","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]}]},"differential":{"element":[{"id":"Observation","path":"Observation","definition":"This profile defines how to represent pulse oximetry and inspired oxygen concentration based on the FHIR Core Vitals Profile.\nINSPIRED OXYGEN CONCENTRATION observations in FHIR using a standard LOINC code and UCUM units of measure.","mustSupport":false},{"id":"Observation.code","path":"Observation.code","short":"Oxygen Saturation by Pulse Oximetry","comment":"The code (59408-5 Oxygen saturation in Arterial blood by Pulse oximetry) is included as an additional observation code to FHIR Core vital Oxygen Saturation code (2708-6 Oxygen saturation in Arterial blood -).","mustSupport":true},{"id":"Observation.code.coding","path":"Observation.code.coding","slicing":{"discriminator":[{"type":"value","path":"code"},{"type":"value","path":"system"}],"rules":"open"},"mustSupport":true},{"id":"Observation.code.coding:PulseOx","path":"Observation.code.coding","sliceName":"PulseOx","min":1,"max":"1","mustSupport":true},{"id":"Observation.code.coding:PulseOx.system","path":"Observation.code.coding.system","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"http://loinc.org","mustSupport":true},{"id":"Observation.code.coding:PulseOx.code","path":"Observation.code.coding.code","min":1,"max":"1","type":[{"code":"code"}],"fixedCode":"59408-5","mustSupport":true},{"id":"Observation.component","path":"Observation.component","slicing":{"discriminator":[{"type":"pattern","path":"code"}],"rules":"open"},"mustSupport":true},{"id":"Observation.component:FlowRate","path":"Observation.component","sliceName":"FlowRate","short":"Inhaled oxygen flow rate","min":0,"max":"1","mustSupport":true},{"id":"Observation.component:FlowRate.code","path":"Observation.component.code","type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"3151-8"}]},"mustSupport":true},{"id":"Observation.component:FlowRate.valueQuantity","path":"Observation.component.valueQuantity","mustSupport":true},{"id":"Observation.component:FlowRate.valueQuantity.value","path":"Observation.component.valueQuantity.value","mustSupport":true},{"id":"Observation.component:FlowRate.valueQuantity.unit","path":"Observation.component.valueQuantity.unit","mustSupport":true},{"id":"Observation.component:FlowRate.valueQuantity.system","path":"Observation.component.valueQuantity.system","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"http://unitsofmeasure.org","mustSupport":true},{"id":"Observation.component:FlowRate.valueQuantity.code","path":"Observation.component.valueQuantity.code","min":1,"max":"1","type":[{"code":"code"}],"fixedCode":"l/min","mustSupport":true},{"id":"Observation.component:Concentration","path":"Observation.component","sliceName":"Concentration","short":"Inhaled oxygen concentration","min":0,"max":"1","mustSupport":true},{"id":"Observation.component:Concentration.code","path":"Observation.component.code","type":[{"code":"CodeableConcept"}],"patternCodeableConcept":{"coding":[{"system":"http://loinc.org","code":"3150-0"}]},"mustSupport":true},{"id":"Observation.component:Concentration.valueQuantity","path":"Observation.component.valueQuantity","mustSupport":true},{"id":"Observation.component:Concentration.valueQuantity.value","path":"Observation.component.valueQuantity.value","mustSupport":true},{"id":"Observation.component:Concentration.valueQuantity.unit","path":"Observation.component.valueQuantity.unit","mustSupport":true},{"id":"Observation.component:Concentration.valueQuantity.system","path":"Observation.component.valueQuantity.system","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"http://unitsofmeasure.org","mustSupport":true},{"id":"Observation.component:Concentration.valueQuantity.code","path":"Observation.component.valueQuantity.code","min":1,"max":"1","type":[{"code":"code"}],"fixedCode":"%","mustSupport":true}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-race.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-race.json new file mode 100755 index 000000000..481ae4299 --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-race.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-race","text":{"status":"generated","div":"
    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    NameFlagsCard.TypeDescription & Constraints\"doco\"
    \".\"\".\" Extension 0..1US Core Race Extension
    \".\"\".\"\".\" extension:ombCategory S0..5ExtensionAmerican Indian or Alaska Native|Asian|Black or African American|Native Hawaiian or Other Pacific Islander|White
    \".\"\".\"\".\"\".\" url 1..1uri"ombCategory"
    \".\"\".\"\".\"\".\" valueCoding 1..1CodingBinding: OMB Race Categories (required)
    \".\"\".\"\".\" extension:detailed 0..*ExtensionExtended race codes
    \".\"\".\"\".\"\".\" url 1..1uri"detailed"
    \".\"\".\"\".\"\".\" valueCoding 1..1CodingBinding: Detailed Race (required)
    \".\"\".\"\".\" extension:text S1..1ExtensionRace Text
    \".\"\".\"\".\"\".\" url 1..1uri"text"
    \".\"\".\"\".\"\".\" valueString 1..1string
    \".\"\".\"\".\" url 1..1uri"http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"
    \".\"\".\"\".\" value[x] 0..0

    \"doco\" Documentation for this format
    "},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-race","version":"3.1.0","name":"USCoreRaceExtension","title":"US Core Race Extension","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The race codes used to represent these concepts are based upon the [CDC Race and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 921 reference race. The race concepts are grouped by and pre-mapped to the 5 OMB race categories:\n\n - American Indian or Alaska Native\n - Asian\n - Black or African American\n - Native Hawaiian or Other Pacific Islander\n - White.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"purpose":"Complies with 2015 Edition Common Clinical Data Set for patient race.","fhirVersion":"4.0.1","mapping":[{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"}],"kind":"complex-type","abstract":false,"context":[{"type":"element","expression":"Patient"}],"type":"Extension","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Extension","derivation":"constraint","snapshot":{"element":[{"id":"Extension","path":"Extension","short":"US Core Race Extension","definition":"Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The race codes used to represent these concepts are based upon the [CDC Race and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 921 reference race. The race concepts are grouped by and pre-mapped to the 5 OMB race categories:\n\n - American Indian or Alaska Native\n - Asian\n - Black or African American\n - Native Hawaiian or Other Pacific Islander\n - White.","min":0,"max":"1","base":{"path":"Extension","min":0,"max":"*"},"condition":["ele-1"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false},{"id":"Extension.id","path":"Extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension","path":"Extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:ombCategory","path":"Extension.extension","sliceName":"ombCategory","short":"American Indian or Alaska Native|Asian|Black or African American|Native Hawaiian or Other Pacific Islander|White","definition":"The 5 race category codes according to the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","min":0,"max":"5","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":true,"isModifier":false,"isSummary":false,"mapping":[{"identity":"iso11179","map":"/ClinicalDocument/recordTarget/patientRole/patient/raceCode"}]},{"id":"Extension.extension:ombCategory.id","path":"Extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:ombCategory.extension","path":"Extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:ombCategory.extension.id","path":"Extension.extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:ombCategory.extension.extension","path":"Extension.extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:ombCategory.extension.url","path":"Extension.extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:ombCategory.extension.value[x]","path":"Extension.extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"base64Binary"},{"code":"boolean"},{"code":"canonical"},{"code":"code"},{"code":"date"},{"code":"dateTime"},{"code":"decimal"},{"code":"id"},{"code":"instant"},{"code":"integer"},{"code":"markdown"},{"code":"oid"},{"code":"positiveInt"},{"code":"string"},{"code":"time"},{"code":"unsignedInt"},{"code":"uri"},{"code":"url"},{"code":"uuid"},{"code":"Address"},{"code":"Age"},{"code":"Annotation"},{"code":"Attachment"},{"code":"CodeableConcept"},{"code":"Coding"},{"code":"ContactPoint"},{"code":"Count"},{"code":"Distance"},{"code":"Duration"},{"code":"HumanName"},{"code":"Identifier"},{"code":"Money"},{"code":"Period"},{"code":"Quantity"},{"code":"Range"},{"code":"Ratio"},{"code":"Reference"},{"code":"SampledData"},{"code":"Signature"},{"code":"Timing"},{"code":"ContactDetail"},{"code":"Contributor"},{"code":"DataRequirement"},{"code":"Expression"},{"code":"ParameterDefinition"},{"code":"RelatedArtifact"},{"code":"TriggerDefinition"},{"code":"UsageContext"},{"code":"Dosage"},{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:ombCategory.url","path":"Extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"ombCategory","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:ombCategory.value[x]","path":"Extension.extension.value[x]","slicing":{"discriminator":[{"type":"type","path":"$this"}],"ordered":false,"rules":"closed"},"short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:ombCategory.value[x]:valueCoding","path":"Extension.extension.value[x]","sliceName":"valueCoding","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"strength":"required","description":"The 5 race category codes according to the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","valueSet":"http://hl7.org/fhir/us/core/ValueSet/omb-race-category"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:detailed","path":"Extension.extension","sliceName":"detailed","short":"Extended race codes","definition":"The 900+ CDC race codes that are grouped under one of the 5 OMB race category codes:.","min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"iso11179","map":"/ClinicalDocument/recordTarget/patientRole/patient/sdtc:raceCode"}]},{"id":"Extension.extension:detailed.id","path":"Extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:detailed.extension","path":"Extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:detailed.extension.id","path":"Extension.extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:detailed.extension.extension","path":"Extension.extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:detailed.extension.url","path":"Extension.extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:detailed.extension.value[x]","path":"Extension.extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"base64Binary"},{"code":"boolean"},{"code":"canonical"},{"code":"code"},{"code":"date"},{"code":"dateTime"},{"code":"decimal"},{"code":"id"},{"code":"instant"},{"code":"integer"},{"code":"markdown"},{"code":"oid"},{"code":"positiveInt"},{"code":"string"},{"code":"time"},{"code":"unsignedInt"},{"code":"uri"},{"code":"url"},{"code":"uuid"},{"code":"Address"},{"code":"Age"},{"code":"Annotation"},{"code":"Attachment"},{"code":"CodeableConcept"},{"code":"Coding"},{"code":"ContactPoint"},{"code":"Count"},{"code":"Distance"},{"code":"Duration"},{"code":"HumanName"},{"code":"Identifier"},{"code":"Money"},{"code":"Period"},{"code":"Quantity"},{"code":"Range"},{"code":"Ratio"},{"code":"Reference"},{"code":"SampledData"},{"code":"Signature"},{"code":"Timing"},{"code":"ContactDetail"},{"code":"Contributor"},{"code":"DataRequirement"},{"code":"Expression"},{"code":"ParameterDefinition"},{"code":"RelatedArtifact"},{"code":"TriggerDefinition"},{"code":"UsageContext"},{"code":"Dosage"},{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:detailed.url","path":"Extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"detailed","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:detailed.value[x]","path":"Extension.extension.value[x]","slicing":{"discriminator":[{"type":"type","path":"$this"}],"ordered":false,"rules":"closed"},"short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:detailed.value[x]:valueCoding","path":"Extension.extension.value[x]","sliceName":"valueCoding","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"Coding"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"strength":"required","description":"The [900+ CDC Race codes](http://www.cdc.gov/phin/resources/vocabulary/index.html) that are grouped under one of the 5 OMB race category codes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/detailed-race"},"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:text","path":"Extension.extension","sliceName":"text","short":"Race Text","definition":"Plain text representation of the race concept(s).","min":1,"max":"1","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"mustSupport":true,"isModifier":false,"isSummary":false},{"id":"Extension.extension:text.id","path":"Extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:text.extension","path":"Extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:text.extension.id","path":"Extension.extension.extension.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:text.extension.extension","path":"Extension.extension.extension.extension","slicing":{"discriminator":[{"type":"value","path":"url"}],"description":"Extensions are always sliced by (at least) url","rules":"open"},"short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Extension.extension:text.extension.url","path":"Extension.extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:text.extension.value[x]","path":"Extension.extension.extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"base64Binary"},{"code":"boolean"},{"code":"canonical"},{"code":"code"},{"code":"date"},{"code":"dateTime"},{"code":"decimal"},{"code":"id"},{"code":"instant"},{"code":"integer"},{"code":"markdown"},{"code":"oid"},{"code":"positiveInt"},{"code":"string"},{"code":"time"},{"code":"unsignedInt"},{"code":"uri"},{"code":"url"},{"code":"uuid"},{"code":"Address"},{"code":"Age"},{"code":"Annotation"},{"code":"Attachment"},{"code":"CodeableConcept"},{"code":"Coding"},{"code":"ContactPoint"},{"code":"Count"},{"code":"Distance"},{"code":"Duration"},{"code":"HumanName"},{"code":"Identifier"},{"code":"Money"},{"code":"Period"},{"code":"Quantity"},{"code":"Range"},{"code":"Ratio"},{"code":"Reference"},{"code":"SampledData"},{"code":"Signature"},{"code":"Timing"},{"code":"ContactDetail"},{"code":"Contributor"},{"code":"DataRequirement"},{"code":"Expression"},{"code":"ParameterDefinition"},{"code":"RelatedArtifact"},{"code":"TriggerDefinition"},{"code":"UsageContext"},{"code":"Dosage"},{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:text.url","path":"Extension.extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"code":"uri"}],"fixedUri":"text","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:text.value[x]","path":"Extension.extension.value[x]","slicing":{"discriminator":[{"type":"type","path":"$this"}],"ordered":false,"rules":"closed"},"short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.extension:text.value[x]:valueString","path":"Extension.extension.value[x]","sliceName":"valueString","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":1,"max":"1","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.url","path":"Extension.url","representation":["xmlAttr"],"short":"identifies the meaning of the extension","definition":"Source of the definition for the extension code - a logical name or a URL.","comment":"The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.","min":1,"max":"1","base":{"path":"Extension.url","min":1,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"uri"}],"code":"http://hl7.org/fhirpath/System.String"}],"fixedUri":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-race","isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Extension.value[x]","path":"Extension.value[x]","short":"Value of extension","definition":"Value of extension - must be one of a constrained set of the data types (see [Extensibility](http://hl7.org/fhir/R4/extensibility.html) for a list).","min":0,"max":"0","base":{"path":"Extension.value[x]","min":0,"max":"1"},"type":[{"code":"base64Binary"},{"code":"boolean"},{"code":"canonical"},{"code":"code"},{"code":"date"},{"code":"dateTime"},{"code":"decimal"},{"code":"id"},{"code":"instant"},{"code":"integer"},{"code":"markdown"},{"code":"oid"},{"code":"positiveInt"},{"code":"string"},{"code":"time"},{"code":"unsignedInt"},{"code":"uri"},{"code":"url"},{"code":"uuid"},{"code":"Address"},{"code":"Age"},{"code":"Annotation"},{"code":"Attachment"},{"code":"CodeableConcept"},{"code":"Coding"},{"code":"ContactPoint"},{"code":"Count"},{"code":"Distance"},{"code":"Duration"},{"code":"HumanName"},{"code":"Identifier"},{"code":"Money"},{"code":"Period"},{"code":"Quantity"},{"code":"Range"},{"code":"Ratio"},{"code":"Reference"},{"code":"SampledData"},{"code":"Signature"},{"code":"Timing"},{"code":"ContactDetail"},{"code":"Contributor"},{"code":"DataRequirement"},{"code":"Expression"},{"code":"ParameterDefinition"},{"code":"RelatedArtifact"},{"code":"TriggerDefinition"},{"code":"UsageContext"},{"code":"Dosage"},{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]}]},"differential":{"element":[{"id":"Extension","path":"Extension","short":"US Core Race Extension","definition":"Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The race codes used to represent these concepts are based upon the [CDC Race and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 921 reference race. The race concepts are grouped by and pre-mapped to the 5 OMB race categories:\n\n - American Indian or Alaska Native\n - Asian\n - Black or African American\n - Native Hawaiian or Other Pacific Islander\n - White.","min":0,"max":"1"},{"id":"Extension.extension:ombCategory","path":"Extension.extension","sliceName":"ombCategory","short":"American Indian or Alaska Native|Asian|Black or African American|Native Hawaiian or Other Pacific Islander|White","definition":"The 5 race category codes according to the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","min":0,"max":"5","type":[{"code":"Extension"}],"mustSupport":true,"mapping":[{"identity":"iso11179","map":"/ClinicalDocument/recordTarget/patientRole/patient/raceCode"}]},{"id":"Extension.extension:ombCategory.url","path":"Extension.extension.url","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"ombCategory"},{"id":"Extension.extension:ombCategory.valueCoding","path":"Extension.extension.valueCoding","min":1,"max":"1","type":[{"code":"Coding"}],"binding":{"strength":"required","description":"The 5 race category codes according to the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","valueSet":"http://hl7.org/fhir/us/core/ValueSet/omb-race-category"}},{"id":"Extension.extension:detailed","path":"Extension.extension","sliceName":"detailed","short":"Extended race codes","definition":"The 900+ CDC race codes that are grouped under one of the 5 OMB race category codes:.","min":0,"max":"*","type":[{"code":"Extension"}],"mapping":[{"identity":"iso11179","map":"/ClinicalDocument/recordTarget/patientRole/patient/sdtc:raceCode"}]},{"id":"Extension.extension:detailed.url","path":"Extension.extension.url","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"detailed"},{"id":"Extension.extension:detailed.valueCoding","path":"Extension.extension.valueCoding","min":1,"max":"1","type":[{"code":"Coding"}],"binding":{"strength":"required","description":"The [900+ CDC Race codes](http://www.cdc.gov/phin/resources/vocabulary/index.html) that are grouped under one of the 5 OMB race category codes.","valueSet":"http://hl7.org/fhir/us/core/ValueSet/detailed-race"}},{"id":"Extension.extension:text","path":"Extension.extension","sliceName":"text","short":"Race Text","definition":"Plain text representation of the race concept(s).","min":1,"max":"1","type":[{"code":"Extension"}],"mustSupport":true},{"id":"Extension.extension:text.url","path":"Extension.extension.url","min":1,"max":"1","type":[{"code":"uri"}],"fixedUri":"text"},{"id":"Extension.extension:text.valueString","path":"Extension.extension.valueString","min":1,"max":"1","type":[{"code":"string"}]},{"id":"Extension.url","path":"Extension.url","min":1,"max":"1","fixedUri":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"},{"id":"Extension.value[x]","path":"Extension.value[x]","min":0,"max":"0"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/StructureDefinition-us-core-smokingstatus.json b/resources/uscore_v3.1.0/StructureDefinition-us-core-smokingstatus.json new file mode 100755 index 000000000..4c9ffccde --- /dev/null +++ b/resources/uscore_v3.1.0/StructureDefinition-us-core-smokingstatus.json @@ -0,0 +1 @@ +{"resourceType":"StructureDefinition","id":"us-core-smokingstatus","text":{"status":"generated","div":""},"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus","version":"3.1.0","name":"USCoreSmokingStatusProfile","title":"US Core Smoking Status Observation Profile","status":"active","experimental":false,"date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.healthit.gov"}]}],"description":"Defines constraints and extensions on the Observation resource for the minimal set of data to query and retrieve patient's Smoking Status information.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"fhirVersion":"4.0.1","mapping":[{"identity":"argonaut-dq-dstu2","uri":"http://unknown.org/Argonaut-DQ-DSTU2","name":"Argonaut-DQ-DSTU2"},{"identity":"workflow","uri":"http://hl7.org/fhir/workflow","name":"Workflow Pattern"},{"identity":"sct-concept","uri":"http://snomed.info/conceptdomain","name":"SNOMED CT Concept Domain Binding"},{"identity":"v2","uri":"http://hl7.org/v2","name":"HL7 v2 Mapping"},{"identity":"rim","uri":"http://hl7.org/v3","name":"RIM Mapping"},{"identity":"w5","uri":"http://hl7.org/fhir/fivews","name":"FiveWs Pattern Mapping"},{"identity":"sct-attr","uri":"http://snomed.org/attributebinding","name":"SNOMED CT Attribute Binding"}],"kind":"resource","abstract":false,"type":"Observation","baseDefinition":"http://hl7.org/fhir/StructureDefinition/Observation","derivation":"constraint","snapshot":{"element":[{"id":"Observation","path":"Observation","short":"Measurements and simple assertions","definition":"The US Core Smoking Status Observation Profile is based upon the core FHIR Observation Resource and created to meet the 2015 Edition Common Clinical Data Set 'Smoking status' requirements.","comment":"Used for simple observations such as device measurements, laboratory atomic results, vital signs, height, weight, smoking status, comments, etc. Other resources are used to provide context for observations such as laboratory reports, etc.","alias":["Vital Signs","Measurement","Results","Tests","Obs"],"min":0,"max":"*","base":{"path":"Observation","min":0,"max":"*"},"constraint":[{"key":"dom-2","severity":"error","human":"If the resource is contained in another resource, it SHALL NOT contain nested Resources","expression":"contained.contained.empty()","xpath":"not(parent::f:contained and f:contained)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-3","severity":"error","human":"If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource","expression":"contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()","xpath":"not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-4","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated","expression":"contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()","xpath":"not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"dom-5","severity":"error","human":"If a resource is contained in another resource, it SHALL NOT have a security label","expression":"contained.meta.security.empty()","xpath":"not(exists(f:contained/*/f:meta/f:security))","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice","valueBoolean":true},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation","valueMarkdown":"When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."}],"key":"dom-6","severity":"warning","human":"A resource should have narrative for robust management","expression":"text.`div`.exists()","xpath":"exists(f:text/h:div)","source":"http://hl7.org/fhir/StructureDefinition/DomainResource"},{"key":"obs-6","severity":"error","human":"dataAbsentReason SHALL only be present if Observation.value[x] is not present","expression":"dataAbsentReason.empty() or value.empty()","xpath":"not(exists(f:dataAbsentReason)) or (not(exists(*[starts-with(local-name(.), 'value')])))","source":"http://hl7.org/fhir/StructureDefinition/Observation"},{"key":"obs-7","severity":"error","human":"If Observation.code is the same as an Observation.component.code then the value element associated with the code SHALL NOT be present","expression":"value.empty() or component.code.where(coding.intersect(%resource.code.coding).exists()).empty()","xpath":"not(f:*[starts-with(local-name(.), 'value')] and (for $coding in f:code/f:coding return f:component/f:code/f:coding[f:code/@value=$coding/f:code/@value] [f:system/@value=$coding/f:system/@value]))","source":"http://hl7.org/fhir/StructureDefinition/Observation"}],"mustSupport":false,"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Entity. Role, or Act"},{"identity":"workflow","map":"Event"},{"identity":"sct-concept","map":"< 363787002 |Observable entity|"},{"identity":"v2","map":"OBX"},{"identity":"rim","map":"Observation[classCode=OBS, moodCode=EVN]"},{"identity":"argonaut-dq-dstu2","map":"Observation"}]},{"id":"Observation.id","path":"Observation.id","short":"Logical id of this artifact","definition":"The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.","comment":"The only time that a resource does not have an id is when it is being submitted to the server using a create operation.","min":0,"max":"1","base":{"path":"Resource.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":true},{"id":"Observation.meta","path":"Observation.meta","short":"Metadata about the resource","definition":"The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.","min":0,"max":"1","base":{"path":"Resource.meta","min":0,"max":"1"},"type":[{"code":"Meta"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true},{"id":"Observation.implicitRules","path":"Observation.implicitRules","short":"A set of rules under which this content was created","definition":"A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.","comment":"Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.","min":0,"max":"1","base":{"path":"Resource.implicitRules","min":0,"max":"1"},"type":[{"code":"uri"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":true,"isModifierReason":"This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation","isSummary":true},{"id":"Observation.language","path":"Observation.language","short":"Language of the resource content","definition":"The base language in which the resource is written.","comment":"Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).","min":0,"max":"1","base":{"path":"Resource.language","min":0,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet","valueCanonical":"http://hl7.org/fhir/ValueSet/all-languages"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"Language"},{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding","valueBoolean":true}],"strength":"preferred","description":"A human language.","valueSet":"http://hl7.org/fhir/ValueSet/languages"}},{"id":"Observation.text","path":"Observation.text","short":"Text summary of the resource, for human interpretation","definition":"A human-readable narrative that contains a summary of the resource and can be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.","comment":"Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.","alias":["narrative","html","xhtml","display"],"min":0,"max":"1","base":{"path":"DomainResource.text","min":0,"max":"1"},"type":[{"code":"Narrative"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"Act.text?"}]},{"id":"Observation.contained","path":"Observation.contained","short":"Contained, inline Resources","definition":"These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.","comment":"This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.","alias":["inline resources","anonymous resources","contained resources"],"min":0,"max":"*","base":{"path":"DomainResource.contained","min":0,"max":"*"},"type":[{"code":"Resource"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.extension","path":"Observation.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.modifierExtension","path":"Observation.modifierExtension","short":"Extensions that cannot be ignored","definition":"May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"DomainResource.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them","isSummary":false,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.identifier","path":"Observation.identifier","short":"Business Identifier for observation","definition":"A unique identifier assigned to this observation.","requirements":"Allows observations to be distinguished and referenced.","min":0,"max":"*","base":{"path":"Observation.identifier","min":0,"max":"*"},"type":[{"code":"Identifier"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.identifier"},{"identity":"w5","map":"FiveWs.identifier"},{"identity":"v2","map":"OBX.21 For OBX segments from systems without OBX-21 support a combination of ORC/OBR and OBX must be negotiated between trading partners to uniquely identify the OBX segment. Depending on how V2 has been implemented each of these may be an option: 1) OBR-3 + OBX-3 + OBX-4 or 2) OBR-3 + OBR-4 + OBX-3 + OBX-4 or 2) some other way to uniquely ID the OBR/ORC + OBX-3 + OBX-4."},{"identity":"rim","map":"id"}]},{"id":"Observation.basedOn","path":"Observation.basedOn","short":"Fulfills plan, proposal or order","definition":"A plan, proposal or order that is fulfilled in whole or in part by this event. For example, a MedicationRequest may require a patient to have laboratory test performed before it is dispensed.","requirements":"Allows tracing of authorization for the event and tracking whether proposals/recommendations were acted upon.","alias":["Fulfills"],"min":0,"max":"*","base":{"path":"Observation.basedOn","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/CarePlan","http://hl7.org/fhir/StructureDefinition/DeviceRequest","http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation","http://hl7.org/fhir/StructureDefinition/MedicationRequest","http://hl7.org/fhir/StructureDefinition/NutritionOrder","http://hl7.org/fhir/StructureDefinition/ServiceRequest"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.basedOn"},{"identity":"v2","map":"ORC"},{"identity":"rim","map":".inboundRelationship[typeCode=COMP].source[moodCode=EVN]"}]},{"id":"Observation.partOf","path":"Observation.partOf","short":"Part of referenced event","definition":"A larger event of which this particular Observation is a component or step. For example, an observation as part of a procedure.","comment":"To link an Observation to an Encounter use `encounter`. See the [Notes](http://hl7.org/fhir/R4/observation.html#obsgrouping) below for guidance on referencing another Observation.","alias":["Container"],"min":0,"max":"*","base":{"path":"Observation.partOf","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/MedicationAdministration","http://hl7.org/fhir/StructureDefinition/MedicationDispense","http://hl7.org/fhir/StructureDefinition/MedicationStatement","http://hl7.org/fhir/StructureDefinition/Procedure","http://hl7.org/fhir/StructureDefinition/Immunization","http://hl7.org/fhir/StructureDefinition/ImagingStudy"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.partOf"},{"identity":"v2","map":"Varies by domain"},{"identity":"rim","map":".outboundRelationship[typeCode=FLFS].target"}]},{"id":"Observation.status","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint","valueString":"default: final"}],"path":"Observation.status","short":"registered | preliminary | final | amended +","definition":"The status of the result value.","comment":"This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.","requirements":"Need to track the status of individual results. Some results are finalized before the whole report is finalized.","min":1,"max":"1","base":{"path":"Observation.status","min":1,"max":"1"},"type":[{"code":"code"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":true,"isModifierReason":"This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid","isSummary":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-observation-smoking-status-status"},"mapping":[{"identity":"workflow","map":"Event.status"},{"identity":"w5","map":"FiveWs.status"},{"identity":"sct-concept","map":"< 445584004 |Report by finality status|"},{"identity":"v2","map":"OBX-11"},{"identity":"rim","map":"status Amended & Final are differentiated by whether it is the subject of a ControlAct event with a type of \"revise\""},{"identity":"argonaut-dq-dstu2","map":"Observation.status"}]},{"id":"Observation.category","path":"Observation.category","short":"Classification of type of observation","definition":"A code that classifies the general type of observation being made.","comment":"In addition to the required category valueset, this element allows various categorization schemes based on the owner’s definition of the category and effectively multiple categories can be used at once. The level of granularity is defined by the category concepts in the value set.","requirements":"Used for filtering what observations are retrieved and displayed.","min":0,"max":"*","base":{"path":"Observation.category","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCategory"}],"strength":"preferred","description":"Codes for high level observation categories.","valueSet":"http://hl7.org/fhir/ValueSet/observation-category"},"mapping":[{"identity":"w5","map":"FiveWs.class"},{"identity":"rim","map":".outboundRelationship[typeCode=\"COMP].target[classCode=\"LIST\", moodCode=\"EVN\"].code"}]},{"id":"Observation.code","path":"Observation.code","short":"Smoking Status","definition":"Describes what was observed. Sometimes this is called the observation \"name\".","comment":"*All* code-value and, if present, component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation.","requirements":"Knowing what kind of observation is being made is essential to understanding the observation.","alias":["Name"],"min":1,"max":"1","base":{"path":"Observation.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-smoking-status-observation-codes"},"mapping":[{"identity":"workflow","map":"Event.code"},{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR < 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"},{"identity":"sct-attr","map":"116680003 |Is a|"},{"identity":"argonaut-dq-dstu2","map":"Observation.code"}]},{"id":"Observation.subject","path":"Observation.subject","short":"Who and/or what the observation is about","definition":"The patient, or group of patients, location, or device this observation is about and into whose record the observation is placed. If the actual focus of the observation is different from the subject (or a sample of, part, or region of the subject), the `focus` element or the `code` itself specifies the actual focus of the observation.","comment":"One would expect this element to be a cardinality of 1..1. The only circumstance in which the subject can be missing is when the observation is made by a device that does not know the patient. In this case, the observation SHALL be matched to a patient through some context/channel matching technique, and at this point, the observation should be updated.","requirements":"Observations have no value if you don't know who or what they're about.","min":1,"max":"1","base":{"path":"Observation.subject","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.subject"},{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"PID-3"},{"identity":"rim","map":"participation[typeCode=RTGT] "},{"identity":"w5","map":"FiveWs.subject"},{"identity":"argonaut-dq-dstu2","map":"Observation.subject"}]},{"id":"Observation.focus","extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status","valueCode":"trial-use"}],"path":"Observation.focus","short":"What the observation is about, when it is not about the subject of record","definition":"The actual focus of an observation when it is not the patient of record representing something or someone associated with the patient such as a spouse, parent, fetus, or donor. For example, fetus observations in a mother's record. The focus of an observation could also be an existing condition, an intervention, the subject's diet, another observation of the subject, or a body structure such as tumor or implanted device. An example use case would be using the Observation resource to capture whether the mother is trained to change her child's tracheostomy tube. In this example, the child is the patient of record and the mother is the focus.","comment":"Typically, an observation is made about the subject - a patient, or group of patients, location, or device - and the distinction between the subject and what is directly measured for an observation is specified in the observation code itself ( e.g., \"Blood Glucose\") and does not need to be represented separately using this element. Use `specimen` if a reference to a specimen is required. If a code is required instead of a resource use either `bodysite` for bodysites or the standard extension [focusCode](http://hl7.org/fhir/R4/extension-observation-focuscode.html).","min":0,"max":"*","base":{"path":"Observation.focus","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Resource"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.subject[x]"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"participation[typeCode=SBJ]"},{"identity":"w5","map":"FiveWs.subject"}]},{"id":"Observation.encounter","path":"Observation.encounter","short":"Healthcare event during which this observation is made","definition":"The healthcare event (e.g. a patient and healthcare provider interaction) during which this observation is made.","comment":"This will typically be the encounter the event occurred within, but some events may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter (e.g. pre-admission laboratory tests).","requirements":"For some observations it may be important to know the link between an observation and a particular encounter.","alias":["Context"],"min":0,"max":"1","base":{"path":"Observation.encounter","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Encounter"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.context"},{"identity":"w5","map":"FiveWs.context"},{"identity":"v2","map":"PV1"},{"identity":"rim","map":"inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN]"}]},{"id":"Observation.effective[x]","path":"Observation.effective[x]","short":"Clinically relevant time/time-period for observation","definition":"The time or time-period the observed value is asserted as being true. For biological subjects - e.g. human patients - this is usually called the \"physiologically relevant time\". This is usually either the time of the procedure or of specimen collection, but very often the source of the date/time is not known, only the date/time itself.","comment":"At least a date should be present unless this observation is a historical report. For recording imprecise or \"fuzzy\" times (For example, a blood glucose measurement taken \"after breakfast\") use the [Timing](http://hl7.org/fhir/R4/datatypes.html#timing) datatype which allow the measurement to be tied to regular life events.","requirements":"Knowing when an observation was deemed true is important to its relevance as well as determining trends.","alias":["Occurrence"],"min":0,"max":"1","base":{"path":"Observation.effective[x]","min":0,"max":"1"},"type":[{"code":"dateTime"},{"code":"Period"},{"code":"Timing"},{"code":"instant"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.occurrence[x]"},{"identity":"w5","map":"FiveWs.done[x]"},{"identity":"v2","map":"OBX-14, and/or OBX-19 after v2.4 (depends on who observation made)"},{"identity":"rim","map":"effectiveTime"}]},{"id":"Observation.issued","path":"Observation.issued","short":"Date/Time this version was made available","definition":"The date and time this version of the observation was made available to providers, typically after the results have been reviewed and verified.","comment":"For Observations that don’t require review and verification, it may be the same as the [`lastUpdated` ](http://hl7.org/fhir/R4/resource-definitions.html#Meta.lastUpdated) time of the resource itself. For Observations that do require review and verification for certain updates, it might not be the same as the `lastUpdated` time of the resource itself due to a non-clinically significant update that doesn’t require the new version to be reviewed and verified again.","min":1,"max":"1","base":{"path":"Observation.issued","min":0,"max":"1"},"type":[{"code":"instant"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"mapping":[{"identity":"w5","map":"FiveWs.recorded"},{"identity":"v2","map":"OBR.22 (or MSH.7), or perhaps OBX-19 (depends on who observation made)"},{"identity":"rim","map":"participation[typeCode=AUT].time"},{"identity":"argonaut-dq-dstu2","map":"Observation.issued"}]},{"id":"Observation.performer","path":"Observation.performer","short":"Who is responsible for the observation","definition":"Who was responsible for asserting the observed value as \"true\".","requirements":"May give a degree of confidence in the observation and also indicates where follow-up questions should be directed.","min":0,"max":"*","base":{"path":"Observation.performer","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/Organization","http://hl7.org/fhir/StructureDefinition/CareTeam","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"workflow","map":"Event.performer.actor"},{"identity":"w5","map":"FiveWs.actor"},{"identity":"v2","map":"OBX.15 / (Practitioner) OBX-16, PRT-5:PRT-4='RO' / (Device) OBX-18 , PRT-10:PRT-4='EQUIP' / (Organization) OBX-23, PRT-8:PRT-4='PO'"},{"identity":"rim","map":"participation[typeCode=PRF]"}]},{"id":"Observation.value[x]","path":"Observation.value[x]","slicing":{"discriminator":[{"type":"type","path":"$this"}],"ordered":false,"rules":"closed"},"short":"Actual result","definition":"The information determined as a result of making the observation, if the information has a simple value.","comment":"An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/R4/observation.html#notes) below.","requirements":"An observation exists to have a value, though it might not if it is in error, or if it represents a group of observations.","min":0,"max":"1","base":{"path":"Observation.value[x]","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-7"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"sct-concept","map":"< 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.value[x]:valueCodeableConcept","path":"Observation.value[x]","sliceName":"valueCodeableConcept","short":"Coded Responses from Smoking Status Value Set","definition":"The information determined as a result of making the observation, if the information has a simple value.","comment":"An observation may have; 1) a single value here, 2) both a value and a set of related or component values, or 3) only a set of related or component values. If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/R4/observation.html#notes) below.","requirements":"An observation exists to have a value, though it might not if it is in error, or if it represents a group of observations.","min":1,"max":"1","base":{"path":"Observation.value[x]","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-7"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"mustSupport":true,"isModifier":false,"isSummary":true,"binding":{"strength":"extensible","description":"This value set indicates the current smoking status of a patient","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-observation-smokingstatus"},"mapping":[{"identity":"sct-concept","map":"< 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"},{"identity":"argonaut-dq-dstu2","map":"Observation.valueCodeableConcept"}]},{"id":"Observation.dataAbsentReason","path":"Observation.dataAbsentReason","short":"Why the result is missing","definition":"Provides a reason why the expected value in the element Observation.value[x] is missing.","comment":"Null or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"specimen unsatisfactory\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Note that an observation may only be reported if there are values to report. For example differential cell counts values may be reported only when > 0. Because of these options, use-case agreements are required to interpret general observations for null or exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.interpretation","path":"Observation.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.note","path":"Observation.note","short":"Comments about the observation","definition":"Comments about the observation or the results.","comment":"May include general statements about the observation, or statements about significant, unexpected or unreliable results values, or information about its source when relevant to its interpretation.","requirements":"Need to be able to provide free text additional information.","min":0,"max":"*","base":{"path":"Observation.note","min":0,"max":"*"},"type":[{"code":"Annotation"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"NTE.3 (partner NTE to OBX, or sometimes another (child?) OBX)"},{"identity":"rim","map":"subjectOf.observationEvent[code=\"annotation\"].value"}]},{"id":"Observation.bodySite","path":"Observation.bodySite","short":"Observed body part","definition":"Indicates the site on the subject's body where the observation was made (i.e. the target site).","comment":"Only used if not implicit in code found in Observation.code. In many systems, this may be represented as a related observation instead of an inline component. \n\nIf the use case requires BodySite to be handled as a separate resource (e.g. to identify and track separately) then use the standard extension[ bodySite](http://hl7.org/fhir/R4/extension-bodysite.html).","min":0,"max":"1","base":{"path":"Observation.bodySite","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"BodySite"}],"strength":"example","description":"Codes describing anatomical locations. May include laterality.","valueSet":"http://hl7.org/fhir/ValueSet/body-site"},"mapping":[{"identity":"sct-concept","map":"< 123037004 |Body structure|"},{"identity":"v2","map":"OBX-20"},{"identity":"rim","map":"targetSiteCode"},{"identity":"sct-attr","map":"718497002 |Inherent location|"}]},{"id":"Observation.method","path":"Observation.method","short":"How it was done","definition":"Indicates the mechanism used to perform the observation.","comment":"Only used if not implicit in code for Observation.code.","requirements":"In some cases, method can impact results and is thus used for determining whether results can be compared or determining significance of results.","min":0,"max":"1","base":{"path":"Observation.method","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationMethod"}],"strength":"example","description":"Methods for simple observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-methods"},"mapping":[{"identity":"v2","map":"OBX-17"},{"identity":"rim","map":"methodCode"}]},{"id":"Observation.specimen","path":"Observation.specimen","short":"Specimen used for this observation","definition":"The specimen that was used when this observation was made.","comment":"Should only be used if not implicit in code found in `Observation.code`. Observations are not made on specimens themselves; they are made on a subject, but in many cases by the means of a specimen. Note that although specimens are often involved, they are not always tracked and reported explicitly. Also note that observation resources may be used in contexts that track the specimen explicitly (e.g. Diagnostic Report).","min":0,"max":"1","base":{"path":"Observation.specimen","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Specimen"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"sct-concept","map":"< 123038009 |Specimen|"},{"identity":"v2","map":"SPM segment"},{"identity":"rim","map":"participation[typeCode=SPC].specimen"},{"identity":"sct-attr","map":"704319004 |Inherent in|"}]},{"id":"Observation.device","path":"Observation.device","short":"(Measurement) Device","definition":"The device used to generate the observation data.","comment":"Note that this is not meant to represent a device involved in the transmission of the result, e.g., a gateway. Such devices may be documented using the Provenance resource where relevant.","min":0,"max":"1","base":{"path":"Observation.device","min":0,"max":"1"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/DeviceMetric"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"sct-concept","map":"< 49062001 |Device|"},{"identity":"v2","map":"OBX-17 / PRT -10"},{"identity":"rim","map":"participation[typeCode=DEV]"},{"identity":"sct-attr","map":"424226004 |Using device|"}]},{"id":"Observation.referenceRange","path":"Observation.referenceRange","short":"Provides guide for interpretation","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range. Multiple reference ranges are interpreted as an \"OR\". In other words, to represent two distinct target populations, two `referenceRange` elements would be used.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.referenceRange","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"obs-3","severity":"error","human":"Must have at least a low or a high or text","expression":"low.exists() or high.exists() or text.exists()","xpath":"(exists(f:low) or exists(f:high)or exists(f:text))"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]},{"id":"Observation.referenceRange.id","path":"Observation.referenceRange.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.referenceRange.extension","path":"Observation.referenceRange.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.referenceRange.modifierExtension","path":"Observation.referenceRange.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.referenceRange.low","path":"Observation.referenceRange.low","short":"Low Range, if relevant","definition":"The value of the low bound of the reference range. The low bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the low bound is omitted, it is assumed to be meaningless (e.g. reference range is <=2.3).","min":0,"max":"1","base":{"path":"Observation.referenceRange.low","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"condition":["obs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:IVL_PQ.low"}]},{"id":"Observation.referenceRange.high","path":"Observation.referenceRange.high","short":"High Range, if relevant","definition":"The value of the high bound of the reference range. The high bound of the reference range endpoint is inclusive of the value (e.g. reference range is >=5 - <=9). If the high bound is omitted, it is assumed to be meaningless (e.g. reference range is >= 2.3).","min":0,"max":"1","base":{"path":"Observation.referenceRange.high","min":0,"max":"1"},"type":[{"code":"Quantity","profile":["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}],"condition":["obs-3"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:IVL_PQ.high"}]},{"id":"Observation.referenceRange.type","path":"Observation.referenceRange.type","short":"Reference range qualifier","definition":"Codes to indicate the what part of the targeted reference population it applies to. For example, the normal or therapeutic range.","comment":"This SHOULD be populated if there is more than one range. If this element is not present then the normal range is assumed.","requirements":"Need to be able to say what kind of reference range this is - normal, recommended, therapeutic, etc., - for proper interpretation.","min":0,"max":"1","base":{"path":"Observation.referenceRange.type","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationRangeMeaning"}],"strength":"preferred","description":"Code for the meaning of a reference range.","valueSet":"http://hl7.org/fhir/ValueSet/referencerange-meaning"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values| OR \r< 365860008 |General clinical state finding| \rOR \r< 250171008 |Clinical history or observation findings| OR \r< 415229000 |Racial group| OR \r< 365400002 |Finding of puberty stage| OR\r< 443938003 |Procedure carried out on subject|"},{"identity":"v2","map":"OBX-10"},{"identity":"rim","map":"interpretationCode"}]},{"id":"Observation.referenceRange.appliesTo","path":"Observation.referenceRange.appliesTo","short":"Reference range population","definition":"Codes to indicate the target population this reference range applies to. For example, a reference range may be based on the normal population or a particular sex or race. Multiple `appliesTo` are interpreted as an \"AND\" of the target populations. For example, to represent a target population of African American females, both a code of female and a code for African American would be used.","comment":"This SHOULD be populated if there is more than one range. If this element is not present then the normal population is assumed.","requirements":"Need to be able to identify the target population for proper interpretation.","min":0,"max":"*","base":{"path":"Observation.referenceRange.appliesTo","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationRangeType"}],"strength":"example","description":"Codes identifying the population the reference range applies to.","valueSet":"http://hl7.org/fhir/ValueSet/referencerange-appliesto"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values| OR \r< 365860008 |General clinical state finding| \rOR \r< 250171008 |Clinical history or observation findings| OR \r< 415229000 |Racial group| OR \r< 365400002 |Finding of puberty stage| OR\r< 443938003 |Procedure carried out on subject|"},{"identity":"v2","map":"OBX-10"},{"identity":"rim","map":"interpretationCode"}]},{"id":"Observation.referenceRange.age","path":"Observation.referenceRange.age","short":"Applicable age range, if relevant","definition":"The age at which this reference range is applicable. This is a neonatal age (e.g. number of weeks at term) if the meaning says so.","requirements":"Some analytes vary greatly over age.","min":0,"max":"1","base":{"path":"Observation.referenceRange.age","min":0,"max":"1"},"type":[{"code":"Range"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"outboundRelationship[typeCode=PRCN].targetObservationCriterion[code=\"age\"].value"}]},{"id":"Observation.referenceRange.text","path":"Observation.referenceRange.text","short":"Text based reference range in an observation","definition":"Text based reference range in an observation which may be used when a quantitative range is not appropriate for an observation. An example would be a reference value of \"Negative\" or a list or table of \"normals\".","min":0,"max":"1","base":{"path":"Observation.referenceRange.text","min":0,"max":"1"},"type":[{"code":"string"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX-7"},{"identity":"rim","map":"value:ST"}]},{"id":"Observation.hasMember","path":"Observation.hasMember","short":"Related resource that belongs to the Observation group","definition":"This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) that includes the target as a member of the group.","comment":"When using this element, an observation will typically have either a value or a set of related resources, although both may be present in some cases. For a discussion on the ways Observations can assembled in groups together, see [Notes](http://hl7.org/fhir/R4/observation.html#obsgrouping) below. Note that a system may calculate results from [QuestionnaireResponse](http://hl7.org/fhir/R4/questionnaireresponse.html) into a final score and represent the score as an Observation.","min":0,"max":"*","base":{"path":"Observation.hasMember","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/Observation","http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","http://hl7.org/fhir/StructureDefinition/MolecularSequence"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Relationships established by OBX-4 usage"},{"identity":"rim","map":"outBoundRelationship"}]},{"id":"Observation.derivedFrom","path":"Observation.derivedFrom","short":"Related measurements the observation is made from","definition":"The target resource that represents a measurement from which this observation value is derived. For example, a calculated anion gap or a fetal measurement based on an ultrasound image.","comment":"All the reference choices that are listed in this element can represent clinical observations and other measurements that may be the source for a derived value. The most common reference will be another Observation. For a discussion on the ways Observations can assembled in groups together, see [Notes](http://hl7.org/fhir/R4/observation.html#obsgrouping) below.","min":0,"max":"*","base":{"path":"Observation.derivedFrom","min":0,"max":"*"},"type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/StructureDefinition/DocumentReference","http://hl7.org/fhir/StructureDefinition/ImagingStudy","http://hl7.org/fhir/StructureDefinition/Media","http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse","http://hl7.org/fhir/StructureDefinition/Observation","http://hl7.org/fhir/StructureDefinition/MolecularSequence"]}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"Relationships established by OBX-4 usage"},{"identity":"rim","map":".targetObservation"}]},{"id":"Observation.component","path":"Observation.component","short":"Component results","definition":"Some observations have multiple component observations. These component observations are expressed as separate code value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood pressure measurement and multiple component observations for genetics observations.","comment":"For a discussion on the ways Observations can be assembled in groups together see [Notes](http://hl7.org/fhir/R4/observation.html#notes) below.","requirements":"Component observations share the same attributes in the Observation resource as the primary observation and are always treated a part of a single observation (they are not separable). However, the reference range for the primary observation value is not inherited by the component values and is required when appropriate for each component observation.","min":0,"max":"*","base":{"path":"Observation.component","min":0,"max":"*"},"type":[{"code":"BackboneElement"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"v2","map":"containment by OBX-4?"},{"identity":"rim","map":"outBoundRelationship[typeCode=COMP]"}]},{"id":"Observation.component.id","path":"Observation.component.id","representation":["xmlAttr"],"short":"Unique id for inter-element referencing","definition":"Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.","min":0,"max":"1","base":{"path":"Element.id","min":0,"max":"1"},"type":[{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type","valueUrl":"string"}],"code":"http://hl7.org/fhirpath/System.String"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component.extension","path":"Observation.component.extension","short":"Additional content defined by implementations","definition":"May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","alias":["extensions","user content"],"min":0,"max":"*","base":{"path":"Element.extension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"rim","map":"n/a"}]},{"id":"Observation.component.modifierExtension","path":"Observation.component.modifierExtension","short":"Extensions that cannot be ignored even if unrecognized","definition":"May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).","comment":"There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.","requirements":"Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).","alias":["extensions","user content","modifiers"],"min":0,"max":"*","base":{"path":"BackboneElement.modifierExtension","min":0,"max":"*"},"type":[{"code":"Extension"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"},{"key":"ext-1","severity":"error","human":"Must have either extensions or value[x], not both","expression":"extension.exists() != value.exists()","xpath":"exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])","source":"http://hl7.org/fhir/StructureDefinition/Extension"}],"isModifier":true,"isModifierReason":"Modifier extensions are expected to modify the meaning or interpretation of the element that contains them","isSummary":true,"mapping":[{"identity":"rim","map":"N/A"}]},{"id":"Observation.component.code","path":"Observation.component.code","short":"Type of component observation (code / type)","definition":"Describes what was observed. Sometimes this is called the observation \"code\".","comment":"*All* code-value and component.code-component.value pairs need to be taken into account to correctly understand the meaning of the observation.","requirements":"Knowing what kind of observation is being made is essential to understanding the observation.","min":1,"max":"1","base":{"path":"Observation.component.code","min":1,"max":"1"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationCode"}],"strength":"example","description":"Codes identifying names of simple observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-codes"},"mapping":[{"identity":"w5","map":"FiveWs.what[x]"},{"identity":"sct-concept","map":"< 363787002 |Observable entity| OR \r< 386053000 |Evaluation procedure|"},{"identity":"v2","map":"OBX-3"},{"identity":"rim","map":"code"}]},{"id":"Observation.component.value[x]","path":"Observation.component.value[x]","short":"Actual component result","definition":"The information determined as a result of making the observation, if the information has a simple value.","comment":"Used when observation has a set of component observations. An observation may have both a value (e.g. an Apgar score) and component observations (the observations from which the Apgar score was derived). If a value is present, the datatype for this element should be determined by Observation.code. A CodeableConcept with just a text would be used instead of a string if the field was usually coded, or if the type associated with the Observation.code defines a coded value. For additional guidance, see the [Notes section](http://hl7.org/fhir/R4/observation.html#notes) below.","requirements":"An observation exists to have a value, though it might not if it is in error, or if it represents a group of observations.","min":0,"max":"1","base":{"path":"Observation.component.value[x]","min":0,"max":"1"},"type":[{"code":"Quantity"},{"code":"CodeableConcept"},{"code":"string"},{"code":"boolean"},{"code":"integer"},{"code":"Range"},{"code":"Ratio"},{"code":"SampledData"},{"code":"time"},{"code":"dateTime"},{"code":"Period"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":true,"mapping":[{"identity":"sct-concept","map":"363714003 |Interprets| < 441742003 |Evaluation finding|"},{"identity":"v2","map":"OBX.2, OBX.5, OBX.6"},{"identity":"rim","map":"value"},{"identity":"sct-attr","map":"363714003 |Interprets|"}]},{"id":"Observation.component.dataAbsentReason","path":"Observation.component.dataAbsentReason","short":"Why the component result is missing","definition":"Provides a reason why the expected value in the element Observation.component.value[x] is missing.","comment":"\"Null\" or exceptional values can be represented two ways in FHIR Observations. One way is to simply include them in the value set and represent the exceptions in the value. For example, measurement values for a serology test could be \"detected\", \"not detected\", \"inconclusive\", or \"test not done\". \n\nThe alternate way is to use the value element for actual observations and use the explicit dataAbsentReason element to record exceptional values. For example, the dataAbsentReason code \"error\" could be used when the measurement was not completed. Because of these options, use-case agreements are required to interpret general observations for exceptional values.","requirements":"For many results it is necessary to handle exceptional values in measurements.","min":0,"max":"1","base":{"path":"Observation.component.dataAbsentReason","min":0,"max":"1"},"type":[{"code":"CodeableConcept"}],"condition":["obs-6"],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationValueAbsentReason"}],"strength":"extensible","description":"Codes specifying why the result (`Observation.value[x]`) is missing.","valueSet":"http://hl7.org/fhir/ValueSet/data-absent-reason"},"mapping":[{"identity":"v2","map":"N/A"},{"identity":"rim","map":"value.nullFlavor"}]},{"id":"Observation.component.interpretation","path":"Observation.component.interpretation","short":"High, low, normal, etc.","definition":"A categorical assessment of an observation value. For example, high, low, normal.","comment":"Historically used for laboratory results (known as 'abnormal flag' ), its use extends to other use cases where coded interpretations are relevant. Often reported as one or more simple compact codes this element is often placed adjacent to the result value in reports and flow sheets to signal the meaning/normalcy status of the result.","requirements":"For some results, particularly numeric results, an interpretation is necessary to fully understand the significance of a result.","alias":["Abnormal Flag"],"min":0,"max":"*","base":{"path":"Observation.component.interpretation","min":0,"max":"*"},"type":[{"code":"CodeableConcept"}],"constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"binding":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName","valueString":"ObservationInterpretation"}],"strength":"extensible","description":"Codes identifying interpretations of observations.","valueSet":"http://hl7.org/fhir/ValueSet/observation-interpretation"},"mapping":[{"identity":"sct-concept","map":"< 260245000 |Findings values|"},{"identity":"v2","map":"OBX-8"},{"identity":"rim","map":"interpretationCode"},{"identity":"sct-attr","map":"363713009 |Has interpretation|"}]},{"id":"Observation.component.referenceRange","path":"Observation.component.referenceRange","short":"Provides guide for interpretation of component result","definition":"Guidance on how to interpret the value by comparison to a normal or recommended range.","comment":"Most observations only have one generic reference range. Systems MAY choose to restrict to only supplying the relevant reference range based on knowledge about the patient (e.g., specific to the patient's age, gender, weight and other factors), but this might not be possible or appropriate. Whenever more than one reference range is supplied, the differences between them SHOULD be provided in the reference range and/or age properties.","requirements":"Knowing what values are considered \"normal\" can help evaluate the significance of a particular result. Need to be able to provide multiple reference ranges for different contexts.","min":0,"max":"*","base":{"path":"Observation.component.referenceRange","min":0,"max":"*"},"contentReference":"#Observation.referenceRange","constraint":[{"key":"ele-1","severity":"error","human":"All FHIR elements must have a @value or children","expression":"hasValue() or (children().count() > id.count())","xpath":"@value|f:*|h:div","source":"http://hl7.org/fhir/StructureDefinition/Element"}],"isModifier":false,"isSummary":false,"mapping":[{"identity":"v2","map":"OBX.7"},{"identity":"rim","map":"outboundRelationship[typeCode=REFV]/target[classCode=OBS, moodCode=EVN]"}]}]},"differential":{"element":[{"id":"Observation","path":"Observation","definition":"The US Core Smoking Status Observation Profile is based upon the core FHIR Observation Resource and created to meet the 2015 Edition Common Clinical Data Set 'Smoking status' requirements.","alias":["Obs"],"mustSupport":false,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation"}]},{"id":"Observation.status","path":"Observation.status","min":1,"max":"1","mustSupport":true,"binding":{"strength":"required","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-observation-smoking-status-status"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.status"}]},{"id":"Observation.code","path":"Observation.code","short":"Smoking Status","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-smoking-status-observation-codes"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.code"}]},{"id":"Observation.subject","path":"Observation.subject","min":1,"max":"1","type":[{"code":"Reference","targetProfile":["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]}],"mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.subject"}]},{"id":"Observation.issued","path":"Observation.issued","min":1,"max":"1","mustSupport":true,"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.issued"}]},{"id":"Observation.valueCodeableConcept","path":"Observation.valueCodeableConcept","short":"Coded Responses from Smoking Status Value Set","min":1,"max":"1","type":[{"code":"CodeableConcept"}],"mustSupport":true,"binding":{"strength":"extensible","description":"This value set indicates the current smoking status of a patient","valueSet":"http://hl7.org/fhir/us/core/ValueSet/us-core-observation-smokingstatus"},"mapping":[{"identity":"argonaut-dq-dstu2","map":"Observation.valueCodeableConcept"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-birthsex.json b/resources/uscore_v3.1.0/ValueSet-birthsex.json new file mode 100755 index 000000000..64a7c662e --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-birthsex.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"birthsex","text":{"status":"generated","div":"

    Birth Sex

    This value set includes codes from the following code systems:

    • Include these codes as defined in http://terminology.hl7.org/CodeSystem/v3-AdministrativeGender
      CodeDisplay
      FFemaleFemale
      MMaleMale
    • Include these codes as defined in http://terminology.hl7.org/CodeSystem/v3-NullFlavor
      CodeDisplay
      UNKUnknownDescription:A proper value is applicable, but not known.
      \n \n Usage Notes: This means the actual value is not known. If the only thing that is unknown is how to properly express the value in the necessary constraints (value set, datatype, etc.), then the OTH or UNC flavor should be used. No properties should be included for a datatype with this property unless:
      \n \n Those properties themselves directly translate to a semantic of "unknown". (E.g. a local code sent as a translation that conveys 'unknown')\n Those properties further qualify the nature of what is unknown. (E.g. specifying a use code of "H" and a URL prefix of "tel:" to convey that it is the home phone number that is unknown.)
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/birthsex","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113762.1.4.1021.24"}],"version":"3.1.0","name":"BirthSex","title":"Birth Sex","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"Codes for assigning sex at birth as specified by the [Office of the National Coordinator for Health IT (ONC)](https://www.healthit.gov/newsroom/about-onc)","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"http://terminology.hl7.org/CodeSystem/v3-AdministrativeGender","concept":[{"code":"F","display":"Female"},{"code":"M","display":"Male"}]},{"system":"http://terminology.hl7.org/CodeSystem/v3-NullFlavor","concept":[{"code":"UNK","display":"Unknown"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-detailed-ethnicity.json b/resources/uscore_v3.1.0/ValueSet-detailed-ethnicity.json new file mode 100755 index 000000000..25c00fdca --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-detailed-ethnicity.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"detailed-ethnicity","text":{"status":"generated","div":"

    Detailed ethnicity

    The 41 CDC ethnicity codes that are grouped under one of the 2 OMB ethnicity category codes.

    \n

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/detailed-ethnicity","version":"3.1.0","name":"DetailedEthnicity","title":"Detailed ethnicity","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","description":"The 41 [CDC ethnicity codes](http://www.cdc.gov/phin/resources/vocabulary/index.html) that are grouped under one of the 2 OMB ethnicity category codes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","filter":[{"property":"concept","op":"is-a","value":"2133-7"}]}],"exclude":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"2135-2"},{"code":"2186-5"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-detailed-race.json b/resources/uscore_v3.1.0/ValueSet-detailed-race.json new file mode 100755 index 000000000..d579dc5dd --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-detailed-race.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"detailed-race","text":{"status":"generated","div":"

    Detailed Race

    The 900+ CDC Race codes that are grouped under one of the 5 OMB race category codes.

    \n

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/detailed-race","version":"3.1.0","name":"DetailedRace","title":"Detailed Race","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","description":"The 900+ [CDC Race codes](http://www.cdc.gov/phin/resources/vocabulary/index.html) that are grouped under one of the 5 OMB race category codes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","filter":[{"property":"concept","op":"is-a","value":"1000-9"}]}],"exclude":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"1002-5"},{"code":"2028-9"},{"code":"2054-5"},{"code":"2076-8"},{"code":"2106-3"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-omb-ethnicity-category.json b/resources/uscore_v3.1.0/ValueSet-omb-ethnicity-category.json new file mode 100755 index 000000000..54a36a9f2 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-omb-ethnicity-category.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"omb-ethnicity-category","text":{"status":"generated","div":"

    OMB Ethnicity Categories

    The codes for the ethnicity categories - 'Hispanic or Latino' and 'Non Hispanic or Latino' - as defined by the OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997.

    \n

    This value set includes codes from the following code systems:

    • Include these codes as defined in urn:oid:2.16.840.1.113883.6.238
      CodeDisplay
      2135-2Hispanic or LatinoHispanic or Latino
      2186-5Non Hispanic or LatinoNote that this term remains in the table for completeness, even though within HL7, the notion of "not otherwise coded" term is deprecated.
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/omb-ethnicity-category","version":"3.1.0","name":"OmbEthnicityCategories","title":"OMB Ethnicity Categories","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","description":"The codes for the ethnicity categories - 'Hispanic or Latino' and 'Non Hispanic or Latino' - as defined by the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards).","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"2135-2","display":"Hispanic or Latino"},{"code":"2186-5","display":"Non Hispanic or Latino"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-omb-race-category.json b/resources/uscore_v3.1.0/ValueSet-omb-race-category.json new file mode 100755 index 000000000..731f98cf0 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-omb-race-category.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"omb-race-category","text":{"status":"generated","div":"

    OMB Race Categories

    The codes for the concepts 'Unknown' and 'Asked but no answer' and the the codes for the five race categories - 'American Indian' or 'Alaska Native', 'Asian', 'Black or African American', 'Native Hawaiian or Other Pacific Islander', and 'White' - as defined by the OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997 .

    \n

    This value set includes codes from the following code systems:

    • Include these codes as defined in urn:oid:2.16.840.1.113883.6.238
      CodeDisplay
      1002-5American Indian or Alaska NativeAmerican Indian or Alaska Native
      2028-9AsianAsian
      2054-5Black or African AmericanBlack or African American
      2076-8Native Hawaiian or Other Pacific IslanderNative Hawaiian or Other Pacific Islander
      2106-3WhiteWhite
    • Include these codes as defined in http://terminology.hl7.org/CodeSystem/v3-NullFlavor
      CodeDisplay
      UNKUnknownDescription:A proper value is applicable, but not known.
      \n \n Usage Notes: This means the actual value is not known. If the only thing that is unknown is how to properly express the value in the necessary constraints (value set, datatype, etc.), then the OTH or UNC flavor should be used. No properties should be included for a datatype with this property unless:
      \n \n Those properties themselves directly translate to a semantic of "unknown". (E.g. a local code sent as a translation that conveys 'unknown')\n Those properties further qualify the nature of what is unknown. (E.g. specifying a use code of "H" and a URL prefix of "tel:" to convey that it is the home phone number that is unknown.)
      ASKUAsked but no answerInformation was sought but not found (e.g., patient was asked but didn't know)
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/omb-race-category","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113883.4.642.2.575"}],"version":"3.1.0","name":"OmbRaceCategories","title":"OMB Race Categories","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]},{"telecom":[{"system":"other","value":"http://wiki.siframework.org/Data+Access+Framework+Homepage"}]}],"description":"The codes for the concepts 'Unknown' and 'Asked but no answer' and the the codes for the five race categories - 'American Indian' or 'Alaska Native', 'Asian', 'Black or African American', 'Native Hawaiian or Other Pacific Islander', and 'White' - as defined by the [OMB Standards for Maintaining, Collecting, and Presenting Federal Data on Race and Ethnicity, Statistical Policy Directive No. 15, as revised, October 30, 1997](https://www.whitehouse.gov/omb/fedreg_1997standards) .","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:oid:2.16.840.1.113883.6.238","concept":[{"code":"1002-5","display":"American Indian or Alaska Native"},{"code":"2028-9","display":"Asian"},{"code":"2054-5","display":"Black or African American"},{"code":"2076-8","display":"Native Hawaiian or Other Pacific Islander"},{"code":"2106-3","display":"White"}]},{"system":"http://terminology.hl7.org/CodeSystem/v3-NullFlavor","concept":[{"code":"UNK","display":"Unknown"},{"code":"ASKU","display":"Asked but no answer"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-simple-language.json b/resources/uscore_v3.1.0/ValueSet-simple-language.json new file mode 100755 index 000000000..a8ec4ec29 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-simple-language.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"simple-language","text":{"status":"generated","div":"

    Language codes with language and optionally a region modifier

    This value set includes codes from BCP-47. This value set matches the ONC 2015 Edition LanguageCommunication data element value set within C-CDA to use a 2 character language code if one exists, and a 3 character code if a 2 character code does not exist. It points back to RFC 5646, however only the language codes are required, all other elements are optional.

    \n

    This value set includes codes from the following code systems:

    • Include codes from urn:ietf:bcp:47 where ext-lang doesn't exist, script doesn't exist, variant doesn't exist, extension doesn't exist and private-use doesn't exist
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/simple-language","version":"3.1.0","name":"LanguageCodesWithLanguageAndOptionallyARegionModifier","title":"Language codes with language and optionally a region modifier","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://hl7.org/fhir"}]}],"description":"This value set includes codes from [BCP-47](http://tools.ietf.org/html/bcp47). This value set matches the ONC 2015 Edition LanguageCommunication data element value set within C-CDA to use a 2 character language code if one exists, and a 3 character code if a 2 character code does not exist. It points back to [RFC 5646](https://tools.ietf.org/html/rfc5646), however only the language codes are required, all other elements are optional.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"urn:ietf:bcp:47","filter":[{"property":"ext-lang","op":"exists","value":"false"},{"property":"script","op":"exists","value":"false"},{"property":"variant","op":"exists","value":"false"},{"property":"extension","op":"exists","value":"false"},{"property":"private-use","op":"exists","value":"false"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-allergy-substance.json b/resources/uscore_v3.1.0/ValueSet-us-core-allergy-substance.json new file mode 100755 index 000000000..0283a6c2d --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-allergy-substance.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-allergy-substance","text":{"status":"generated","div":"

    US Core Common substances for allergy and intolerance documentation including refutations

    Documentation of substances suspected of (or not suspected of) causing an allergy or intolerance reaction in an individual. Inclusion Criteria: specific or general substances to which a patient may be exposed and which may be suspected of causing an adverse reaction; assertions refuting these suspicions. This includes: 1. Common dietary substances for allergy and intolerance documentation (SNOMEDCT) 2. Common drug classes for allergy and intolerance documentation (SNOMEDCT) 3. Common drug substances for allergy and intolerance documentation (RXNORM) 4. Common environmental substances for allergy and intolerance documentation (SNOMEDCT) 5. Common refutations and null values for substance causes for allergy and intolerance documentation (SNOMEDCT) Exclusion Criteria: actual conditions caused by exposure (reactions, allergies)

    \n

    Copyright Statement: This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement

    This value set includes codes from the following code systems:

    • Include these codes as defined in http://www.nlm.nih.gov/research/umls/rxnorm
      CodeDisplay
      1002293formoterol / Mometasone
      1007388Lactase / rennet
      1008298Acetaminophen / Caffeine / Chlorpheniramine / Hydrocodone / Phenylephrine
      1008519guaiacolsulfonate / Hydrocodone
      1009148Ampicillin / Sulbactam
      10109Streptomycin
      10154Succinylcholine
      10156Sucralfate
      10169Sulfacetamide
      10171Sulfadiazine
      10180Sulfamethoxazole
      10207Sulfisoxazole
      10223Sulfur
      10237Sulindac
      10324Tamoxifen
      10355Temazepam
      10368Terbutaline
      1037042dabigatran etexilate
      10379Testosterone
      10395Tetracycline
      103990Carbidopa / Levodopa
      1040028lurasidone
      10438Theophylline
      10472Thimerosal
      10493Thiopental
      10502Thioridazine
      10510Thiothixene
      10582levothyroxine
      10594Ticlopidine
      10600Timolol
      10627Tobramycin
      10636Tolmetin
      10689Tramadol
      10737Trazodone
      10759Triamcinolone
      107602Epinephrine / Lidocaine
      10763Triamterene
      10767Triazolam
      10800Trifluoperazine
      108118Mometasone
      10829Trimethoprim
      10831Sulfamethoxazole / Trimethoprim
      11124Vancomycin
      1114195rivaroxaban
      1116632Ticagrelor
      11170Verapamil
      11248Vitamin B 12
      11253Vitamin D
      11256Vitamin E
      11289Warfarin
      113588Erythromycin / Sulfisoxazole
      11416Zinc
      11423Zinc Oxide
      114477Levetiracetam
      114970zafirlukast
      114979rabeprazole
      1151Ascorbic Acid
      115264Ibandronate
      115552trovafloxacin
      115698ziprasidone
      1191Aspirin
      119565tolterodine
      1202Atenolol
      121191rituximab
      1223Atropine
      1256Azathioprine
      1272Aztreonam
      1291Bacitracin
      1292Baclofen
      1310171Gadolinium
      1311085xanthine
      1311524Aspartame
      1311629nickel
      1314891Latex
      1331Barium Sulfate
      134615brimonidine
      1347Beclomethasone
      135447donepezil
      135775zolmitriptan
      1359Belladonna Alkaloids
      1362879Sulfur Dioxide
      1363043ethyl ether
      136411sildenafil
      1364430apixaban
      138099gemifloxacin
      139462moxifloxacin
      1399Benzocaine
      140587celecoxib
      1406benzoin resin
      141626colesevelam
      1418Benzoyl Peroxide
      1424Benztropine
      1514Betamethasone
      153970Hyoscyamine
      1596450Gentamicin
      15996Mirtazapine
      161Acetaminophen
      16681Acarbose
      167Acetazolamide
      17128lansoprazole
      1727875Tetanus immune globulin
      17300alfuzosin
      17767Amlodipine
      1827Buspirone
      183379rivastigmine
      1841Butorphanol
      18631Azithromycin
      187832pregabalin
      1886Caffeine
      18867benazepril
      1895Calcium
      1897Calcium Carbonate
      18993benzonatate
      190376linezolid
      191831infliximab
      19478bismuth subsalicylate
      19552cefprozil
      19711Amoxicillin / Clavulanate
      19831Budesonide
      1998Captopril
      2002Carbamazepine
      20352carvedilol
      20481cefepime
      20489cefpodoxime
      20610Cetirizine
      2101Carisoprodol
      21107cilostazol
      21183Citric Acid
      21212Clarithromycin
      214130Acetaminophen / butalbital / Caffeine
      214153Acetaminophen / dichloralphenazone / isometheptene
      214159Aspirin / butalbital / Caffeine
      214160Aspirin / butalbital / Caffeine / Codeine
      214181Acetaminophen / Diphenhydramine
      214182Acetaminophen / Hydrocodone
      214183Acetaminophen / Oxycodone
      214199Albuterol / Ipratropium
      214223Amlodipine / benazepril
      214250Aspirin / Caffeine
      214256Aspirin / Oxycodone
      214257Aspirin / Pentazocine
      214317Bisoprolol / Hydrochlorothiazide
      214336Caffeine / Ergotamine
      214354candesartan
      214364carbinoxamine / Pseudoephedrine
      214392Chlorpheniramine / Hydrocodone
      214442Codeine / Guaifenesin
      214445Codeine / Pseudoephedrine
      214488Dextromethorphan / Guaifenesin
      214502Diclofenac / Misoprostol
      214555Etanercept
      214558Ethinyl Estradiol / Levonorgestrel
      214565fexofenadine / Pseudoephedrine
      214599Guaifenesin / Pseudoephedrine
      214614homatropine / Hydrocodone
      214617Hydrochlorothiazide / irbesartan
      214618Hydrochlorothiazide / Lisinopril
      214619Hydrochlorothiazide / Losartan
      214626Hydrochlorothiazide / valsartan
      214627Hydrocodone / Ibuprofen
      214631Hydrocodone / Pseudoephedrine
      214682Loratadine / Pseudoephedrine
      214721Naloxone / Pentazocine
      214807Pseudoephedrine / Triprolidine
      2176Cefaclor
      217627Hydrocortisone / Neomycin / Polymyxin B
      2177Cefadroxil
      2180Cefazolin
      2189Cefoxitin
      2191Ceftazidime
      2193Ceftriaxone
      219314Polymyxin B / Trimethoprim
      219315Iron polysaccharide
      2194Cefuroxime
      21949cyclobenzaprine
      221147POLYETHYLENE GLYCOL 3350
      22299Daptomycin
      2231Cephalexin
      226716Aspirin / Dipyridamole
      228476gatifloxacin
      228790Dutasteride
      232158rofecoxib
      233698dronedarone
      2348Chloramphenicol
      2356Chlordiazepoxide
      2358Chlorhexidine
      236778Trospium
      237159Levalbuterol
      2393Chloroquine
      2400Chlorpheniramine
      2403Chlorpromazine
      2409Chlorthalidone
      2410Chlorzoxazone
      2418Cholecalciferol
      2447Cholestyramine Resin
      24605Etodolac
      24947ferrous sulfate
      25025Finasteride
      25033Cefixime
      25037cefdinir
      25120flunisolide
      25255formoterol
      253157Bee pollen
      2541Cimetidine
      25480gabapentin
      2551Ciprofloxacin
      2556Citalopram
      25789glimepiride
      2582Clindamycin
      258337Hydrochlorothiazide / Triamterene
      2598Clonazepam
      2599Clonidine
      260101Oseltamivir
      26225Ondansetron
      2623Clotrimazole
      2670Codeine
      2683Colchicine
      2685Colestipol
      27169leflunomide
      274783Insulin Glargine
      274786telithromycin
      27723iodinated glycerol
      278567valdecoxib
      28031Itraconazole
      281Acyclovir
      283742Esomeprazole
      283809travoprost
      28439lamotrigine
      284635fluticasone / salmeterol
      2878Cortisone
      28889Loratadine
      28981loracarbef
      29046Lisinopril
      29542Mercury, Ammoniated
      29561meropenem
      296Adenosine
      3008Cyclosporine
      301542rosuvastatin
      306674vardenafil
      3108Dapsone
      3143prasterone
      31448nabumetone
      31555nebivolol
      31565nefazodone
      31738nickel sulfate
      318340Aloe vera preparation
      321064olmesartan
      321988Escitalopram
      322167Solifenacin
      3247Desipramine
      325642ertapenem
      32592oxaliplatin
      32613oxaprozin
      32624oxcarbazepine
      3264Dexamethasone
      32675oxybutynin
      327361adalimumab
      3289Dextromethorphan
      32937Paroxetine
      32968clopidogrel
      3322Diazepam
      33408phenyltoloxamine
      3355Diclofenac
      3356Dicloxacillin
      3361Dicyclomine
      33738pioglitazone
      3393Diflunisal
      3407Digoxin
      341248ezetimibe
      3418Dihydroergotamine
      3423Hydromorphone
      3443Diltiazem
      3444Dimenhydrinate
      3498Diphenhydramine
      35208quinapril
      3521Dipyridamole
      352362Acetaminophen / Tramadol
      35296Ramipril
      35382resorcinol
      35636Risperidone
      358263tadalafil
      35827Ketorolac
      35829ranolazine
      36108Salsalate
      36117salmeterol
      3616Dobutamine
      3638Doxepin
      3640Doxycycline
      36437Sertraline
      3648Droperidol
      36567Simvastatin
      37418Sumatriptan
      37617tazobactam
      37798Terazosin
      37801terbinafine
      3827Enalapril
      3829Enalaprilat
      38400atomoxetine
      38404topiramate
      38413torsemide
      38574trichloroacetaldehyde
      38685trimethobenzamide
      389132Budesonide / formoterol
      3966Ephedrine
      39786venlafaxine
      3992Epinephrine
      39993zolpidem
      39998zonisamide
      40048Carboplatin
      400674dexbrompheniramine / Pseudoephedrine
      4025Ergotamine
      40254Valproate
      4053Erythromycin
      40575zileuton
      40790pantoprazole
      4083Estradiol
      4099Estrogens, Conjugated (USP)
      41126fluticasone
      41127fluvastatin
      4124Ethinyl Estradiol
      41397Lactase
      41493meloxicam
      42330Terfenadine
      42331Misoprostol
      42347Bupropion
      42351Lithium Carbonate
      42372Mupirocin
      42463Pravastatin
      4278Famotidine
      4316Felodipine
      4337Fentanyl
      435Albuterol
      43611latanoprost
      4419Fish Oils
      4441Flecainide
      4450Fluconazole
      448Ethanol
      4492Fluorouracil
      4493Fluoxetine
      4496Fluphenazine
      4500Flurandrenolide
      4530Formaldehyde
      4603Furosemide
      46041Alendronate
      461016Eszopiclone
      4637Galantamine
      465397Ciprofloxacin / Dexamethasone
      466522Diphenhydramine / Zinc Acetate
      466541Neomycin / Polymyxin B
      466549Aspirin / Caffeine / Orphenadrine
      466553penicillin G benzathine / penicillin G procaine
      466566Acetaminophen / Dextromethorphan / Diphenhydramine / Pseudoephedrine
      466584Acetaminophen / Aspirin / Caffeine
      4719Gemfibrozil
      475968liraglutide
      4815Glyburide
      48203Clavulanate
      4821Glipizide
      48274Acetaminophen / Propoxyphene
      484139Chlorhexidine / Isopropyl Alcohol
      484211ezetimibe / Simvastatin
      4850Glucose
      4917Nitroglycerin
      49276Doxazosin
      50166Fosinopril
      5021Griseofulvin
      5032Guaifenesin
      5093Haloperidol
      51272quetiapine
      519Allopurinol
      52175Losartan
      5224heparin
      52582mesalamine
      5470Hydralazine
      5487Hydrochlorothiazide
      5489Hydrocodone
      5492Hydrocortisone
      5499Hydrogen Peroxide
      5521Hydroxychloroquine
      5553Hydroxyzine
      5640Ibuprofen
      5691Imipramine
      56946Paclitaxel
      57258tizanidine
      5764Indapamide
      5781Indomethacin
      588250milnacipran
      59078metaxalone
      591622varenicline
      5933Iodine
      593411sitagliptin
      594040Atropine / Diphenoxylate
      5956Iohexol
      596Alprazolam
      596723cerivastatin
      597142brimonidine / Timolol
      5992Iron-Dextran Complex
      60207dorzolamide
      6038isoniazid
      60548exenatide
      6057Isosorbide
      6058Isosorbide Dinitrate
      611854Chlordiazepoxide / clidinium
      6130Ketamine
      6135Ketoconazole
      61381olanzapine
      6142Ketoprofen
      6185Labetalol
      620Amantadine
      6218Lactulose
      6227Lanolin
      6387Lidocaine
      6398Lincomycin
      6448Lithium
      645555Bacitracin / Polymyxin B
      6468Loperamide
      6470Lorazepam
      6472Lovastatin
      6574Magnesium
      6585Magnesium Sulfate
      662263dorzolamide / Timolol
      6676Meclizine
      6691Medroxyprogesterone
      67108Enoxaparin
      6711Melatonin
      6719Memantine
      6750Menthol
      6754Meperidine
      6809Metformin
      6813Methadone
      6835Methimazole
      6845Methocarbamol
      6851Methotrexate
      6876Methyldopa
      689Aminophylline
      689467Oxytetracycline / Polymyxin B
      689518Aspirin / Caffeine / Propoxyphene
      689556Acetaminophen / Aspirin / Phenylpropanolamine
      689558Acetaminophen / Brompheniramine / Pseudoephedrine
      689561Acetaminophen / butalbital / Caffeine / Codeine
      689582Acetaminophen / Chlorpheniramine / Dextromethorphan / Pseudoephedrine
      689606Atropine / Hyoscyamine / Phenobarbital / Scopolamine
      689623Bacitracin / Hydrocortisone / Neomycin / Polymyxin B
      690077Benzalkonium / Lidocaine
      6901Methylphenidate
      6902Methylprednisolone
      690693Diphenhydramine / Phenylephrine
      690808Brompheniramine / Dextromethorphan / Pseudoephedrine
      69120tiotropium
      6915Metoclopramide
      6916Metolazone
      6918Metoprolol
      6922Metronidazole
      692572Bacitracin / Neomycin / Polymyxin B
      692794Gramicidin / Neomycin / Polymyxin B
      6932Miconazole
      6960Midazolam
      69749valsartan
      6980Minocycline
      6984Minoxidil
      703Amiodarone
      704Amitriptyline
      7052Morphine
      705258Acetaminophen / Dextromethorphan / Doxylamine
      7213Ipratropium
      72143Raloxifene
      72236fosphenytoin
      723Amoxicillin
      72302ropinirole
      7233Nafcillin
      7238Nalbuphine
      7243Naltrexone
      725Amphetamine
      7258Naproxen
      72625duloxetine
      7299Neomycin
      73056Risedronate
      733Ampicillin
      73494telmisartan
      73645valacyclovir
      7393Niacin
      7407Nicotine
      74169Piperacillin / tazobactam
      7417Nifedipine
      7454Nitrofurantoin
      746741Pramipexole
      7486Nitrous Oxide
      7517Norfloxacin
      7531Nortriptyline
      7597Nystatin
      7623Ofloxacin
      7646Omeprazole
      7676Opium
      7715Orphenadrine
      77492tamsulosin
      7804Oxycodone
      7821Oxytetracycline
      787390tapentadol
      7975Penicillamine
      797541Isopropyl Alcohol
      7980Penicillin G
      7984Penicillin V
      7994Pentamidine
      8001Pentazocine
      8120Phenazopyridine
      8134Phenobarbital
      815166Dextromethorphan / Doxylamine
      8163Phenylephrine
      816346dexlansoprazole
      8175Phenylpropanolamine
      817579Acetaminophen / Codeine
      817958Aspirin / Calcium Carbonate
      8183Phenytoin
      82122Levofloxacin
      822929Amphetamine aspartate / Amphetamine Sulfate / Dextroamphetamine saccharate / Dextroamphetamine Sulfate
      83367atorvastatin
      8356Piroxicam
      83818irbesartan
      84108rosiglitazone
      8536Polymyxin B
      857974saxagliptin
      8588Potassium
      8591Potassium Chloride
      8610Povidone
      8611Povidone-Iodine
      861634pitavastatin
      8629Prazosin
      8638prednisolone
      8640Prednisone
      8687Primaquine
      8691Primidone
      8698Probenecid
      8700Procainamide
      8701Procaine
      8703Fenofibrate
      8704Prochlorperazine
      8727Progesterone
      8745Promethazine
      8754Propafenone
      87636fexofenadine
      8782Propofol
      8785Propoxyphene
      8787Propranolol
      8794Propylthiouracil
      88014rizatriptan
      88249montelukast
      883815Dexamethasone / Tobramycin
      8896Pseudoephedrine
      89013aripiprazole
      8928Psyllium
      8948Purified Protein Derivative of Tuberculin
      90176Iron
      9068Quinidine
      9071Quinine
      91263Aloe Extract
      9143Ranitidine
      9384Rifampin
      9524Sulfasalazine
      9601Scopolamine
      9778Silicones
      9793silver sulfadiazine
      9947Sotalol
      9997Spironolactone
    • Include these codes as defined in http://snomed.info/sct
      CodeDisplay
      102259006Citrus fruit (substance)
      102261002Strawberry (substance)
      102262009Chocolate (substance)
      102263004Eggs (edible) (substance)
      102264005Cheese (substance)
      111088007Latex (substance)
      111151007Anabolic steroid (substance)
      11526002Aspartame (substance)
      116274004Artificial sweetener (substance)
      116566001Steroid (substance)
      13577000Nut (substance)
      14443002Substance with aminoglycoside structure and antibacterial mechanism of action (substance)
      226723006Buckwheat - cereal (substance)
      226734009Wheatgerm (substance)
      226760005Dairy foods (substance)
      226915003Red meat (substance)
      226916002Beef (substance)
      226934003Pork (substance)
      226955001Chicken - meat (substance)
      226967004Turkey - meat (substance)
      227144008Tuna fish (substance)
      227151004Prawns (substance)
      227208008Abalone canned in brine (substance)
      227219006Aubergine (substance)
      227313005Pulse vegetables (substance)
      227388008Cinnamon (substance)
      227400003Ginger (substance)
      227421003Cranberries (substance)
      227444000Raspberries (substance)
      227493005Cashew nut (substance)
      227512001Pistachio nut (substance)
      227598003Honey (substance)
      228102000Sodium nitrate (substance)
      255632006Anticonvulsant (substance)
      255637000Salicylate (substance)
      255641001Caffeine (substance)
      256259004Pollen (substance)
      256277009Grass pollen (substance)
      256306003Orange - fruit (substance)
      256307007Banana (substance)
      256313003Pineapple (substance)
      256315005Grapefruit (substance)
      256317002Grapes (substance)
      256319004Carrot (substance)
      256326004Celery (substance)
      256329006Spinach (substance)
      256350002Almond (substance)
      256351003Brazil nut (substance)
      256352005Walnut - nut (substance)
      256353000Hazelnut (substance)
      256354006Bean (substance)
      256417003Horse dander (substance)
      256440004Wasp venom (substance)
      259858000Varicella-zoster virus antibody (substance)
      260152009Cat dander (substance)
      260154005Dog dander (substance)
      260167008Sesame seed (substance)
      260176001Kiwi fruit (substance)
      260177005Melon (substance)
      260179008Mango fruit (substance)
      260184002Peas (substance)
      260189007Pecan nut (substance)
      260205009Sunflower seed (substance)
      264287008Animal dander (substance)
      264337003Seed (substance)
      28230009Poultry (substance)
      288328004Bee venom (substance)
      28942008Coconut oil (substance)
      29263009Coffee (substance)
      304275008Corticosteroid and corticosteroid derivative (substance)
      33008008Dust (substance)
      350327004Diphtheria + tetanus vaccine (product)
      35748005Wine (substance)
      360201004Nitrofuran derivative (substance)
      3692009Sodium sulfite (substance)
      372480009Substance with macrolide structure and antibacterial mechanism of action (substance)
      372664007Benzodiazepine (substance)
      372665008Non-steroidal anti-inflammatory agent (substance)
      372711004Sulfonylurea (substance)
      372722000Substance with quinolone structure and antibacterial mechanism of action (substance)
      372733002Substance with angiotensin-converting enzyme inhibitor mechanism of action (substance)
      372747003Thiazide diuretic (substance)
      372783007Antiparkinsonian agent (substance)
      372798009Barbiturate (substance)
      372806008Substance with histamine receptor antagonist mechanism of action (substance)
      372889003First generation cephalosporin (substance)
      372912004Substance with 3-hydroxy-3-methylglutaryl-coenzyme A reductase inhibitor mechanism of action (substance)
      372913009Substance with angiotensin II receptor antagonist mechanism of action (substance)
      373206009Substance with tetracycline structure and antibacterial mechanism of action (substance)
      373253007Tricyclic antidepressant (substance)
      373254001Substance with beta adrenergic receptor antagonist mechanism of action (substance)
      373262009Substance with cephalosporin structure and antibacterial mechanism of action (substance)
      373270004Substance with penicillin structure and antibacterial mechanism of action (substance)
      373297006Substance with beta-lactam structure and antibacterial mechanism of action (substance)
      373304005Substance with calcium channel blocker mechanism of action (substance)
      373531009Gelatin (substance)
      385420005Contrast media (substance)
      386127005Formula milk (substance)
      386962001Plasma protein fraction (substance)
      387050005Substance with prostaglandin-endoperoxide synthase isoform 2 inhibitor mechanism of action (substance)
      387406002Sulfonamide (substance)
      391737006Almond oil (substance)
      391739009Aloe (substance)
      396345004Carbapenem (substance)
      396420001Anthrax vaccine (substance)
      396425006Influenza virus vaccine (substance)
      396433007Pertussis vaccine (substance)
      396439006Smallpox vaccine (substance)
      396441007Typhoid vaccine (substance)
      396442000Varicella virus vaccine (substance)
      398730001Pneumococcal vaccine (substance)
      400872007Hydrocolloid (substance)
      404642006Substance with opioid receptor agonist mechanism of action (substance)
      406748003Carbamate (substance)
      409137002No known drug allergy (situation)
      412061001Blueberries (substance)
      412062008Cantaloupe (substance)
      412066006Pepper (substance)
      412068007Rye (substance)
      412071004Wheat (substance)
      412138001Horse serum protein (substance)
      412357001Corn (substance)
      412373007Diphtheria + pertussis + tetanus + Haemophilus influenzae type b vaccine (product)
      412375000Tetanus vaccine (substance)
      412533000Wheat bran (substance)
      412534006Yeast (substance)
      412583005Bee pollen (substance)
      41598000Estrogen (substance)
      417889008Arachis oil (substance)
      418000008Methadone analog (substance)
      418504009Oats (substance)
      418920007Adhesive agent (substance)
      419420009Watermelon (substance)
      419933005Glucocorticoid (substance)
      421245007Diphtheria + pertussis + tetanus vaccine (product)
      424369009Product containing beta-galactosidase (medicinal product)
      426722004Iodinated contrast media (substance)
      428607008No known environmental allergy (situation)
      429625007No known food allergy (situation)
      43735007Sulfur (substance)
      43921001Nickel compound (substance)
      44027008Seafood (substance)
      442381000124103Blue food coloring (substance)
      442571000124108Tree nut (substance)
      442771000124102Pepperoni (substance)
      44588005Iodine (substance)
      446273004Red food coloring (substance)
      446274005Yellow food coloring (substance)
      47703008Lactose (substance)
      51386004Food preservative (substance)
      51905005Mustard (substance)
      53041004Alcohol (substance)
      61789006Dye (substance)
      63045006Berry (substance)
      67324005Rice (substance)
      67866001Insulin (substance)
      70813002Milk (substance)
      710179004Lupine seed (substance)
      716184000No known latex allergy (situation)
      716186003No known allergy (situation)
      720687003Dust mite protein (substance)
      72511004Fruit (substance)
      726730005Yam (substance)
      734881000Tomato (substance)
      735006003Squid (substance)
      735009005Salmon (substance)
      735029006Shellfish (substance)
      735030001Garlic (substance)
      735043001Mackerel (substance)
      735045008Mushroom (substance)
      735047000Onion (substance)
      735049002Peach (substance)
      735050002Pear (substance)
      735051003Plum (substance)
      735053000Potato (substance)
      735123009Broccoli (substance)
      735124003Barley (substance)
      735211005Coconut (substance)
      735212003Papaya (substance)
      735213008Cucumber (substance)
      735214002Apricot (substance)
      735215001Apple (substance)
      735248001Cherry (substance)
      735249009Avocado (substance)
      735340006Lemon (substance)
      735959004Marine mollusk (substance)
      735971005Fish (substance)
      735977009Marine crustacean (substance)
      736027000Scallop (substance)
      736030007Clam (substance)
      736031006Oyster (substance)
      736159005Crab (substance)
      736162008Lobster (substance)
      74801000Sugar (substance)
      75665004Monosodium glutamate (substance)
      762952008Peanut (substance)
      7791007Soy protein (substance)
      80259003Food flavoring agent (substance)
      84489001Mold (organism)
      89119000Nitrate salt (substance)
      89707004Sesame oil (substance)
      89811004Gluten (substance)
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-allergy-substance","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113762.1.4.1186.8"}],"version":"3.1.0","name":"USCoreAllergySubstance","title":"US Core Common substances for allergy and intolerance documentation including refutations","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"description":"Documentation of substances suspected of (or not suspected of) causing an allergy or intolerance reaction in an individual. **Inclusion Criteria:** specific or general substances to which a patient may be exposed and which may be suspected of causing an adverse reaction; assertions refuting these suspicions. This includes: 1. Common dietary substances for allergy and intolerance documentation (SNOMEDCT) 2. Common drug classes for allergy and intolerance documentation (SNOMEDCT) 3. Common drug substances for allergy and intolerance documentation (RXNORM) 4. Common environmental substances for allergy and intolerance documentation (SNOMEDCT) 5. Common refutations and null values for substance causes for allergy and intolerance documentation (SNOMEDCT) **Exclusion Criteria:** actual conditions caused by exposure (reactions, allergies)","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement","compose":{"include":[{"system":"http://www.nlm.nih.gov/research/umls/rxnorm","concept":[{"code":"1002293","display":"formoterol / Mometasone"},{"code":"1007388","display":"Lactase / rennet"},{"code":"1008298","display":"Acetaminophen / Caffeine / Chlorpheniramine / Hydrocodone / Phenylephrine"},{"code":"1008519","display":"guaiacolsulfonate / Hydrocodone"},{"code":"1009148","display":"Ampicillin / Sulbactam"},{"code":"10109","display":"Streptomycin"},{"code":"10154","display":"Succinylcholine"},{"code":"10156","display":"Sucralfate"},{"code":"10169","display":"Sulfacetamide"},{"code":"10171","display":"Sulfadiazine"},{"code":"10180","display":"Sulfamethoxazole"},{"code":"10207","display":"Sulfisoxazole"},{"code":"10223","display":"Sulfur"},{"code":"10237","display":"Sulindac"},{"code":"10324","display":"Tamoxifen"},{"code":"10355","display":"Temazepam"},{"code":"10368","display":"Terbutaline"},{"code":"1037042","display":"dabigatran etexilate"},{"code":"10379","display":"Testosterone"},{"code":"10395","display":"Tetracycline"},{"code":"103990","display":"Carbidopa / Levodopa"},{"code":"1040028","display":"lurasidone"},{"code":"10438","display":"Theophylline"},{"code":"10472","display":"Thimerosal"},{"code":"10493","display":"Thiopental"},{"code":"10502","display":"Thioridazine"},{"code":"10510","display":"Thiothixene"},{"code":"10582","display":"levothyroxine"},{"code":"10594","display":"Ticlopidine"},{"code":"10600","display":"Timolol"},{"code":"10627","display":"Tobramycin"},{"code":"10636","display":"Tolmetin"},{"code":"10689","display":"Tramadol"},{"code":"10737","display":"Trazodone"},{"code":"10759","display":"Triamcinolone"},{"code":"107602","display":"Epinephrine / Lidocaine"},{"code":"10763","display":"Triamterene"},{"code":"10767","display":"Triazolam"},{"code":"10800","display":"Trifluoperazine"},{"code":"108118","display":"Mometasone"},{"code":"10829","display":"Trimethoprim"},{"code":"10831","display":"Sulfamethoxazole / Trimethoprim"},{"code":"11124","display":"Vancomycin"},{"code":"1114195","display":"rivaroxaban"},{"code":"1116632","display":"Ticagrelor"},{"code":"11170","display":"Verapamil"},{"code":"11248","display":"Vitamin B 12"},{"code":"11253","display":"Vitamin D"},{"code":"11256","display":"Vitamin E"},{"code":"11289","display":"Warfarin"},{"code":"113588","display":"Erythromycin / Sulfisoxazole"},{"code":"11416","display":"Zinc"},{"code":"11423","display":"Zinc Oxide"},{"code":"114477","display":"Levetiracetam"},{"code":"114970","display":"zafirlukast"},{"code":"114979","display":"rabeprazole"},{"code":"1151","display":"Ascorbic Acid"},{"code":"115264","display":"Ibandronate"},{"code":"115552","display":"trovafloxacin"},{"code":"115698","display":"ziprasidone"},{"code":"1191","display":"Aspirin"},{"code":"119565","display":"tolterodine"},{"code":"1202","display":"Atenolol"},{"code":"121191","display":"rituximab"},{"code":"1223","display":"Atropine"},{"code":"1256","display":"Azathioprine"},{"code":"1272","display":"Aztreonam"},{"code":"1291","display":"Bacitracin"},{"code":"1292","display":"Baclofen"},{"code":"1310171","display":"Gadolinium"},{"code":"1311085","display":"xanthine"},{"code":"1311524","display":"Aspartame"},{"code":"1311629","display":"nickel"},{"code":"1314891","display":"Latex"},{"code":"1331","display":"Barium Sulfate"},{"code":"134615","display":"brimonidine"},{"code":"1347","display":"Beclomethasone"},{"code":"135447","display":"donepezil"},{"code":"135775","display":"zolmitriptan"},{"code":"1359","display":"Belladonna Alkaloids"},{"code":"1362879","display":"Sulfur Dioxide"},{"code":"1363043","display":"ethyl ether"},{"code":"136411","display":"sildenafil"},{"code":"1364430","display":"apixaban"},{"code":"138099","display":"gemifloxacin"},{"code":"139462","display":"moxifloxacin"},{"code":"1399","display":"Benzocaine"},{"code":"140587","display":"celecoxib"},{"code":"1406","display":"benzoin resin"},{"code":"141626","display":"colesevelam"},{"code":"1418","display":"Benzoyl Peroxide"},{"code":"1424","display":"Benztropine"},{"code":"1514","display":"Betamethasone"},{"code":"153970","display":"Hyoscyamine"},{"code":"1596450","display":"Gentamicin"},{"code":"15996","display":"Mirtazapine"},{"code":"161","display":"Acetaminophen"},{"code":"16681","display":"Acarbose"},{"code":"167","display":"Acetazolamide"},{"code":"17128","display":"lansoprazole"},{"code":"1727875","display":"Tetanus immune globulin"},{"code":"17300","display":"alfuzosin"},{"code":"17767","display":"Amlodipine"},{"code":"1827","display":"Buspirone"},{"code":"183379","display":"rivastigmine"},{"code":"1841","display":"Butorphanol"},{"code":"18631","display":"Azithromycin"},{"code":"187832","display":"pregabalin"},{"code":"1886","display":"Caffeine"},{"code":"18867","display":"benazepril"},{"code":"1895","display":"Calcium"},{"code":"1897","display":"Calcium Carbonate"},{"code":"18993","display":"benzonatate"},{"code":"190376","display":"linezolid"},{"code":"191831","display":"infliximab"},{"code":"19478","display":"bismuth subsalicylate"},{"code":"19552","display":"cefprozil"},{"code":"19711","display":"Amoxicillin / Clavulanate"},{"code":"19831","display":"Budesonide"},{"code":"1998","display":"Captopril"},{"code":"2002","display":"Carbamazepine"},{"code":"20352","display":"carvedilol"},{"code":"20481","display":"cefepime"},{"code":"20489","display":"cefpodoxime"},{"code":"20610","display":"Cetirizine"},{"code":"2101","display":"Carisoprodol"},{"code":"21107","display":"cilostazol"},{"code":"21183","display":"Citric Acid"},{"code":"21212","display":"Clarithromycin"},{"code":"214130","display":"Acetaminophen / butalbital / Caffeine"},{"code":"214153","display":"Acetaminophen / dichloralphenazone / isometheptene"},{"code":"214159","display":"Aspirin / butalbital / Caffeine"},{"code":"214160","display":"Aspirin / butalbital / Caffeine / Codeine"},{"code":"214181","display":"Acetaminophen / Diphenhydramine"},{"code":"214182","display":"Acetaminophen / Hydrocodone"},{"code":"214183","display":"Acetaminophen / Oxycodone"},{"code":"214199","display":"Albuterol / Ipratropium"},{"code":"214223","display":"Amlodipine / benazepril"},{"code":"214250","display":"Aspirin / Caffeine"},{"code":"214256","display":"Aspirin / Oxycodone"},{"code":"214257","display":"Aspirin / Pentazocine"},{"code":"214317","display":"Bisoprolol / Hydrochlorothiazide"},{"code":"214336","display":"Caffeine / Ergotamine"},{"code":"214354","display":"candesartan"},{"code":"214364","display":"carbinoxamine / Pseudoephedrine"},{"code":"214392","display":"Chlorpheniramine / Hydrocodone"},{"code":"214442","display":"Codeine / Guaifenesin"},{"code":"214445","display":"Codeine / Pseudoephedrine"},{"code":"214488","display":"Dextromethorphan / Guaifenesin"},{"code":"214502","display":"Diclofenac / Misoprostol"},{"code":"214555","display":"Etanercept"},{"code":"214558","display":"Ethinyl Estradiol / Levonorgestrel"},{"code":"214565","display":"fexofenadine / Pseudoephedrine"},{"code":"214599","display":"Guaifenesin / Pseudoephedrine"},{"code":"214614","display":"homatropine / Hydrocodone"},{"code":"214617","display":"Hydrochlorothiazide / irbesartan"},{"code":"214618","display":"Hydrochlorothiazide / Lisinopril"},{"code":"214619","display":"Hydrochlorothiazide / Losartan"},{"code":"214626","display":"Hydrochlorothiazide / valsartan"},{"code":"214627","display":"Hydrocodone / Ibuprofen"},{"code":"214631","display":"Hydrocodone / Pseudoephedrine"},{"code":"214682","display":"Loratadine / Pseudoephedrine"},{"code":"214721","display":"Naloxone / Pentazocine"},{"code":"214807","display":"Pseudoephedrine / Triprolidine"},{"code":"2176","display":"Cefaclor"},{"code":"217627","display":"Hydrocortisone / Neomycin / Polymyxin B"},{"code":"2177","display":"Cefadroxil"},{"code":"2180","display":"Cefazolin"},{"code":"2189","display":"Cefoxitin"},{"code":"2191","display":"Ceftazidime"},{"code":"2193","display":"Ceftriaxone"},{"code":"219314","display":"Polymyxin B / Trimethoprim"},{"code":"219315","display":"Iron polysaccharide"},{"code":"2194","display":"Cefuroxime"},{"code":"21949","display":"cyclobenzaprine"},{"code":"221147","display":"POLYETHYLENE GLYCOL 3350"},{"code":"22299","display":"Daptomycin"},{"code":"2231","display":"Cephalexin"},{"code":"226716","display":"Aspirin / Dipyridamole"},{"code":"228476","display":"gatifloxacin"},{"code":"228790","display":"Dutasteride"},{"code":"232158","display":"rofecoxib"},{"code":"233698","display":"dronedarone"},{"code":"2348","display":"Chloramphenicol"},{"code":"2356","display":"Chlordiazepoxide"},{"code":"2358","display":"Chlorhexidine"},{"code":"236778","display":"Trospium"},{"code":"237159","display":"Levalbuterol"},{"code":"2393","display":"Chloroquine"},{"code":"2400","display":"Chlorpheniramine"},{"code":"2403","display":"Chlorpromazine"},{"code":"2409","display":"Chlorthalidone"},{"code":"2410","display":"Chlorzoxazone"},{"code":"2418","display":"Cholecalciferol"},{"code":"2447","display":"Cholestyramine Resin"},{"code":"24605","display":"Etodolac"},{"code":"24947","display":"ferrous sulfate"},{"code":"25025","display":"Finasteride"},{"code":"25033","display":"Cefixime"},{"code":"25037","display":"cefdinir"},{"code":"25120","display":"flunisolide"},{"code":"25255","display":"formoterol"},{"code":"253157","display":"Bee pollen"},{"code":"2541","display":"Cimetidine"},{"code":"25480","display":"gabapentin"},{"code":"2551","display":"Ciprofloxacin"},{"code":"2556","display":"Citalopram"},{"code":"25789","display":"glimepiride"},{"code":"2582","display":"Clindamycin"},{"code":"258337","display":"Hydrochlorothiazide / Triamterene"},{"code":"2598","display":"Clonazepam"},{"code":"2599","display":"Clonidine"},{"code":"260101","display":"Oseltamivir"},{"code":"26225","display":"Ondansetron"},{"code":"2623","display":"Clotrimazole"},{"code":"2670","display":"Codeine"},{"code":"2683","display":"Colchicine"},{"code":"2685","display":"Colestipol"},{"code":"27169","display":"leflunomide"},{"code":"274783","display":"Insulin Glargine"},{"code":"274786","display":"telithromycin"},{"code":"27723","display":"iodinated glycerol"},{"code":"278567","display":"valdecoxib"},{"code":"28031","display":"Itraconazole"},{"code":"281","display":"Acyclovir"},{"code":"283742","display":"Esomeprazole"},{"code":"283809","display":"travoprost"},{"code":"28439","display":"lamotrigine"},{"code":"284635","display":"fluticasone / salmeterol"},{"code":"2878","display":"Cortisone"},{"code":"28889","display":"Loratadine"},{"code":"28981","display":"loracarbef"},{"code":"29046","display":"Lisinopril"},{"code":"29542","display":"Mercury, Ammoniated"},{"code":"29561","display":"meropenem"},{"code":"296","display":"Adenosine"},{"code":"3008","display":"Cyclosporine"},{"code":"301542","display":"rosuvastatin"},{"code":"306674","display":"vardenafil"},{"code":"3108","display":"Dapsone"},{"code":"3143","display":"prasterone"},{"code":"31448","display":"nabumetone"},{"code":"31555","display":"nebivolol"},{"code":"31565","display":"nefazodone"},{"code":"31738","display":"nickel sulfate"},{"code":"318340","display":"Aloe vera preparation"},{"code":"321064","display":"olmesartan"},{"code":"321988","display":"Escitalopram"},{"code":"322167","display":"Solifenacin"},{"code":"3247","display":"Desipramine"},{"code":"325642","display":"ertapenem"},{"code":"32592","display":"oxaliplatin"},{"code":"32613","display":"oxaprozin"},{"code":"32624","display":"oxcarbazepine"},{"code":"3264","display":"Dexamethasone"},{"code":"32675","display":"oxybutynin"},{"code":"327361","display":"adalimumab"},{"code":"3289","display":"Dextromethorphan"},{"code":"32937","display":"Paroxetine"},{"code":"32968","display":"clopidogrel"},{"code":"3322","display":"Diazepam"},{"code":"33408","display":"phenyltoloxamine"},{"code":"3355","display":"Diclofenac"},{"code":"3356","display":"Dicloxacillin"},{"code":"3361","display":"Dicyclomine"},{"code":"33738","display":"pioglitazone"},{"code":"3393","display":"Diflunisal"},{"code":"3407","display":"Digoxin"},{"code":"341248","display":"ezetimibe"},{"code":"3418","display":"Dihydroergotamine"},{"code":"3423","display":"Hydromorphone"},{"code":"3443","display":"Diltiazem"},{"code":"3444","display":"Dimenhydrinate"},{"code":"3498","display":"Diphenhydramine"},{"code":"35208","display":"quinapril"},{"code":"3521","display":"Dipyridamole"},{"code":"352362","display":"Acetaminophen / Tramadol"},{"code":"35296","display":"Ramipril"},{"code":"35382","display":"resorcinol"},{"code":"35636","display":"Risperidone"},{"code":"358263","display":"tadalafil"},{"code":"35827","display":"Ketorolac"},{"code":"35829","display":"ranolazine"},{"code":"36108","display":"Salsalate"},{"code":"36117","display":"salmeterol"},{"code":"3616","display":"Dobutamine"},{"code":"3638","display":"Doxepin"},{"code":"3640","display":"Doxycycline"},{"code":"36437","display":"Sertraline"},{"code":"3648","display":"Droperidol"},{"code":"36567","display":"Simvastatin"},{"code":"37418","display":"Sumatriptan"},{"code":"37617","display":"tazobactam"},{"code":"37798","display":"Terazosin"},{"code":"37801","display":"terbinafine"},{"code":"3827","display":"Enalapril"},{"code":"3829","display":"Enalaprilat"},{"code":"38400","display":"atomoxetine"},{"code":"38404","display":"topiramate"},{"code":"38413","display":"torsemide"},{"code":"38574","display":"trichloroacetaldehyde"},{"code":"38685","display":"trimethobenzamide"},{"code":"389132","display":"Budesonide / formoterol"},{"code":"3966","display":"Ephedrine"},{"code":"39786","display":"venlafaxine"},{"code":"3992","display":"Epinephrine"},{"code":"39993","display":"zolpidem"},{"code":"39998","display":"zonisamide"},{"code":"40048","display":"Carboplatin"},{"code":"400674","display":"dexbrompheniramine / Pseudoephedrine"},{"code":"4025","display":"Ergotamine"},{"code":"40254","display":"Valproate"},{"code":"4053","display":"Erythromycin"},{"code":"40575","display":"zileuton"},{"code":"40790","display":"pantoprazole"},{"code":"4083","display":"Estradiol"},{"code":"4099","display":"Estrogens, Conjugated (USP)"},{"code":"41126","display":"fluticasone"},{"code":"41127","display":"fluvastatin"},{"code":"4124","display":"Ethinyl Estradiol"},{"code":"41397","display":"Lactase"},{"code":"41493","display":"meloxicam"},{"code":"42330","display":"Terfenadine"},{"code":"42331","display":"Misoprostol"},{"code":"42347","display":"Bupropion"},{"code":"42351","display":"Lithium Carbonate"},{"code":"42372","display":"Mupirocin"},{"code":"42463","display":"Pravastatin"},{"code":"4278","display":"Famotidine"},{"code":"4316","display":"Felodipine"},{"code":"4337","display":"Fentanyl"},{"code":"435","display":"Albuterol"},{"code":"43611","display":"latanoprost"},{"code":"4419","display":"Fish Oils"},{"code":"4441","display":"Flecainide"},{"code":"4450","display":"Fluconazole"},{"code":"448","display":"Ethanol"},{"code":"4492","display":"Fluorouracil"},{"code":"4493","display":"Fluoxetine"},{"code":"4496","display":"Fluphenazine"},{"code":"4500","display":"Flurandrenolide"},{"code":"4530","display":"Formaldehyde"},{"code":"4603","display":"Furosemide"},{"code":"46041","display":"Alendronate"},{"code":"461016","display":"Eszopiclone"},{"code":"4637","display":"Galantamine"},{"code":"465397","display":"Ciprofloxacin / Dexamethasone"},{"code":"466522","display":"Diphenhydramine / Zinc Acetate"},{"code":"466541","display":"Neomycin / Polymyxin B"},{"code":"466549","display":"Aspirin / Caffeine / Orphenadrine"},{"code":"466553","display":"penicillin G benzathine / penicillin G procaine"},{"code":"466566","display":"Acetaminophen / Dextromethorphan / Diphenhydramine / Pseudoephedrine"},{"code":"466584","display":"Acetaminophen / Aspirin / Caffeine"},{"code":"4719","display":"Gemfibrozil"},{"code":"475968","display":"liraglutide"},{"code":"4815","display":"Glyburide"},{"code":"48203","display":"Clavulanate"},{"code":"4821","display":"Glipizide"},{"code":"48274","display":"Acetaminophen / Propoxyphene"},{"code":"484139","display":"Chlorhexidine / Isopropyl Alcohol"},{"code":"484211","display":"ezetimibe / Simvastatin"},{"code":"4850","display":"Glucose"},{"code":"4917","display":"Nitroglycerin"},{"code":"49276","display":"Doxazosin"},{"code":"50166","display":"Fosinopril"},{"code":"5021","display":"Griseofulvin"},{"code":"5032","display":"Guaifenesin"},{"code":"5093","display":"Haloperidol"},{"code":"51272","display":"quetiapine"},{"code":"519","display":"Allopurinol"},{"code":"52175","display":"Losartan"},{"code":"5224","display":"heparin"},{"code":"52582","display":"mesalamine"},{"code":"5470","display":"Hydralazine"},{"code":"5487","display":"Hydrochlorothiazide"},{"code":"5489","display":"Hydrocodone"},{"code":"5492","display":"Hydrocortisone"},{"code":"5499","display":"Hydrogen Peroxide"},{"code":"5521","display":"Hydroxychloroquine"},{"code":"5553","display":"Hydroxyzine"},{"code":"5640","display":"Ibuprofen"},{"code":"5691","display":"Imipramine"},{"code":"56946","display":"Paclitaxel"},{"code":"57258","display":"tizanidine"},{"code":"5764","display":"Indapamide"},{"code":"5781","display":"Indomethacin"},{"code":"588250","display":"milnacipran"},{"code":"59078","display":"metaxalone"},{"code":"591622","display":"varenicline"},{"code":"5933","display":"Iodine"},{"code":"593411","display":"sitagliptin"},{"code":"594040","display":"Atropine / Diphenoxylate"},{"code":"5956","display":"Iohexol"},{"code":"596","display":"Alprazolam"},{"code":"596723","display":"cerivastatin"},{"code":"597142","display":"brimonidine / Timolol"},{"code":"5992","display":"Iron-Dextran Complex"},{"code":"60207","display":"dorzolamide"},{"code":"6038","display":"isoniazid"},{"code":"60548","display":"exenatide"},{"code":"6057","display":"Isosorbide"},{"code":"6058","display":"Isosorbide Dinitrate"},{"code":"611854","display":"Chlordiazepoxide / clidinium"},{"code":"6130","display":"Ketamine"},{"code":"6135","display":"Ketoconazole"},{"code":"61381","display":"olanzapine"},{"code":"6142","display":"Ketoprofen"},{"code":"6185","display":"Labetalol"},{"code":"620","display":"Amantadine"},{"code":"6218","display":"Lactulose"},{"code":"6227","display":"Lanolin"},{"code":"6387","display":"Lidocaine"},{"code":"6398","display":"Lincomycin"},{"code":"6448","display":"Lithium"},{"code":"645555","display":"Bacitracin / Polymyxin B"},{"code":"6468","display":"Loperamide"},{"code":"6470","display":"Lorazepam"},{"code":"6472","display":"Lovastatin"},{"code":"6574","display":"Magnesium"},{"code":"6585","display":"Magnesium Sulfate"},{"code":"662263","display":"dorzolamide / Timolol"},{"code":"6676","display":"Meclizine"},{"code":"6691","display":"Medroxyprogesterone"},{"code":"67108","display":"Enoxaparin"},{"code":"6711","display":"Melatonin"},{"code":"6719","display":"Memantine"},{"code":"6750","display":"Menthol"},{"code":"6754","display":"Meperidine"},{"code":"6809","display":"Metformin"},{"code":"6813","display":"Methadone"},{"code":"6835","display":"Methimazole"},{"code":"6845","display":"Methocarbamol"},{"code":"6851","display":"Methotrexate"},{"code":"6876","display":"Methyldopa"},{"code":"689","display":"Aminophylline"},{"code":"689467","display":"Oxytetracycline / Polymyxin B"},{"code":"689518","display":"Aspirin / Caffeine / Propoxyphene"},{"code":"689556","display":"Acetaminophen / Aspirin / Phenylpropanolamine"},{"code":"689558","display":"Acetaminophen / Brompheniramine / Pseudoephedrine"},{"code":"689561","display":"Acetaminophen / butalbital / Caffeine / Codeine"},{"code":"689582","display":"Acetaminophen / Chlorpheniramine / Dextromethorphan / Pseudoephedrine"},{"code":"689606","display":"Atropine / Hyoscyamine / Phenobarbital / Scopolamine"},{"code":"689623","display":"Bacitracin / Hydrocortisone / Neomycin / Polymyxin B"},{"code":"690077","display":"Benzalkonium / Lidocaine"},{"code":"6901","display":"Methylphenidate"},{"code":"6902","display":"Methylprednisolone"},{"code":"690693","display":"Diphenhydramine / Phenylephrine"},{"code":"690808","display":"Brompheniramine / Dextromethorphan / Pseudoephedrine"},{"code":"69120","display":"tiotropium"},{"code":"6915","display":"Metoclopramide"},{"code":"6916","display":"Metolazone"},{"code":"6918","display":"Metoprolol"},{"code":"6922","display":"Metronidazole"},{"code":"692572","display":"Bacitracin / Neomycin / Polymyxin B"},{"code":"692794","display":"Gramicidin / Neomycin / Polymyxin B"},{"code":"6932","display":"Miconazole"},{"code":"6960","display":"Midazolam"},{"code":"69749","display":"valsartan"},{"code":"6980","display":"Minocycline"},{"code":"6984","display":"Minoxidil"},{"code":"703","display":"Amiodarone"},{"code":"704","display":"Amitriptyline"},{"code":"7052","display":"Morphine"},{"code":"705258","display":"Acetaminophen / Dextromethorphan / Doxylamine"},{"code":"7213","display":"Ipratropium"},{"code":"72143","display":"Raloxifene"},{"code":"72236","display":"fosphenytoin"},{"code":"723","display":"Amoxicillin"},{"code":"72302","display":"ropinirole"},{"code":"7233","display":"Nafcillin"},{"code":"7238","display":"Nalbuphine"},{"code":"7243","display":"Naltrexone"},{"code":"725","display":"Amphetamine"},{"code":"7258","display":"Naproxen"},{"code":"72625","display":"duloxetine"},{"code":"7299","display":"Neomycin"},{"code":"73056","display":"Risedronate"},{"code":"733","display":"Ampicillin"},{"code":"73494","display":"telmisartan"},{"code":"73645","display":"valacyclovir"},{"code":"7393","display":"Niacin"},{"code":"7407","display":"Nicotine"},{"code":"74169","display":"Piperacillin / tazobactam"},{"code":"7417","display":"Nifedipine"},{"code":"7454","display":"Nitrofurantoin"},{"code":"746741","display":"Pramipexole"},{"code":"7486","display":"Nitrous Oxide"},{"code":"7517","display":"Norfloxacin"},{"code":"7531","display":"Nortriptyline"},{"code":"7597","display":"Nystatin"},{"code":"7623","display":"Ofloxacin"},{"code":"7646","display":"Omeprazole"},{"code":"7676","display":"Opium"},{"code":"7715","display":"Orphenadrine"},{"code":"77492","display":"tamsulosin"},{"code":"7804","display":"Oxycodone"},{"code":"7821","display":"Oxytetracycline"},{"code":"787390","display":"tapentadol"},{"code":"7975","display":"Penicillamine"},{"code":"797541","display":"Isopropyl Alcohol"},{"code":"7980","display":"Penicillin G"},{"code":"7984","display":"Penicillin V"},{"code":"7994","display":"Pentamidine"},{"code":"8001","display":"Pentazocine"},{"code":"8120","display":"Phenazopyridine"},{"code":"8134","display":"Phenobarbital"},{"code":"815166","display":"Dextromethorphan / Doxylamine"},{"code":"8163","display":"Phenylephrine"},{"code":"816346","display":"dexlansoprazole"},{"code":"8175","display":"Phenylpropanolamine"},{"code":"817579","display":"Acetaminophen / Codeine"},{"code":"817958","display":"Aspirin / Calcium Carbonate"},{"code":"8183","display":"Phenytoin"},{"code":"82122","display":"Levofloxacin"},{"code":"822929","display":"Amphetamine aspartate / Amphetamine Sulfate / Dextroamphetamine saccharate / Dextroamphetamine Sulfate"},{"code":"83367","display":"atorvastatin"},{"code":"8356","display":"Piroxicam"},{"code":"83818","display":"irbesartan"},{"code":"84108","display":"rosiglitazone"},{"code":"8536","display":"Polymyxin B"},{"code":"857974","display":"saxagliptin"},{"code":"8588","display":"Potassium"},{"code":"8591","display":"Potassium Chloride"},{"code":"8610","display":"Povidone"},{"code":"8611","display":"Povidone-Iodine"},{"code":"861634","display":"pitavastatin"},{"code":"8629","display":"Prazosin"},{"code":"8638","display":"prednisolone"},{"code":"8640","display":"Prednisone"},{"code":"8687","display":"Primaquine"},{"code":"8691","display":"Primidone"},{"code":"8698","display":"Probenecid"},{"code":"8700","display":"Procainamide"},{"code":"8701","display":"Procaine"},{"code":"8703","display":"Fenofibrate"},{"code":"8704","display":"Prochlorperazine"},{"code":"8727","display":"Progesterone"},{"code":"8745","display":"Promethazine"},{"code":"8754","display":"Propafenone"},{"code":"87636","display":"fexofenadine"},{"code":"8782","display":"Propofol"},{"code":"8785","display":"Propoxyphene"},{"code":"8787","display":"Propranolol"},{"code":"8794","display":"Propylthiouracil"},{"code":"88014","display":"rizatriptan"},{"code":"88249","display":"montelukast"},{"code":"883815","display":"Dexamethasone / Tobramycin"},{"code":"8896","display":"Pseudoephedrine"},{"code":"89013","display":"aripiprazole"},{"code":"8928","display":"Psyllium"},{"code":"8948","display":"Purified Protein Derivative of Tuberculin"},{"code":"90176","display":"Iron"},{"code":"9068","display":"Quinidine"},{"code":"9071","display":"Quinine"},{"code":"91263","display":"Aloe Extract"},{"code":"9143","display":"Ranitidine"},{"code":"9384","display":"Rifampin"},{"code":"9524","display":"Sulfasalazine"},{"code":"9601","display":"Scopolamine"},{"code":"9778","display":"Silicones"},{"code":"9793","display":"silver sulfadiazine"},{"code":"9947","display":"Sotalol"},{"code":"9997","display":"Spironolactone"}]},{"system":"http://snomed.info/sct","concept":[{"code":"102259006","display":"Citrus fruit (substance)"},{"code":"102261002","display":"Strawberry (substance)"},{"code":"102262009","display":"Chocolate (substance)"},{"code":"102263004","display":"Eggs (edible) (substance)"},{"code":"102264005","display":"Cheese (substance)"},{"code":"111088007","display":"Latex (substance)"},{"code":"111151007","display":"Anabolic steroid (substance)"},{"code":"11526002","display":"Aspartame (substance)"},{"code":"116274004","display":"Artificial sweetener (substance)"},{"code":"116566001","display":"Steroid (substance)"},{"code":"13577000","display":"Nut (substance)"},{"code":"14443002","display":"Substance with aminoglycoside structure and antibacterial mechanism of action (substance)"},{"code":"226723006","display":"Buckwheat - cereal (substance)"},{"code":"226734009","display":"Wheatgerm (substance)"},{"code":"226760005","display":"Dairy foods (substance)"},{"code":"226915003","display":"Red meat (substance)"},{"code":"226916002","display":"Beef (substance)"},{"code":"226934003","display":"Pork (substance)"},{"code":"226955001","display":"Chicken - meat (substance)"},{"code":"226967004","display":"Turkey - meat (substance)"},{"code":"227144008","display":"Tuna fish (substance)"},{"code":"227151004","display":"Prawns (substance)"},{"code":"227208008","display":"Abalone canned in brine (substance)"},{"code":"227219006","display":"Aubergine (substance)"},{"code":"227313005","display":"Pulse vegetables (substance)"},{"code":"227388008","display":"Cinnamon (substance)"},{"code":"227400003","display":"Ginger (substance)"},{"code":"227421003","display":"Cranberries (substance)"},{"code":"227444000","display":"Raspberries (substance)"},{"code":"227493005","display":"Cashew nut (substance)"},{"code":"227512001","display":"Pistachio nut (substance)"},{"code":"227598003","display":"Honey (substance)"},{"code":"228102000","display":"Sodium nitrate (substance)"},{"code":"255632006","display":"Anticonvulsant (substance)"},{"code":"255637000","display":"Salicylate (substance)"},{"code":"255641001","display":"Caffeine (substance)"},{"code":"256259004","display":"Pollen (substance)"},{"code":"256277009","display":"Grass pollen (substance)"},{"code":"256306003","display":"Orange - fruit (substance)"},{"code":"256307007","display":"Banana (substance)"},{"code":"256313003","display":"Pineapple (substance)"},{"code":"256315005","display":"Grapefruit (substance)"},{"code":"256317002","display":"Grapes (substance)"},{"code":"256319004","display":"Carrot (substance)"},{"code":"256326004","display":"Celery (substance)"},{"code":"256329006","display":"Spinach (substance)"},{"code":"256350002","display":"Almond (substance)"},{"code":"256351003","display":"Brazil nut (substance)"},{"code":"256352005","display":"Walnut - nut (substance)"},{"code":"256353000","display":"Hazelnut (substance)"},{"code":"256354006","display":"Bean (substance)"},{"code":"256417003","display":"Horse dander (substance)"},{"code":"256440004","display":"Wasp venom (substance)"},{"code":"259858000","display":"Varicella-zoster virus antibody (substance)"},{"code":"260152009","display":"Cat dander (substance)"},{"code":"260154005","display":"Dog dander (substance)"},{"code":"260167008","display":"Sesame seed (substance)"},{"code":"260176001","display":"Kiwi fruit (substance)"},{"code":"260177005","display":"Melon (substance)"},{"code":"260179008","display":"Mango fruit (substance)"},{"code":"260184002","display":"Peas (substance)"},{"code":"260189007","display":"Pecan nut (substance)"},{"code":"260205009","display":"Sunflower seed (substance)"},{"code":"264287008","display":"Animal dander (substance)"},{"code":"264337003","display":"Seed (substance)"},{"code":"28230009","display":"Poultry (substance)"},{"code":"288328004","display":"Bee venom (substance)"},{"code":"28942008","display":"Coconut oil (substance)"},{"code":"29263009","display":"Coffee (substance)"},{"code":"304275008","display":"Corticosteroid and corticosteroid derivative (substance)"},{"code":"33008008","display":"Dust (substance)"},{"code":"350327004","display":"Diphtheria + tetanus vaccine (product)"},{"code":"35748005","display":"Wine (substance)"},{"code":"360201004","display":"Nitrofuran derivative (substance)"},{"code":"3692009","display":"Sodium sulfite (substance)"},{"code":"372480009","display":"Substance with macrolide structure and antibacterial mechanism of action (substance)"},{"code":"372664007","display":"Benzodiazepine (substance)"},{"code":"372665008","display":"Non-steroidal anti-inflammatory agent (substance)"},{"code":"372711004","display":"Sulfonylurea (substance)"},{"code":"372722000","display":"Substance with quinolone structure and antibacterial mechanism of action (substance)"},{"code":"372733002","display":"Substance with angiotensin-converting enzyme inhibitor mechanism of action (substance)"},{"code":"372747003","display":"Thiazide diuretic (substance)"},{"code":"372783007","display":"Antiparkinsonian agent (substance)"},{"code":"372798009","display":"Barbiturate (substance)"},{"code":"372806008","display":"Substance with histamine receptor antagonist mechanism of action (substance)"},{"code":"372889003","display":"First generation cephalosporin (substance)"},{"code":"372912004","display":"Substance with 3-hydroxy-3-methylglutaryl-coenzyme A reductase inhibitor mechanism of action (substance)"},{"code":"372913009","display":"Substance with angiotensin II receptor antagonist mechanism of action (substance)"},{"code":"373206009","display":"Substance with tetracycline structure and antibacterial mechanism of action (substance)"},{"code":"373253007","display":"Tricyclic antidepressant (substance)"},{"code":"373254001","display":"Substance with beta adrenergic receptor antagonist mechanism of action (substance)"},{"code":"373262009","display":"Substance with cephalosporin structure and antibacterial mechanism of action (substance)"},{"code":"373270004","display":"Substance with penicillin structure and antibacterial mechanism of action (substance)"},{"code":"373297006","display":"Substance with beta-lactam structure and antibacterial mechanism of action (substance)"},{"code":"373304005","display":"Substance with calcium channel blocker mechanism of action (substance)"},{"code":"373531009","display":"Gelatin (substance)"},{"code":"385420005","display":"Contrast media (substance)"},{"code":"386127005","display":"Formula milk (substance)"},{"code":"386962001","display":"Plasma protein fraction (substance)"},{"code":"387050005","display":"Substance with prostaglandin-endoperoxide synthase isoform 2 inhibitor mechanism of action (substance)"},{"code":"387406002","display":"Sulfonamide (substance)"},{"code":"391737006","display":"Almond oil (substance)"},{"code":"391739009","display":"Aloe (substance)"},{"code":"396345004","display":"Carbapenem (substance)"},{"code":"396420001","display":"Anthrax vaccine (substance)"},{"code":"396425006","display":"Influenza virus vaccine (substance)"},{"code":"396433007","display":"Pertussis vaccine (substance)"},{"code":"396439006","display":"Smallpox vaccine (substance)"},{"code":"396441007","display":"Typhoid vaccine (substance)"},{"code":"396442000","display":"Varicella virus vaccine (substance)"},{"code":"398730001","display":"Pneumococcal vaccine (substance)"},{"code":"400872007","display":"Hydrocolloid (substance)"},{"code":"404642006","display":"Substance with opioid receptor agonist mechanism of action (substance)"},{"code":"406748003","display":"Carbamate (substance)"},{"code":"409137002","display":"No known drug allergy (situation)"},{"code":"412061001","display":"Blueberries (substance)"},{"code":"412062008","display":"Cantaloupe (substance)"},{"code":"412066006","display":"Pepper (substance)"},{"code":"412068007","display":"Rye (substance)"},{"code":"412071004","display":"Wheat (substance)"},{"code":"412138001","display":"Horse serum protein (substance)"},{"code":"412357001","display":"Corn (substance)"},{"code":"412373007","display":"Diphtheria + pertussis + tetanus + Haemophilus influenzae type b vaccine (product)"},{"code":"412375000","display":"Tetanus vaccine (substance)"},{"code":"412533000","display":"Wheat bran (substance)"},{"code":"412534006","display":"Yeast (substance)"},{"code":"412583005","display":"Bee pollen (substance)"},{"code":"41598000","display":"Estrogen (substance)"},{"code":"417889008","display":"Arachis oil (substance)"},{"code":"418000008","display":"Methadone analog (substance)"},{"code":"418504009","display":"Oats (substance)"},{"code":"418920007","display":"Adhesive agent (substance)"},{"code":"419420009","display":"Watermelon (substance)"},{"code":"419933005","display":"Glucocorticoid (substance)"},{"code":"421245007","display":"Diphtheria + pertussis + tetanus vaccine (product)"},{"code":"424369009","display":"Product containing beta-galactosidase (medicinal product)"},{"code":"426722004","display":"Iodinated contrast media (substance)"},{"code":"428607008","display":"No known environmental allergy (situation)"},{"code":"429625007","display":"No known food allergy (situation)"},{"code":"43735007","display":"Sulfur (substance)"},{"code":"43921001","display":"Nickel compound (substance)"},{"code":"44027008","display":"Seafood (substance)"},{"code":"442381000124103","display":"Blue food coloring (substance)"},{"code":"442571000124108","display":"Tree nut (substance)"},{"code":"442771000124102","display":"Pepperoni (substance)"},{"code":"44588005","display":"Iodine (substance)"},{"code":"446273004","display":"Red food coloring (substance)"},{"code":"446274005","display":"Yellow food coloring (substance)"},{"code":"47703008","display":"Lactose (substance)"},{"code":"51386004","display":"Food preservative (substance)"},{"code":"51905005","display":"Mustard (substance)"},{"code":"53041004","display":"Alcohol (substance)"},{"code":"61789006","display":"Dye (substance)"},{"code":"63045006","display":"Berry (substance)"},{"code":"67324005","display":"Rice (substance)"},{"code":"67866001","display":"Insulin (substance)"},{"code":"70813002","display":"Milk (substance)"},{"code":"710179004","display":"Lupine seed (substance)"},{"code":"716184000","display":"No known latex allergy (situation)"},{"code":"716186003","display":"No known allergy (situation)"},{"code":"720687003","display":"Dust mite protein (substance)"},{"code":"72511004","display":"Fruit (substance)"},{"code":"726730005","display":"Yam (substance)"},{"code":"734881000","display":"Tomato (substance)"},{"code":"735006003","display":"Squid (substance)"},{"code":"735009005","display":"Salmon (substance)"},{"code":"735029006","display":"Shellfish (substance)"},{"code":"735030001","display":"Garlic (substance)"},{"code":"735043001","display":"Mackerel (substance)"},{"code":"735045008","display":"Mushroom (substance)"},{"code":"735047000","display":"Onion (substance)"},{"code":"735049002","display":"Peach (substance)"},{"code":"735050002","display":"Pear (substance)"},{"code":"735051003","display":"Plum (substance)"},{"code":"735053000","display":"Potato (substance)"},{"code":"735123009","display":"Broccoli (substance)"},{"code":"735124003","display":"Barley (substance)"},{"code":"735211005","display":"Coconut (substance)"},{"code":"735212003","display":"Papaya (substance)"},{"code":"735213008","display":"Cucumber (substance)"},{"code":"735214002","display":"Apricot (substance)"},{"code":"735215001","display":"Apple (substance)"},{"code":"735248001","display":"Cherry (substance)"},{"code":"735249009","display":"Avocado (substance)"},{"code":"735340006","display":"Lemon (substance)"},{"code":"735959004","display":"Marine mollusk (substance)"},{"code":"735971005","display":"Fish (substance)"},{"code":"735977009","display":"Marine crustacean (substance)"},{"code":"736027000","display":"Scallop (substance)"},{"code":"736030007","display":"Clam (substance)"},{"code":"736031006","display":"Oyster (substance)"},{"code":"736159005","display":"Crab (substance)"},{"code":"736162008","display":"Lobster (substance)"},{"code":"74801000","display":"Sugar (substance)"},{"code":"75665004","display":"Monosodium glutamate (substance)"},{"code":"762952008","display":"Peanut (substance)"},{"code":"7791007","display":"Soy protein (substance)"},{"code":"80259003","display":"Food flavoring agent (substance)"},{"code":"84489001","display":"Mold (organism)"},{"code":"89119000","display":"Nitrate salt (substance)"},{"code":"89707004","display":"Sesame oil (substance)"},{"code":"89811004","display":"Gluten (substance)"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-careteam-provider-roles.json b/resources/uscore_v3.1.0/ValueSet-us-core-careteam-provider-roles.json new file mode 100755 index 000000000..19f55ab81 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-careteam-provider-roles.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-careteam-provider-roles","text":{"status":"generated","div":"

    US Core CareTeam Provider Roles

    Provider roles codes consist of NUCC Health Care Provider Taxonomy Code Set for providers and SNOMED-CT for - non clinical and organization roles including codes from the SCTID 223366009 Healthcare professional (occupation) heirarchy and the SCTID 224930009 Services (qualifier value) heirarchy.

    \n

    Copyright Statement: This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement. This value set includes content from NUCC Health Care Provider Taxonomy Code Set for providers which is copyright © 2016+ American Medical Association. For commercial use, including sales or licensing, a license must be obtained.

    This value set includes codes from the following code systems:

    • Include all codes defined in http://nucc.org/provider-taxonomy
    • Include codes from http://snomed.info/sct where concept is-a 223366009 (Healthcare professional)
    • Include codes from http://snomed.info/sct where concept is-a 224930009 (Services)
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-careteam-provider-roles","version":"3.1.0","name":"USCoreCareTeamProviderRoles","title":"US Core CareTeam Provider Roles","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"Provider roles codes consist of NUCC Health Care Provider Taxonomy Code Set for providers and SNOMED-CT for - non clinical and organization roles including codes from the SCTID 223366009 Healthcare professional (occupation) heirarchy and the SCTID 224930009 Services (qualifier value) heirarchy.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"purpose":"Codes that may be used for implementation of the Argonaut Procedures IG and MU2015 certification.","copyright":"This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement. This value set includes content from NUCC Health Care Provider Taxonomy Code Set for providers which is copyright © 2016+ American Medical Association. For commercial use, including sales or licensing, a license must be obtained.","compose":{"include":[{"system":"http://nucc.org/provider-taxonomy"},{"system":"http://snomed.info/sct","filter":[{"property":"concept","op":"is-a","value":"223366009"}]},{"system":"http://snomed.info/sct","filter":[{"property":"concept","op":"is-a","value":"224930009"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-clinical-note-type.json b/resources/uscore_v3.1.0/ValueSet-us-core-clinical-note-type.json new file mode 100755 index 000000000..7141eeeee --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-clinical-note-type.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-clinical-note-type","text":{"status":"generated","div":"

    US Core Clinical Note Type

    The US Core Clinical Note Type Value Set is a 'starter set' of types supported for fetching and storing clinical notes.

    \n

    Copyright Statement: This content LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-clinical-note-type","version":"3.1.0","name":"USCoreClinicalNoteType","title":"US Core Clinical Note Type","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"The US Core Clinical Note Type Value Set is a 'starter set' of types supported for fetching and storing clinical notes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":" This content LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use","compose":{"include":[{"system":"http://loinc.org","concept":[{"code":"18842-5"},{"code":"11488-4"},{"code":"34117-2"},{"code":"11506-3"},{"code":"28570-0"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-condition-category.json b/resources/uscore_v3.1.0/ValueSet-us-core-condition-category.json new file mode 100755 index 000000000..e7da9e93d --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-condition-category.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-condition-category","text":{"status":"generated","div":"

    US Core Condition Category Codes

    The US Core Condition Category Codes support the separate concepts of problems and health concerns in Condition.category in order for API consumers to be able to separate health concerns and problems. However this is not mandatory for 2015 certification

    \n

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-condition-category","version":"3.1.0","name":"USCoreConditionCategoryCodes","title":"US Core Condition Category Codes","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","description":"The US Core Condition Category Codes support the separate concepts of problems and health concerns in Condition.category in order for API consumers to be able to separate health concerns and problems. However this is not mandatory for 2015 certification","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"purpose":"So API consumers can separate health concerns and problems.","compose":{"include":[{"system":"http://terminology.hl7.org/CodeSystem/condition-category"},{"system":"http://hl7.org/fhir/us/core/CodeSystem/condition-category","concept":[{"code":"health-concern","display":"Health Concern"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-condition-code.json b/resources/uscore_v3.1.0/ValueSet-us-core-condition-code.json new file mode 100755 index 000000000..868d60e71 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-condition-code.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-condition-code","text":{"status":"generated","div":"

    US Core Condition Code

    This describes the problem. Diagnosis/Problem List is broadly defined as a series of brief statements that catalog a patient's medical, nursing, dental, social, preventative and psychiatric events and issues that are relevant to that patient's healthcare (e.g., signs, symptoms, and defined conditions). ICD-10 is appropriate for Diagnosis information, and ICD-9 for historical information.

    \n

    Copyright Statement: This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement. ICD-9 and ICD-10 are copyrighted by the World Health Organization (WHO) which owns and publishes the classification. See https://www.who.int/classifications/icd/en. WHO has authorized the development of an adaptation of ICD-9 and ICD-10 to ICD-9-CM to ICD-10-CM for use in the United States for U.S. government purposes.

    This value set includes codes from the following code systems:

    • Include these codes as defined in http://snomed.info/sct
      CodeDisplay
      160245001No current problems or disability
    • Include codes from http://snomed.info/sct where concept is-a 404684003 (Clinical finding (finding))
    • Include codes from http://snomed.info/sct where concept is-a 243796009 (Context-dependent category)
    • Include all codes defined in http://hl7.org/fhir/sid/icd-10-cm
    • Include all codes defined in http://hl7.org/fhir/sid/icd-9-cm
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-condition-code","version":"3.1.0","name":"USCoreConditionCode","title":"US Core Condition Code","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"This describes the problem. Diagnosis/Problem List is broadly defined as a series of brief statements that catalog a patient's medical, nursing, dental, social, preventative and psychiatric events and issues that are relevant to that patient's healthcare (e.g., signs, symptoms, and defined conditions). ICD-10 is appropriate for Diagnosis information, and ICD-9 for historical information.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement. ICD-9 and ICD-10 are copyrighted by the World Health Organization (WHO) which owns and publishes the classification. See https://www.who.int/classifications/icd/en. WHO has authorized the development of an adaptation of ICD-9 and ICD-10 to ICD-9-CM to ICD-10-CM for use in the United States for U.S. government purposes. ","compose":{"include":[{"system":"http://snomed.info/sct","concept":[{"code":"160245001"}]},{"system":"http://snomed.info/sct","filter":[{"property":"concept","op":"is-a","value":"404684003"}]},{"system":"http://snomed.info/sct","filter":[{"property":"concept","op":"is-a","value":"243796009"}]},{"system":"http://hl7.org/fhir/sid/icd-10-cm"},{"system":"http://hl7.org/fhir/sid/icd-9-cm"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-category.json b/resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-category.json new file mode 100755 index 000000000..6c345a46b --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-category.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-diagnosticreport-category","text":{"status":"generated","div":"

    US Core DiagnosticReport Category

    The US Core Diagnostic Report Category Value Set is a 'starter set' of categories supported for fetching and Diagnostic Reports and notes.

    \n

    Copyright Statement: This content LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-category","version":"3.1.0","name":"USCoreDiagnosticReportCategory","title":"US Core DiagnosticReport Category","status":"active","date":"2019-05-21T00:00:00+10:00","description":"The US Core Diagnostic Report Category Value Set is a 'starter set' of categories supported for fetching and Diagnostic Reports and notes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":" This content LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use","compose":{"include":[{"system":"http://loinc.org","concept":[{"code":"LP29684-5","display":"Radiology"},{"code":"LP29708-2","display":"Cardiology"},{"code":"LP7839-6","display":"Pathology"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-lab-codes.json b/resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-lab-codes.json new file mode 100755 index 000000000..c86605c41 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-lab-codes.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-diagnosticreport-lab-codes","text":{"status":"generated","div":"

    US Core Diagnostic Report Laboratory Codes

    The Document Type value set includes all LOINC values whose CLASSTYPE is LABORATORY in the LOINC database

    \n

    Copyright Statement: This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use.

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-lab-codes","version":"3.1.0","name":"USCoreDiagnosticReportLabCodes","title":"US Core Diagnostic Report Laboratory Codes","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"The Document Type value set includes all LOINC values whose CLASSTYPE is LABORATORY in the LOINC database","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use.","compose":{"include":[{"system":"http://loinc.org","filter":[{"property":"CLASSTYPE","op":"=","value":"1"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-report-and-note-codes.json b/resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-report-and-note-codes.json new file mode 100755 index 000000000..ce412c4fb --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-diagnosticreport-report-and-note-codes.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-diagnosticreport-report-and-note-codes","text":{"status":"generated","div":"

    US Core Diagnosticreport Report And Note Codes

    This value set currently contains all of LOINC. The codes selected should represent discrete and narrative diagnostic observations and reports

    \n

    Copyright Statement: This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use.

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-diagnosticreport-report-and-note-codes","version":"3.1.0","name":"USCoreDiagnosticreportReportAndNoteCodes","title":"US Core Diagnosticreport Report And Note Codes","status":"active","experimental":false,"date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"This value set currently contains all of LOINC. The codes selected should represent discrete and narrative diagnostic observations and reports","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use.","compose":{"include":[{"system":"http://loinc.org"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-documentreference-category.json b/resources/uscore_v3.1.0/ValueSet-us-core-documentreference-category.json new file mode 100755 index 000000000..cc505b77d --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-documentreference-category.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-documentreference-category","text":{"status":"generated","div":"

    US Core DocumentReference Category

    The US Core DocumentReferences Category Value Set is a 'starter set' of categories supported for fetching and storing clinical notes.

    \n

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-category","version":"3.1.0","name":"USCoreDocumentReferenceCategory","title":"US Core DocumentReference Category","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"The US Core DocumentReferences Category Value Set is a 'starter set' of categories supported for fetching and storing clinical notes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"http://hl7.org/fhir/us/core/CodeSystem/us-core-documentreference-category"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-documentreference-type.json b/resources/uscore_v3.1.0/ValueSet-us-core-documentreference-type.json new file mode 100755 index 000000000..60887af70 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-documentreference-type.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-documentreference-type","text":{"status":"generated","div":"

    US Core DocumentReference Type

    The US Core DocumentReference Type Value Set includes all LOINC values whose SCALE is DOC in the LOINC database and the HL7 v3 Code System NullFlavor concept 'unknown'

    \n

    Copyright Statement: This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use.

    This value set includes codes from the following code systems:

    • Include these codes as defined in http://terminology.hl7.org/CodeSystem/v3-NullFlavor
      CodeDisplay
      UNKunknownDescription:A proper value is applicable, but not known.
      \n \n Usage Notes: This means the actual value is not known. If the only thing that is unknown is how to properly express the value in the necessary constraints (value set, datatype, etc.), then the OTH or UNC flavor should be used. No properties should be included for a datatype with this property unless:
      \n \n Those properties themselves directly translate to a semantic of "unknown". (E.g. a local code sent as a translation that conveys 'unknown')\n Those properties further qualify the nature of what is unknown. (E.g. specifying a use code of "H" and a URL prefix of "tel:" to convey that it is the home phone number that is unknown.)
    • Include codes from http://loinc.org where SCALE_TYP = DOC
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-documentreference-type","version":"3.1.0","name":"USCoreDocumentReferenceType","title":"US Core DocumentReference Type","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"The US Core DocumentReference Type Value Set includes all LOINC values whose SCALE is DOC in the LOINC database and the HL7 v3 Code System NullFlavor concept 'unknown'","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use.","compose":{"include":[{"system":"http://terminology.hl7.org/CodeSystem/v3-NullFlavor","concept":[{"code":"UNK","display":"unknown"}]},{"system":"http://loinc.org","filter":[{"property":"SCALE_TYP","op":"=","value":"DOC"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-encounter-type.json b/resources/uscore_v3.1.0/ValueSet-us-core-encounter-type.json new file mode 100755 index 000000000..7b4cc9d1f --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-encounter-type.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-encounter-type","text":{"status":"generated","div":"

    US Core Encounter Type

    The type of encounter: a specific code indicating type of service provided. This value set includes codes from SNOMED CT decending from the concept 308335008 (Patient encounter procedure (procedure)) and from the Current Procedure and Terminology(CPT) designated for Evaluation and Management (99200 – 99607) (subscription to AMA Required)

    \n

    Copyright Statement: This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement. This value set includes content from CPT copyright 2014 American Medical Association. All rights reserved.

    This value set includes codes from the following code systems:

    • Include codes from http://snomed.info/sct where concept is-a 308335008 (Patient encounter procedure)
    • Include all codes defined in http://www.ama-assn.org/go/cpt
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-encounter-type","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113883.3.88.12.80.32"}],"version":"3.1.0","name":"USCoreEncounterType","title":"US Core Encounter Type","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"The type of encounter: a specific code indicating type of service provided. This value set includes codes from SNOMED CT decending from the concept 308335008 (Patient encounter procedure (procedure)) and from the Current Procedure and Terminology(CPT) designated for Evaluation and Management (99200 – 99607) (subscription to AMA Required)","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement. This value set includes content from CPT copyright 2014 American Medical Association. All rights reserved.","compose":{"include":[{"system":"http://snomed.info/sct","filter":[{"property":"concept","op":"is-a","value":"308335008"}]},{"system":"http://www.ama-assn.org/go/cpt"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-medication-codes.json b/resources/uscore_v3.1.0/ValueSet-us-core-medication-codes.json new file mode 100755 index 000000000..28ead7db9 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-medication-codes.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-medication-codes","text":{"status":"generated","div":"
    \n\t\t\t

    Medication Clinical Drug (RxNorm)

    \n\t\t\t

    All prescribable medication formulations represented using either a 'generic' or 'brand-specific' concept. This includes RxNorm codes whose Term Type is SCD (semantic clinical drug), SBD (semantic brand drug), GPCK (generic pack), BPCK (brand pack), SCDG (semantic clinical drug group), SBDG (semantic brand drug group), SCDF (semantic clinical drug form), or SBDF (semantic brand drug form)

    \n\t\t\t

    This value set includes codes from the following code systems:

    \n\t\t\t
      \n\t\t\t\t
    • Include codes from http://www.nlm.nih.gov/research/umls/rxnorm where TTY in SCD,SBD,GPCK,BPCK,SCDG,SBDG,SCDF,SBDF
    • \n\t\t\t
    \n\t\t
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-medication-codes","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113762.1.4.1010.4"}],"version":"3.1.0","name":"USCoreMedicationCodes","title":"US Core Medication Codes (RxNorm)","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"All prescribable medication formulations represented using either a 'generic' or 'brand-specific' concept. This includes RxNorm codes whose Term Type is SCD (semantic clinical drug), SBD (semantic brand drug), GPCK (generic pack), BPCK (brand pack), SCDG (semantic clinical drug group), SBDG (semantic brand drug group), SCDF (semantic clinical drug form), or SBDF (semantic brand drug form)","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"http://www.nlm.nih.gov/research/umls/rxnorm","filter":[{"property":"TTY","op":"in","value":"SCD,SBD,GPCK,BPCK,SCDG,SBDG,SCDF,SBDF"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-narrative-status.json b/resources/uscore_v3.1.0/ValueSet-us-core-narrative-status.json new file mode 100755 index 000000000..9c8429349 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-narrative-status.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-narrative-status","text":{"status":"generated","div":"

    US Core Narrative Status

    The US Core Narrative Status Value Set limits the text status for the resource narrative.

    \n

    Copyright Statement: HL7

    This value set includes codes from the following code systems:

    • Include these codes as defined in http://hl7.org/fhir/narrative-status
      CodeDisplay
      additionaladditionalThe contents of the narrative may contain additional information not found in the structured data. Note that there is no computable way to determine what the extra information is, other than by human inspection.
      generatedgeneratedThe contents of the narrative are entirely generated from the core elements in the content.
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-narrative-status","version":"3.1.0","name":"NarrativeStatus","title":"US Core Narrative Status","status":"active","date":"2019-11-06T13:08:22+11:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"The US Core Narrative Status Value Set limits the text status for the resource narrative.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"HL7","compose":{"include":[{"system":"http://hl7.org/fhir/narrative-status","concept":[{"code":"additional","display":"additional"},{"code":"generated","display":"generated"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-ndc-vaccine-codes.json b/resources/uscore_v3.1.0/ValueSet-us-core-ndc-vaccine-codes.json new file mode 100755 index 000000000..991ba22e3 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-ndc-vaccine-codes.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-ndc-vaccine-codes","text":{"status":"generated","div":"

    US Core Vaccine National Drug Codes (NDC)

    This value set includes all the Vaccine National Drug Codes (NDC). This source of this data is provided by the CDC

    \n

    This value set includes codes from the following code systems:

    • Include these codes as defined in http://hl7.org/fhir/sid/ndc
      CodeDisplay
      49281-0703-55FLUZONE INTRADERMAL
      49281-0790-20Typhim Vi
      33332-0316-01AFLURIA QUADRIVALENT
      49281-0712-40FLUZONE INTRADERMAL QUADRIVALENT
      66521-0112-02Fluvirin
      58160-0816-05Hiberix
      00006-4837-02PNEUMOVAX 23
      58160-0808-15Influenza A (H5N1) Monovalent Vaccine, Adjuvanted
      58160-0842-51BOOSTRIX
      49281-0418-50FLUZONE QUADRIVALENT
      00006-4943-00PNEUMOVAX 23
      49281-0708-40FLUZONE INTRADERMAL QUADRIVALENT
      54868-0734-00ENGERIX-B
      58160-0819-12Shingrix
      49281-0517-25FLUZONE QUADRIVALENT
      00006-4133-41Tetanus and Diphtheria Toxoids Adsorbed
      50090-3096-00RabAvert
      33332-0118-10AFLURIA
      19515-0909-52Flulaval Quadrivalent
      49281-0650-10INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE
      58160-0820-11ENGERIX-B
      42515-0001-01IXIARO
      49281-0625-15FLUZONE QUADRIVALENT
      49281-0516-25FLUZONE QUADRIVALENT
      66521-0114-02FLUVIRIN
      19515-0896-11Flulaval Quadrivalent
      33332-0117-10AFLURIA
      33332-0416-10AFLURIA QUADRIVALENT
      66521-0118-02Fluvirin
      58160-0821-11ENGERIX-B
      00005-1971-05PREVNAR 13
      66019-0109-10FLUMIST
      49281-0278-10DIPHTHERIA AND TETANUS TOXOIDS ADSORBED
      49281-0011-10FLUZONE
      54868-2219-00RECOMBIVAX HB
      49281-0415-10FLUZONE QUADRIVALENT
      33332-0016-01AFLURIA
      49281-0705-55FLUZONE
      49281-0621-15FLUZONE QUADRIVALENT
      58160-0842-34BOOSTRIX
      49281-0010-10FLUZONE
      66521-0113-02FLUVIRIN
      49281-0514-25FLUZONE QUADRIVALENT
      58160-0842-52BOOSTRIX
      19515-0901-52Flulaval Quadrivalent
      62577-0613-01Flucelvax
      66019-0303-10FluMist Quadrivalent
      49281-0388-15FLUZONE
      00006-4841-41VAQTA
      58160-0900-52FLUARIX QUADRIVALENT
      70461-0200-01FLUCELVAX QUADRIVALENT
      49281-0915-05YF-VAX
      49281-0650-50INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE
      33332-0116-10AFLURIA
      54868-3339-01PNEUMOVAX 23
      49281-0418-10FLUZONE QUADRIVALENT
      58160-0812-52KINRIX
      49281-0286-05DAPTACEL
      63851-0612-01Flucelvax
      19515-0908-52Flulaval Quadrivalent
      54868-0980-00M-M-R II
      58160-0830-52CERVARIX
      49281-0113-25FLUZONE
      49281-0650-70INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE
      66521-0115-10FLUVIRIN
      49281-0417-50FLUZONE QUADRIVALENT
      33332-0113-10AFLURIA
      49281-0629-15FLUZONE QUADRIVALENT
      58160-0823-11Shingrix
      00006-4897-00PedvaxHIB
      58160-0821-34ENGERIX-B
      66521-0115-02FLUVIRIN
      33332-0014-01AFLURIA
      49281-0562-10QUADRACEL
      42874-0014-10Flublok
      42874-0013-10Flublok
      33332-0115-10AFLURIA
      00006-4963-00ZOSTAVAX
      49281-0010-25FLUZONE
      33332-0519-01Influenza A
      58160-0898-52FLUARIX QUADRIVALENT
      49281-0112-25FLUZONE
      19515-0898-11Flulaval Quadrivalent
      00006-4109-09GARDASIL
      49281-0414-50FLUZONE QUADRIVALENT
      00006-4095-09VAQTA
      00006-4045-00GARDASIL
      19515-0912-52Flulaval Quadrivalent
      58160-0801-11Menhibrix
      49281-0489-01MENOMUNE - A/C/Y/W-135 COMBINED
      42874-0017-10Flublok
      66521-0116-02Fluvirin
      46028-0208-01Menveo
      49281-0627-15FLUZONE QUADRIVALENT
      00005-0100-02Trumenba
      69401-0000-01Vivotif
      21695-0413-01Tetanus and Diphtheria Toxoids Adsorbed
      49281-0416-10FLUZONE QUADRIVALENT
      49281-0650-25INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE
      49281-0800-83TETANUS TOXOID ADSORBED
      49281-0291-83DECAVAC
      00006-4095-02VAQTA
      58160-0854-52ROTARIX
      19515-0889-07FLULAVAL
      49281-0392-15FLUZONE
      19515-0891-11Flulaval Quadrivalent
      49281-0400-05Adacel
      49281-0913-01STAMARIL
      49281-0640-15INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE
      49281-0513-25FLUZONE QUADRIVALENT
      00006-4171-00ProQuad
      00006-4096-09VAQTA
      58160-0830-34CERVARIX
      00006-4980-00RECOMBIVAX HB
      17478-0131-01Tetanus and Diphtheria Toxoids Adsorbed
      49281-0414-10FLUZONE QUADRIVALENT
      43528-0002-05HEPLISAV-B
      66521-0200-02Influenza A (H1N1) 2009 Monovalent Vaccine
      49281-0011-50FLUZONE
      70461-0120-10Fluvirin
      66019-0304-10FluMist Quadrivalent
      58160-0976-20Bexsero
      00006-4826-00VARIVAX
      66521-0116-10Fluvirin
      00006-4963-41ZOSTAVAX
      49281-0510-05PENTACEL
      42874-0012-10Flublok
      58160-0955-09Menveo
      00005-0100-05Trumenba
      49281-0707-55FLUZONE
      14362-0111-04Tetanus and Diphtheria Toxoids Adsorbed
      66521-0112-10Fluvirin
      66521-0117-10Fluvirin
      00006-4045-41GARDASIL
      49281-0389-65FLUZONE HIGH DOSE
      69401-0000-02Vivotif
      49281-0915-01YF-VAX
      00006-4093-02RECOMBIVAX HB
      58160-0815-48TWINRIX
      70460-0001-01Vaxchora
      58160-0826-11HAVRIX
      00006-4992-00RECOMBIVAX HB
      49281-0111-25FLUZONE
      00006-4093-09RECOMBIVAX HB
      50090-3469-00HEPLISAV-B
      49281-0403-65FLUZONE High-Dose
      70461-0119-10Fluvirin
      00006-4995-00RECOMBIVAX HB
      58160-0815-34TWINRIX
      49281-0393-65FLUZONE High-Dose
      00005-1970-50Prevnar
      33332-0017-01AFLURIA
      63851-0501-01RabAvert
      58160-0881-52FLUARIX
      64678-0211-01BioThrax
      49281-0394-15FLUZONE
      00006-4827-00VARIVAX
      58160-0806-05HIBERIX
      49281-0518-25FLUZONE QUADRIVALENT
      62195-0051-10Ixiaro
      63361-0245-10VAXELIS
      49281-0709-55FLUZONE Intradermal
      66019-0300-10FluMist Quadrivalent
      49281-0215-15TENIVAC
      58160-0825-52HAVRIX
      00005-0100-10Trumenba
      66521-0117-02Fluvirin
      49281-0650-90INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE
      42874-0015-10Flublok
      33332-0018-01AFLURIA
      00006-4999-00ProQuad
      00005-1971-04PREVNAR 13
      19515-0850-52FLULAVAL
      00005-1971-02PREVNAR 13
      00006-4094-02RECOMBIVAX HB
      00006-4096-02VAQTA
      58160-0825-11HAVRIX
      58160-0811-52PEDIARIX
      42515-0002-01IXIARO
      49281-0013-50FLUZONE
      76420-0483-01Medical Provider Single Use EZ Flu Shot 2013-2014
      66521-0118-10Fluvirin
      49281-0399-65FLUZONE High-Dose
      49281-0396-15FLUZONE
      66019-0107-01FLUMIST
      19515-0890-07FLULAVAL
      76420-0482-01Medical Provider Single Use EZ Flu Shot 2013-2014
      33332-0015-01AFLURIA
      66019-0302-10FluMist Quadrivalent
      49281-0012-10FLUZONE
      49281-0710-40FLUZONE INTRADERMAL QUADRIVALENT
      63851-0501-02RabAvert
      58160-0879-52FLUARIX
      49281-0397-65FLUZONE High-Dose
      00006-4831-41VAQTA
      58160-0815-46TWINRIX
      33332-0110-10AFLURIA
      54868-4320-00PNEUMOVAX 23
      42874-0016-10Flublok
      49281-0012-50FLUZONE
      58160-0818-11Hiberix
      49281-0386-15FLUZONE
      46028-0114-01Bexsero
      00006-4898-00COMVAX
      58160-0826-52HAVRIX
      49281-0545-05ActHIB
      66019-0108-10FLUMIST
      70461-0418-10FLUCELVAX QUADRIVALENT (MULTI-DOSE VIAL)
      00006-4094-09RECOMBIVAX HB
      49281-0298-10TRIPEDIA
      33332-0629-10Influenza A
      58160-0880-52FLUARIX
      00006-4047-20RotaTeq
      00006-4119-02GARDASIL 9
      58160-0842-11BOOSTRIX
      19515-0903-11Flulaval Quadrivalent
      00006-4981-00RECOMBIVAX HB
      58160-0905-52FLUARIX QUADRIVALENT
      49281-0401-65FLUZONE High-Dose
      33332-0114-10AFLURIA
      49281-0860-10IPOL
      70461-0318-03FLUCELVAX QUADRIVALENT (PREFILLED SYRINGE)
      54868-2219-01RECOMBIVAX HB
      49281-0718-10Flublok Quadrivalent
      49281-0400-15Adacel
      70461-0120-02Fluvirin
      49281-0416-50FLUZONE QUADRIVALENT
      49281-0413-50FLUZONE QUADRIVALENT
      58160-0883-52FLUARIX
      49281-0790-51Typhim Vi
      49281-0286-10DAPTACEL
      66019-0110-10FluMist
      46028-0114-02Bexsero
      58160-0821-52ENGERIX-B
      49281-0013-10FLUZONE
      19515-0894-52Flulaval Quadrivalent
      66019-0305-10FluMist Quadrivalent
      49281-0400-10Adacel
      49281-0390-15FLUZONE
      00052-0603-02BCG VACCINE
      51285-0138-50Adenovirus Type 4 and Type 7 Vaccine, Live
      33332-0417-10AFLURIA QUADRIVALENT
      49281-0395-65FLUZONE High-Dose
      66019-0301-10FluMist Quadrivalent
      49281-0215-10TENIVAC
      19515-0895-11Flulaval Quadrivalent
      70461-0201-01FLUCELVAX QUADRIVALENT (PREFILLED SYRINGE)
      58160-0907-52FLUARIX QUADRIVALENT
      55045-3841-01HAVRIX
      50090-2883-00INFANRIX
      49281-0820-10TETANUS TOXOID ADSORBED
      49281-0417-10FLUZONE QUADRIVALENT
      33332-0010-01AFLURIA
      33332-0013-01AFLURIA
      66521-0200-10Influenza A (H1N1) 2009 Monovalent Vaccine
      58160-0976-06Bexsero
      58160-0809-05MENHIBRIX
      00006-4739-00PNEUMOVAX 23
      70461-0018-03FLUAD
      49281-0413-10FLUZONE QUADRIVALENT
      13533-0131-01Tetanus and Diphtheria Toxoids Adsorbed
      58160-0812-11KINRIX
      49281-0391-65FLUZONE High-Dose
      19515-0845-11FLULAVAL
      58160-0811-51PEDIARIX
      58160-0815-52TWINRIX
      70461-0119-02Fluvirin
      58160-0810-52INFANRIX
      62577-0614-01Flucelvax
      42874-0117-10Flublok Quadrivalent
      49281-0489-91MENOMUNE - A/C/Y/W-135 COMBINED
      58160-0964-12RabAvert
      49281-0014-50FLUZONE
      00006-4109-02GARDASIL
      70461-0002-01FLUAD
      49281-0286-01DAPTACEL
      58160-0810-11INFANRIX
      19515-0900-11Flulaval Quadrivalent
      00006-4837-03PNEUMOVAX 23
      66521-0113-10FLUVIRIN
      58160-0826-34HAVRIX
      58160-0903-52FLUARIX QUADRIVALENT
      00006-4841-00VAQTA
      54868-6180-00FLUZONE
      00006-4681-00M-M-R II
      33332-0317-01AFLURIA QUADRIVALENT
      70461-0001-01FLUAD
      49281-0589-05Menactra
      49281-0387-65FLUZONE
      49281-0860-55IPOL
      19515-0893-07FLULAVAL
      33332-0519-25Influenza A
      70461-0301-10FLUCELVAX QUADRIVALENT (MULTI-DOSE VIAL)
      66019-0200-10Influenza A H1N1 Intranasal
      43528-0003-05HEPLISAV-B
      58160-0820-52ENGERIX-B
      66521-0000-01FLUAD
      49281-0250-51IMOVAX RABIES
      49281-0291-10DECAVAC
      33332-0418-10AFLURIA QUADRIVALENT
      00006-4121-02GARDASIL 9
      63851-0613-01FLUCELVAX
      66521-0114-10FLUVIRIN
      00006-4047-41RotaTeq
      58160-0901-52FLUARIX QUADRIVALENT
      33332-0318-01AFLURIA QUADRIVALENT
      00006-4119-03GARDASIL 9
      49281-0225-10DIPHTHERIA AND TETANUS TOXOIDS ADSORBED
      58160-0815-11TWINRIX
      54868-6177-00FLUZONE
      49281-0010-50FLUZONE
      49281-0400-20Adacel
      49281-0545-03ActHIB
      50090-1693-09IPOL
      00006-4995-41RECOMBIVAX HB
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-ndc-vaccine-codes","version":"3.1.0","name":"USCoreVaccineNationalDrugCode","title":"US Core Vaccine National Drug Codes (NDC)","status":"active","date":"2019-05-21T10:00:00+10:00","publisher":"HL7 US Realm Steering Committee","description":"This value set includes all the Vaccine National Drug Codes (NDC). This source of this data is provided by the [CDC](https://www2a.cdc.gov/vaccines/iis/iisstandards/ndc_crosswalk.asp)","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"purpose":"Codes that are used as translations for CVS code for implementation of the Argonaut Immunization IG and MU2015 certification.","compose":{"include":[{"system":"http://hl7.org/fhir/sid/ndc","concept":[{"code":"49281-0703-55","display":"FLUZONE INTRADERMAL"},{"code":"49281-0790-20","display":"Typhim Vi"},{"code":"33332-0316-01","display":"AFLURIA QUADRIVALENT"},{"code":"49281-0712-40","display":"FLUZONE INTRADERMAL QUADRIVALENT"},{"code":"66521-0112-02","display":"Fluvirin"},{"code":"58160-0816-05","display":"Hiberix"},{"code":"00006-4837-02","display":"PNEUMOVAX 23"},{"code":"58160-0808-15","display":"Influenza A (H5N1) Monovalent Vaccine, Adjuvanted"},{"code":"58160-0842-51","display":"BOOSTRIX"},{"code":"49281-0418-50","display":"FLUZONE QUADRIVALENT"},{"code":"00006-4943-00","display":"PNEUMOVAX 23"},{"code":"49281-0708-40","display":"FLUZONE INTRADERMAL QUADRIVALENT"},{"code":"54868-0734-00","display":"ENGERIX-B"},{"code":"58160-0819-12","display":"Shingrix"},{"code":"49281-0517-25","display":"FLUZONE QUADRIVALENT"},{"code":"00006-4133-41","display":"Tetanus and Diphtheria Toxoids Adsorbed"},{"code":"50090-3096-00","display":"RabAvert"},{"code":"33332-0118-10","display":"AFLURIA"},{"code":"19515-0909-52","display":"Flulaval Quadrivalent"},{"code":"49281-0650-10","display":"INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE"},{"code":"58160-0820-11","display":"ENGERIX-B"},{"code":"42515-0001-01","display":"IXIARO"},{"code":"49281-0625-15","display":"FLUZONE QUADRIVALENT"},{"code":"49281-0516-25","display":"FLUZONE QUADRIVALENT"},{"code":"66521-0114-02","display":"FLUVIRIN"},{"code":"19515-0896-11","display":"Flulaval Quadrivalent"},{"code":"33332-0117-10","display":"AFLURIA"},{"code":"33332-0416-10","display":"AFLURIA QUADRIVALENT"},{"code":"66521-0118-02","display":"Fluvirin"},{"code":"58160-0821-11","display":"ENGERIX-B"},{"code":"00005-1971-05","display":"PREVNAR 13"},{"code":"66019-0109-10","display":"FLUMIST"},{"code":"49281-0278-10","display":"DIPHTHERIA AND TETANUS TOXOIDS ADSORBED"},{"code":"49281-0011-10","display":"FLUZONE"},{"code":"54868-2219-00","display":"RECOMBIVAX HB"},{"code":"49281-0415-10","display":"FLUZONE QUADRIVALENT"},{"code":"33332-0016-01","display":"AFLURIA"},{"code":"49281-0705-55","display":"FLUZONE"},{"code":"49281-0621-15","display":"FLUZONE QUADRIVALENT"},{"code":"58160-0842-34","display":"BOOSTRIX"},{"code":"49281-0010-10","display":"FLUZONE"},{"code":"66521-0113-02","display":"FLUVIRIN"},{"code":"49281-0514-25","display":"FLUZONE QUADRIVALENT"},{"code":"58160-0842-52","display":"BOOSTRIX"},{"code":"19515-0901-52","display":"Flulaval Quadrivalent"},{"code":"62577-0613-01","display":"Flucelvax"},{"code":"66019-0303-10","display":"FluMist Quadrivalent"},{"code":"49281-0388-15","display":"FLUZONE"},{"code":"00006-4841-41","display":"VAQTA"},{"code":"58160-0900-52","display":"FLUARIX QUADRIVALENT"},{"code":"70461-0200-01","display":"FLUCELVAX QUADRIVALENT"},{"code":"49281-0915-05","display":"YF-VAX"},{"code":"49281-0650-50","display":"INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE"},{"code":"33332-0116-10","display":"AFLURIA"},{"code":"54868-3339-01","display":"PNEUMOVAX 23"},{"code":"49281-0418-10","display":"FLUZONE QUADRIVALENT"},{"code":"58160-0812-52","display":"KINRIX"},{"code":"49281-0286-05","display":"DAPTACEL"},{"code":"63851-0612-01","display":"Flucelvax"},{"code":"19515-0908-52","display":"Flulaval Quadrivalent"},{"code":"54868-0980-00","display":"M-M-R II"},{"code":"58160-0830-52","display":"CERVARIX"},{"code":"49281-0113-25","display":"FLUZONE"},{"code":"49281-0650-70","display":"INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE"},{"code":"66521-0115-10","display":"FLUVIRIN"},{"code":"49281-0417-50","display":"FLUZONE QUADRIVALENT"},{"code":"33332-0113-10","display":"AFLURIA"},{"code":"49281-0629-15","display":"FLUZONE QUADRIVALENT"},{"code":"58160-0823-11","display":"Shingrix"},{"code":"00006-4897-00","display":"PedvaxHIB"},{"code":"58160-0821-34","display":"ENGERIX-B"},{"code":"66521-0115-02","display":"FLUVIRIN"},{"code":"33332-0014-01","display":"AFLURIA"},{"code":"49281-0562-10","display":"QUADRACEL"},{"code":"42874-0014-10","display":"Flublok"},{"code":"42874-0013-10","display":"Flublok"},{"code":"33332-0115-10","display":"AFLURIA"},{"code":"00006-4963-00","display":"ZOSTAVAX"},{"code":"49281-0010-25","display":"FLUZONE"},{"code":"33332-0519-01","display":"Influenza A"},{"code":"58160-0898-52","display":"FLUARIX QUADRIVALENT"},{"code":"49281-0112-25","display":"FLUZONE"},{"code":"19515-0898-11","display":"Flulaval Quadrivalent"},{"code":"00006-4109-09","display":"GARDASIL"},{"code":"49281-0414-50","display":"FLUZONE QUADRIVALENT"},{"code":"00006-4095-09","display":"VAQTA"},{"code":"00006-4045-00","display":"GARDASIL"},{"code":"19515-0912-52","display":"Flulaval Quadrivalent"},{"code":"58160-0801-11","display":"Menhibrix"},{"code":"49281-0489-01","display":"MENOMUNE - A/C/Y/W-135 COMBINED"},{"code":"42874-0017-10","display":"Flublok"},{"code":"66521-0116-02","display":"Fluvirin"},{"code":"46028-0208-01","display":"Menveo"},{"code":"49281-0627-15","display":"FLUZONE QUADRIVALENT"},{"code":"00005-0100-02","display":"Trumenba"},{"code":"69401-0000-01","display":"Vivotif"},{"code":"21695-0413-01","display":"Tetanus and Diphtheria Toxoids Adsorbed"},{"code":"49281-0416-10","display":"FLUZONE QUADRIVALENT"},{"code":"49281-0650-25","display":"INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE"},{"code":"49281-0800-83","display":"TETANUS TOXOID ADSORBED"},{"code":"49281-0291-83","display":"DECAVAC"},{"code":"00006-4095-02","display":"VAQTA"},{"code":"58160-0854-52","display":"ROTARIX"},{"code":"19515-0889-07","display":"FLULAVAL"},{"code":"49281-0392-15","display":"FLUZONE"},{"code":"19515-0891-11","display":"Flulaval Quadrivalent"},{"code":"49281-0400-05","display":"Adacel"},{"code":"49281-0913-01","display":"STAMARIL"},{"code":"49281-0640-15","display":"INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE"},{"code":"49281-0513-25","display":"FLUZONE QUADRIVALENT"},{"code":"00006-4171-00","display":"ProQuad"},{"code":"00006-4096-09","display":"VAQTA"},{"code":"58160-0830-34","display":"CERVARIX"},{"code":"00006-4980-00","display":"RECOMBIVAX HB"},{"code":"17478-0131-01","display":"Tetanus and Diphtheria Toxoids Adsorbed"},{"code":"49281-0414-10","display":"FLUZONE QUADRIVALENT"},{"code":"43528-0002-05","display":"HEPLISAV-B"},{"code":"66521-0200-02","display":"Influenza A (H1N1) 2009 Monovalent Vaccine"},{"code":"49281-0011-50","display":"FLUZONE"},{"code":"70461-0120-10","display":"Fluvirin"},{"code":"66019-0304-10","display":"FluMist Quadrivalent"},{"code":"58160-0976-20","display":"Bexsero"},{"code":"00006-4826-00","display":"VARIVAX"},{"code":"66521-0116-10","display":"Fluvirin"},{"code":"00006-4963-41","display":"ZOSTAVAX"},{"code":"49281-0510-05","display":"PENTACEL"},{"code":"42874-0012-10","display":"Flublok"},{"code":"58160-0955-09","display":"Menveo"},{"code":"00005-0100-05","display":"Trumenba"},{"code":"49281-0707-55","display":"FLUZONE"},{"code":"14362-0111-04","display":"Tetanus and Diphtheria Toxoids Adsorbed"},{"code":"66521-0112-10","display":"Fluvirin"},{"code":"66521-0117-10","display":"Fluvirin"},{"code":"00006-4045-41","display":"GARDASIL"},{"code":"49281-0389-65","display":"FLUZONE HIGH DOSE"},{"code":"69401-0000-02","display":"Vivotif"},{"code":"49281-0915-01","display":"YF-VAX"},{"code":"00006-4093-02","display":"RECOMBIVAX HB"},{"code":"58160-0815-48","display":"TWINRIX"},{"code":"70460-0001-01","display":"Vaxchora"},{"code":"58160-0826-11","display":"HAVRIX"},{"code":"00006-4992-00","display":"RECOMBIVAX HB"},{"code":"49281-0111-25","display":"FLUZONE"},{"code":"00006-4093-09","display":"RECOMBIVAX HB"},{"code":"50090-3469-00","display":"HEPLISAV-B"},{"code":"49281-0403-65","display":"FLUZONE High-Dose"},{"code":"70461-0119-10","display":"Fluvirin"},{"code":"00006-4995-00","display":"RECOMBIVAX HB"},{"code":"58160-0815-34","display":"TWINRIX"},{"code":"49281-0393-65","display":"FLUZONE High-Dose"},{"code":"00005-1970-50","display":"Prevnar"},{"code":"33332-0017-01","display":"AFLURIA"},{"code":"63851-0501-01","display":"RabAvert"},{"code":"58160-0881-52","display":"FLUARIX"},{"code":"64678-0211-01","display":"BioThrax"},{"code":"49281-0394-15","display":"FLUZONE"},{"code":"00006-4827-00","display":"VARIVAX"},{"code":"58160-0806-05","display":"HIBERIX"},{"code":"49281-0518-25","display":"FLUZONE QUADRIVALENT"},{"code":"62195-0051-10","display":"Ixiaro"},{"code":"63361-0245-10","display":"VAXELIS"},{"code":"49281-0709-55","display":"FLUZONE Intradermal"},{"code":"66019-0300-10","display":"FluMist Quadrivalent"},{"code":"49281-0215-15","display":"TENIVAC"},{"code":"58160-0825-52","display":"HAVRIX"},{"code":"00005-0100-10","display":"Trumenba"},{"code":"66521-0117-02","display":"Fluvirin"},{"code":"49281-0650-90","display":"INFLUENZA A (H1N1) 2009 MONOVALENT VACCINE"},{"code":"42874-0015-10","display":"Flublok"},{"code":"33332-0018-01","display":"AFLURIA"},{"code":"00006-4999-00","display":"ProQuad"},{"code":"00005-1971-04","display":"PREVNAR 13"},{"code":"19515-0850-52","display":"FLULAVAL"},{"code":"00005-1971-02","display":"PREVNAR 13"},{"code":"00006-4094-02","display":"RECOMBIVAX HB"},{"code":"00006-4096-02","display":"VAQTA"},{"code":"58160-0825-11","display":"HAVRIX"},{"code":"58160-0811-52","display":"PEDIARIX"},{"code":"42515-0002-01","display":"IXIARO"},{"code":"49281-0013-50","display":"FLUZONE"},{"code":"76420-0483-01","display":"Medical Provider Single Use EZ Flu Shot 2013-2014"},{"code":"66521-0118-10","display":"Fluvirin"},{"code":"49281-0399-65","display":"FLUZONE High-Dose"},{"code":"49281-0396-15","display":"FLUZONE"},{"code":"66019-0107-01","display":"FLUMIST"},{"code":"19515-0890-07","display":"FLULAVAL"},{"code":"76420-0482-01","display":"Medical Provider Single Use EZ Flu Shot 2013-2014"},{"code":"33332-0015-01","display":"AFLURIA"},{"code":"66019-0302-10","display":"FluMist Quadrivalent"},{"code":"49281-0012-10","display":"FLUZONE"},{"code":"49281-0710-40","display":"FLUZONE INTRADERMAL QUADRIVALENT"},{"code":"63851-0501-02","display":"RabAvert"},{"code":"58160-0879-52","display":"FLUARIX"},{"code":"49281-0397-65","display":"FLUZONE High-Dose"},{"code":"00006-4831-41","display":"VAQTA"},{"code":"58160-0815-46","display":"TWINRIX"},{"code":"33332-0110-10","display":"AFLURIA"},{"code":"54868-4320-00","display":"PNEUMOVAX 23"},{"code":"42874-0016-10","display":"Flublok"},{"code":"49281-0012-50","display":"FLUZONE"},{"code":"58160-0818-11","display":"Hiberix"},{"code":"49281-0386-15","display":"FLUZONE"},{"code":"46028-0114-01","display":"Bexsero"},{"code":"00006-4898-00","display":"COMVAX"},{"code":"58160-0826-52","display":"HAVRIX"},{"code":"49281-0545-05","display":"ActHIB"},{"code":"66019-0108-10","display":"FLUMIST"},{"code":"70461-0418-10","display":"FLUCELVAX QUADRIVALENT (MULTI-DOSE VIAL)"},{"code":"00006-4094-09","display":"RECOMBIVAX HB"},{"code":"49281-0298-10","display":"TRIPEDIA"},{"code":"33332-0629-10","display":"Influenza A"},{"code":"58160-0880-52","display":"FLUARIX"},{"code":"00006-4047-20","display":"RotaTeq"},{"code":"00006-4119-02","display":"GARDASIL 9"},{"code":"58160-0842-11","display":"BOOSTRIX"},{"code":"19515-0903-11","display":"Flulaval Quadrivalent"},{"code":"00006-4981-00","display":"RECOMBIVAX HB"},{"code":"58160-0905-52","display":"FLUARIX QUADRIVALENT"},{"code":"49281-0401-65","display":"FLUZONE High-Dose"},{"code":"33332-0114-10","display":"AFLURIA"},{"code":"49281-0860-10","display":"IPOL"},{"code":"70461-0318-03","display":"FLUCELVAX QUADRIVALENT (PREFILLED SYRINGE)"},{"code":"54868-2219-01","display":"RECOMBIVAX HB"},{"code":"49281-0718-10","display":"Flublok Quadrivalent"},{"code":"49281-0400-15","display":"Adacel"},{"code":"70461-0120-02","display":"Fluvirin"},{"code":"49281-0416-50","display":"FLUZONE QUADRIVALENT"},{"code":"49281-0413-50","display":"FLUZONE QUADRIVALENT"},{"code":"58160-0883-52","display":"FLUARIX"},{"code":"49281-0790-51","display":"Typhim Vi"},{"code":"49281-0286-10","display":"DAPTACEL"},{"code":"66019-0110-10","display":"FluMist"},{"code":"46028-0114-02","display":"Bexsero"},{"code":"58160-0821-52","display":"ENGERIX-B"},{"code":"49281-0013-10","display":"FLUZONE"},{"code":"19515-0894-52","display":"Flulaval Quadrivalent"},{"code":"66019-0305-10","display":"FluMist Quadrivalent"},{"code":"49281-0400-10","display":"Adacel"},{"code":"49281-0390-15","display":"FLUZONE"},{"code":"00052-0603-02","display":"BCG VACCINE"},{"code":"51285-0138-50","display":"Adenovirus Type 4 and Type 7 Vaccine, Live"},{"code":"33332-0417-10","display":"AFLURIA QUADRIVALENT"},{"code":"49281-0395-65","display":"FLUZONE High-Dose"},{"code":"66019-0301-10","display":"FluMist Quadrivalent"},{"code":"49281-0215-10","display":"TENIVAC"},{"code":"19515-0895-11","display":"Flulaval Quadrivalent"},{"code":"70461-0201-01","display":"FLUCELVAX QUADRIVALENT (PREFILLED SYRINGE)"},{"code":"58160-0907-52","display":"FLUARIX QUADRIVALENT"},{"code":"55045-3841-01","display":"HAVRIX"},{"code":"50090-2883-00","display":"INFANRIX"},{"code":"49281-0820-10","display":"TETANUS TOXOID ADSORBED"},{"code":"49281-0417-10","display":"FLUZONE QUADRIVALENT"},{"code":"33332-0010-01","display":"AFLURIA"},{"code":"33332-0013-01","display":"AFLURIA"},{"code":"66521-0200-10","display":"Influenza A (H1N1) 2009 Monovalent Vaccine"},{"code":"58160-0976-06","display":"Bexsero"},{"code":"58160-0809-05","display":"MENHIBRIX"},{"code":"00006-4739-00","display":"PNEUMOVAX 23"},{"code":"70461-0018-03","display":"FLUAD"},{"code":"49281-0413-10","display":"FLUZONE QUADRIVALENT"},{"code":"13533-0131-01","display":"Tetanus and Diphtheria Toxoids Adsorbed"},{"code":"58160-0812-11","display":"KINRIX"},{"code":"49281-0391-65","display":"FLUZONE High-Dose"},{"code":"19515-0845-11","display":"FLULAVAL"},{"code":"58160-0811-51","display":"PEDIARIX"},{"code":"58160-0815-52","display":"TWINRIX"},{"code":"70461-0119-02","display":"Fluvirin"},{"code":"58160-0810-52","display":"INFANRIX"},{"code":"62577-0614-01","display":"Flucelvax"},{"code":"42874-0117-10","display":"Flublok Quadrivalent"},{"code":"49281-0489-91","display":"MENOMUNE - A/C/Y/W-135 COMBINED"},{"code":"58160-0964-12","display":"RabAvert"},{"code":"49281-0014-50","display":"FLUZONE"},{"code":"00006-4109-02","display":"GARDASIL"},{"code":"70461-0002-01","display":"FLUAD"},{"code":"49281-0286-01","display":"DAPTACEL"},{"code":"58160-0810-11","display":"INFANRIX"},{"code":"19515-0900-11","display":"Flulaval Quadrivalent"},{"code":"00006-4837-03","display":"PNEUMOVAX 23"},{"code":"66521-0113-10","display":"FLUVIRIN"},{"code":"58160-0826-34","display":"HAVRIX"},{"code":"58160-0903-52","display":"FLUARIX QUADRIVALENT"},{"code":"00006-4841-00","display":"VAQTA"},{"code":"54868-6180-00","display":"FLUZONE"},{"code":"00006-4681-00","display":"M-M-R II"},{"code":"33332-0317-01","display":"AFLURIA QUADRIVALENT"},{"code":"70461-0001-01","display":"FLUAD"},{"code":"49281-0589-05","display":"Menactra"},{"code":"49281-0387-65","display":"FLUZONE"},{"code":"49281-0860-55","display":"IPOL"},{"code":"19515-0893-07","display":"FLULAVAL"},{"code":"33332-0519-25","display":"Influenza A"},{"code":"70461-0301-10","display":"FLUCELVAX QUADRIVALENT (MULTI-DOSE VIAL)"},{"code":"66019-0200-10","display":"Influenza A H1N1 Intranasal"},{"code":"43528-0003-05","display":"HEPLISAV-B"},{"code":"58160-0820-52","display":"ENGERIX-B"},{"code":"66521-0000-01","display":"FLUAD"},{"code":"49281-0250-51","display":"IMOVAX RABIES"},{"code":"49281-0291-10","display":"DECAVAC"},{"code":"33332-0418-10","display":"AFLURIA QUADRIVALENT"},{"code":"00006-4121-02","display":"GARDASIL 9"},{"code":"63851-0613-01","display":"FLUCELVAX"},{"code":"66521-0114-10","display":"FLUVIRIN"},{"code":"00006-4047-41","display":"RotaTeq"},{"code":"58160-0901-52","display":"FLUARIX QUADRIVALENT"},{"code":"33332-0318-01","display":"AFLURIA QUADRIVALENT"},{"code":"00006-4119-03","display":"GARDASIL 9"},{"code":"49281-0225-10","display":"DIPHTHERIA AND TETANUS TOXOIDS ADSORBED"},{"code":"58160-0815-11","display":"TWINRIX"},{"code":"54868-6177-00","display":"FLUZONE"},{"code":"49281-0010-50","display":"FLUZONE"},{"code":"49281-0400-20","display":"Adacel"},{"code":"49281-0545-03","display":"ActHIB"},{"code":"50090-1693-09","display":"IPOL"},{"code":"00006-4995-41","display":"RECOMBIVAX HB"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-observation-smoking-status-status.json b/resources/uscore_v3.1.0/ValueSet-us-core-observation-smoking-status-status.json new file mode 100755 index 000000000..4d50a1c17 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-observation-smoking-status-status.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-observation-smoking-status-status","text":{"status":"generated","div":"

    US Core Status for Smoking Status Observation

    Codes providing the status of an observation for smoking status. Constrained to finaland entered-in-error.

    \n

    This value set includes codes from the following code systems:

    • Include these codes as defined in http://hl7.org/fhir/observation-status
      CodeDisplay
      finalFinalThe observation is complete and there are no further actions needed. Additional information such "released", "signed", etc would be represented using [Provenance](provenance.html) which provides not only the act but also the actors and dates and other related data. These act states would be associated with an observation status of `preliminary` until they are all completed and then a status of `final` would be applied.
      entered-in-errorEntered in ErrorThe observation has been withdrawn following previous final release. This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be "cancelled" rather than "entered-in-error".).
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-observation-smoking-status-status","version":"3.1.0","name":"USCoreObservationSmokingStatusStatus","title":"US Core Status for Smoking Status Observation","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"Codes providing the status of an observation for smoking status. Constrained to `final`and `entered-in-error`.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"http://hl7.org/fhir/observation-status","concept":[{"code":"final"},{"code":"entered-in-error"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-observation-smokingstatus.json b/resources/uscore_v3.1.0/ValueSet-us-core-observation-smokingstatus.json new file mode 100755 index 000000000..30288fc06 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-observation-smokingstatus.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-observation-smokingstatus","text":{"status":"generated","div":"

    US Core Smoking Status

    This value set indicates the current smoking status of a patient.

    \n

    Copyright Statement: This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-observation-smokingstatus","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113883.4.642.2.602"}],"version":"3.1.0","name":"USCoreSmokingStatus","title":"US Core Smoking Status","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"This value set indicates the current smoking status of a patient.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement","compose":{"include":[{"system":"http://snomed.info/sct","concept":[{"code":"449868002","display":"Current every day smoker"},{"code":"428041000124106","display":"Current some day smoker"},{"code":"8517006","display":"Former smoker"},{"code":"266919005","display":"Never smoker"},{"code":"77176002","display":"Smoker, current status unknown"},{"code":"266927001","display":"Unknown if ever smoked"},{"code":"428071000124103","display":"Current Heavy tobacco smoker"},{"code":"428061000124105","display":"Current Light tobacco smoker"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-observation-value-codes.json b/resources/uscore_v3.1.0/ValueSet-us-core-observation-value-codes.json new file mode 100755 index 000000000..c99dfc640 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-observation-value-codes.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-observation-value-codes","text":{"status":"generated","div":"

    US Core Observation Value Codes (SNOMED-CT)

    Snomed-CT concept codes for coded results

    \n

    Copyright Statement: This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-observation-value-codes","version":"3.1.0","name":"USCoreObservationValueCodes","title":"US Core Observation Value Codes (SNOMED-CT)","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"},{"system":"email","value":"fhir@lists.hl7.org"}]}],"description":"[Snomed-CT](http://www.ihtsdo.org/) concept codes for coded results","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement","compose":{"include":[{"system":"http://snomed.info/sct"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-procedure-code.json b/resources/uscore_v3.1.0/ValueSet-us-core-procedure-code.json new file mode 100755 index 000000000..00e4ca706 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-procedure-code.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-procedure-code","text":{"status":"generated","div":"

    US Core Procedure Codes

    This example value set defines a set of codes that can be used to indicate the type of procedure: a specific code indicating type of procedure performed, from CPT, SNOMED CT, or HCPCS Level II Alphanumeric Codes.

    \n

    Copyright Statement: CPT copyright 2014 American Medical Association. All rights reserved. This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement

    This value set includes codes from the following code systems:

    • Include all codes defined in http://www.ama-assn.org/go/cpt
    • Include codes from http://snomed.info/sct where concept is-a 71388002 (Procedure)
    • Include all codes defined in urn:oid:2.16.840.1.113883.6.285
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-procedure-code","version":"3.1.0","name":"USCoreProcedureCodes","title":"US Core Procedure Codes","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"This example value set defines a set of codes that can be used to indicate the type of procedure: a specific code indicating type of procedure performed, from CPT, SNOMED CT, or HCPCS Level II Alphanumeric Codes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"CPT copyright 2014 American Medical Association. All rights reserved. This value set includes content from SNOMED CT, which is copyright © 2002+ International Health Terminology Standards Development Organisation (IHTSDO), and distributed by agreement between IHTSDO and HL7. Implementer use of SNOMED CT is not covered by this agreement","compose":{"include":[{"system":"http://www.ama-assn.org/go/cpt"},{"system":"http://snomed.info/sct","filter":[{"property":"concept","op":"is-a","value":"71388002"}]},{"system":"urn:oid:2.16.840.1.113883.6.285"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-procedure-icd10pcs.json b/resources/uscore_v3.1.0/ValueSet-us-core-procedure-icd10pcs.json new file mode 100755 index 000000000..85ae21ace --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-procedure-icd10pcs.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-procedure-icd10pcs","text":{"status":"generated","div":"

    US Core ICD-10-PCS Procedure Codes

    This value set defines a set of codes from ICD10-PCS that can be used to indicate a type of procedure performed

    \n

    Copyright Statement: The International Classification of Diseases, Tenth Revision, Procedure Coding System (ICD-10-PCS) was developed for the Centers for Medicare and Medicaid Services (CMS). CMS is the U.S. governmental agency responsible for overseeing all changes and modifications to the ICD-10-PCS.

    This value set includes codes from the following code systems:

    • Include all codes defined in http://www.icd10data.com/icd10pcs
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-procedure-icd10pcs","version":"3.1.0","name":"USCoreIcd_10PcsProcedureCodes","title":"US Core ICD-10-PCS Procedure Codes","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"This value set defines a set of codes from ICD10-PCS that can be used to indicate a type of procedure performed","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"The International Classification of Diseases, Tenth Revision, Procedure Coding System (ICD-10-PCS) was developed for the Centers for Medicare and Medicaid Services (CMS). CMS is the U.S. governmental agency responsible for overseeing all changes and modifications to the ICD-10-PCS.","compose":{"include":[{"system":"http://www.icd10data.com/icd10pcs"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-provenance-participant-type.json b/resources/uscore_v3.1.0/ValueSet-us-core-provenance-participant-type.json new file mode 100755 index 000000000..527a70704 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-provenance-participant-type.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-provenance-participant-type","text":{"status":"generated","div":"

    US Core Provenance Participant Type Codes

    The type of participation a provenance agent played for a given target.

    \n

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-provenance-participant-type","version":"3.1.0","name":"USCoreProvenancePaticipantTypeCodes","title":"US Core Provenance Participant Type Codes","status":"active","date":"2019-08-28T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","description":"The type of participation a provenance agent played for a given target.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"purpose":"So API consumers can identify the provenance participant type.","compose":{"include":[{"system":"http://hl7.org/fhir/us/core/CodeSystem/us-core-provenance-participant-type"},{"system":"http://terminology.hl7.org/CodeSystem/provenance-participant-type"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-provider-role.json b/resources/uscore_v3.1.0/ValueSet-us-core-provider-role.json new file mode 100755 index 000000000..8db4d5433 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-provider-role.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-provider-role","text":{"status":"generated","div":"

    US Core Provider Role (NUCC)

    Provider roles codes which are composed of the NUCC Health Care Provider Taxonomy Code Set classification codes for providers. Only concepts with a classification and no specialization are included.

    \n

    Copyright Statement: This value set includes content from NUCC Health Care Provider Taxonomy Code Set for providers which is copyright © 2016+ American Medical Association. For commercial use, including sales or licensing, a license must be obtained.

    This value set includes codes from the following code systems:

    • Include these codes as defined in http://nucc.org/provider-taxonomy
      CodeDisplay
      101Y00000XCounselor
      102L00000XPsychoanalyst
      102X00000XPoetry Therapist
      103G00000XClinical Neuropsychologist
      103K00000XBehavior Analyst
      103T00000XPsychologist
      104100000XSocial Worker
      106E00000XAssistant Behavior Analyst
      106H00000XMarriage & Family Therapist
      106S00000XBehavior Technician
      111N00000XChiropractor
      122300000XDentist
      122400000XDenturist
      124Q00000XDental Hygienist
      125J00000XDental Therapist
      125K00000XAdvanced Practice Dental Therapist
      125Q00000XOral Medicinist
      126800000XDental Assistant
      126900000XDental Laboratory Technician
      132700000XDietary Manager
      133N00000XNutritionist
      133V00000XDietitian, Registered
      136A00000XDietetic Technician, Registered
      146D00000XPersonal Emergency Response Attendant
      146L00000XEmergency Medical Technician, Paramedic
      146M00000XEmergency Medical Technician, Intermediate
      146N00000XEmergency Medical Technician, Basic
      152W00000XOptometrist
      156F00000XTechnician/Technologist
      163W00000XRegistered Nurse
      164W00000XLicensed Practical Nurse
      164X00000XLicensed Vocational Nurse
      167G00000XLicensed Psychiatric Technician
      170100000XMedical Genetics, Ph.D. Medical Genetics
      170300000XGenetic Counselor, MS
      171000000XMilitary Health Care Provider
      171100000XAcupuncturist
      171M00000XCase Manager/Care Coordinator
      171R00000XInterpreter
      171W00000XContractor
      172A00000XDriver
      172M00000XMechanotherapist
      172P00000XNaprapath
      172V00000XCommunity Health Worker
      173000000XLegal Medicine
      173C00000XReflexologist
      173F00000XSleep Specialist, PhD
      174200000XMeals
      174400000XSpecialist
      174H00000XHealth Educator
      174M00000XVeterinarian
      174N00000XLactation Consultant, Non-RN
      174V00000XClinical Ethicist
      175F00000XNaturopath
      175L00000XHomeopath
      175M00000XMidwife, Lay
      175T00000XPeer Specialist
      176B00000XMidwife
      176P00000XFuneral Director
      177F00000XLodging
      183500000XPharmacist
      183700000XPharmacy Technician
      193200000XMulti-Specialty
      193400000XSingle Specialty
      202C00000XIndependent Medical Examiner
      202K00000XPhlebology
      204C00000XNeuromusculoskeletal Medicine, Sports Medicine
      204D00000XNeuromusculoskeletal Medicine & OMM
      204E00000XOral & Maxillofacial Surgery
      204F00000XTransplant Surgery
      204R00000XElectrodiagnostic Medicine
      207K00000XAllergy & Immunology
      207L00000XAnesthesiology
      207N00000XDermatology
      207P00000XEmergency Medicine
      207Q00000XFamily Medicine
      207R00000XInternal Medicine
      207T00000XNeurological Surgery
      207U00000XNuclear Medicine
      207V00000XObstetrics & Gynecology
      207W00000XOphthalmology
      207X00000XOrthopaedic Surgery
      207Y00000XOtolaryngology
      208000000XPediatrics
      208100000XPhysical Medicine & Rehabilitation
      208200000XPlastic Surgery
      208600000XSurgery
      208800000XUrology
      208C00000XColon & Rectal Surgery
      208D00000XGeneral Practice
      208G00000XThoracic Surgery (Cardiothoracic Vascular Surgery)
      208M00000XHospitalist
      208U00000XClinical Pharmacology
      209800000XLegal Medicine
      211D00000XAssistant, Podiatric
      213E00000XPodiatrist
      221700000XArt Therapist
      222Q00000XDevelopmental Therapist
      222Z00000XOrthotist
      224900000XMastectomy Fitter
      224L00000XPedorthist
      224P00000XProsthetist
      224Y00000XClinical Exercise Physiologist
      224Z00000XOccupational Therapy Assistant
      225000000XOrthotic Fitter
      225100000XPhysical Therapist
      225200000XPhysical Therapy Assistant
      225400000XRehabilitation Practitioner
      225500000XSpecialist/Technologist
      225600000XDance Therapist
      225700000XMassage Therapist
      225800000XRecreation Therapist
      225A00000XMusic Therapist
      225B00000XPulmonary Function Technologist
      225C00000XRehabilitation Counselor
      225X00000XOccupational Therapist
      226000000XRecreational Therapist Assistant
      226300000XKinesiotherapist
      227800000XRespiratory Therapist, Certified
      227900000XRespiratory Therapist, Registered
      229N00000XAnaplastologist
      231H00000XAudiologist
      235500000XSpecialist/Technologist
      235Z00000XSpeech-Language Pathologist
      237600000XAudiologist-Hearing Aid Fitter
      237700000XHearing Instrument Specialist
      242T00000XPerfusionist
      243U00000XRadiology Practitioner Assistant
      246Q00000XSpecialist/Technologist, Pathology
      246R00000XTechnician, Pathology
      246W00000XTechnician, Cardiology
      246X00000XSpecialist/Technologist Cardiovascular
      246Y00000XSpecialist/Technologist, Health Information
      246Z00000XSpecialist/Technologist, Other
      247000000XTechnician, Health Information
      247100000XRadiologic Technologist
      247200000XTechnician, Other
      251300000XLocal Education Agency (LEA)
      251B00000XCase Management
      251C00000XDay Training, Developmentally Disabled Services
      251E00000XHome Health
      251F00000XHome Infusion
      251G00000XHospice Care, Community Based
      251J00000XNursing Care
      251K00000XPublic Health or Welfare
      251S00000XCommunity/Behavioral Health
      251T00000XProgram of All-Inclusive Care for the Elderly (PACE) Provider Organization
      251V00000XVoluntary or Charitable
      251X00000XSupports Brokerage
      252Y00000XEarly Intervention Provider Agency
      253J00000XFoster Care Agency
      253Z00000XIn Home Supportive Care
      261Q00000XClinic/Center
      273100000XEpilepsy Unit
      273R00000XPsychiatric Unit
      273Y00000XRehabilitation Unit
      275N00000XMedicare Defined Swing Bed Unit
      276400000XRehabilitation, Substance Use Disorder Unit
      281P00000XChronic Disease Hospital
      282E00000XLong Term Care Hospital
      282J00000XReligious Nonmedical Health Care Institution
      282N00000XGeneral Acute Care Hospital
      283Q00000XPsychiatric Hospital
      283X00000XRehabilitation Hospital
      284300000XSpecial Hospital
      286500000XMilitary Hospital
      287300000XChristian Science Sanitorium
      291900000XMilitary Clinical Medical Laboratory
      291U00000XClinical Medical Laboratory
      292200000XDental Laboratory
      293D00000XPhysiological Laboratory
      302F00000XExclusive Provider Organization
      302R00000XHealth Maintenance Organization
      305R00000XPreferred Provider Organization
      305S00000XPoint of Service
      310400000XAssisted Living Facility
      310500000XIntermediate Care Facility, Mental Illness
      311500000XAlzheimer Center (Dementia Center)
      311Z00000XCustodial Care Facility
      313M00000XNursing Facility/Intermediate Care Facility
      314000000XSkilled Nursing Facility
      315D00000XHospice, Inpatient
      315P00000XIntermediate Care Facility, Mentally Retarded
      317400000XChristian Science Facility
      320600000XResidential Treatment Facility, Mental Retardation and/or Developmental Disabilities
      320700000XResidential Treatment Facility, Physical Disabilities
      320800000XCommunity Based Residential Treatment Facility, Mental Illness
      320900000XCommunity Based Residential Treatment Facility, Mental Retardation and/or Developmental Disabilities
      322D00000XResidential Treatment Facility, Emotionally Disturbed Children
      323P00000XPsychiatric Residential Treatment Facility
      324500000XSubstance Abuse Rehabilitation Facility
      331L00000XBlood Bank
      332000000XMilitary/U.S. Coast Guard Pharmacy
      332100000XDepartment of Veterans Affairs (VA) Pharmacy
      332800000XIndian Health Service/Tribal/Urban Indian Health (I/T/U) Pharmacy
      332900000XNon-Pharmacy Dispensing Site
      332B00000XDurable Medical Equipment & Medical Supplies
      332G00000XEye Bank
      332H00000XEyewear Supplier
      332S00000XHearing Aid Equipment
      332U00000XHome Delivered Meals
      333300000XEmergency Response System Companies
      333600000XPharmacy
      335E00000XProsthetic/Orthotic Supplier
      335G00000XMedical Foods Supplier
      335U00000XOrgan Procurement Organization
      335V00000XPortable X-ray and/or Other Portable Diagnostic Imaging Supplier
      341600000XAmbulance
      341800000XMilitary/U.S. Coast Guard Transport
      343800000XSecured Medical Transport (VAN)
      343900000XNon-emergency Medical Transport (VAN)
      344600000XTaxi
      344800000XAir Carrier
      347B00000XBus
      347C00000XPrivate Vehicle
      347D00000XTrain
      347E00000XTransportation Broker
      363A00000XPhysician Assistant
      363L00000XNurse Practitioner
      364S00000XClinical Nurse Specialist
      367500000XNurse Anesthetist, Certified Registered
      367A00000XAdvanced Practice Midwife
      367H00000XAnesthesiologist Assistant
      372500000XChore Provider
      372600000XAdult Companion
      373H00000XDay Training/Habilitation Specialist
      374700000XTechnician
      374J00000XDoula
      374K00000XReligious Nonmedical Practitioner
      374T00000XReligious Nonmedical Nursing Personnel
      374U00000XHome Health Aide
      376G00000XNursing Home Administrator
      376J00000XHomemaker
      376K00000XNurse's Aide
      385H00000XRespite Care
      390200000XStudent in an Organized Health Care Education/Training Program
      405300000XPrevention Professional
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-provider-role","version":"3.1.0","name":"USCoreProviderRoleNucc","title":"US Core Provider Role (NUCC)","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"Provider roles codes which are composed of the NUCC Health Care Provider Taxonomy Code Set classification codes for providers. Only concepts with a classification and no specialization are included. ","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"This value set includes content from NUCC Health Care Provider Taxonomy Code Set for providers which is copyright © 2016+ American Medical Association. For commercial use, including sales or licensing, a license must be obtained.","compose":{"include":[{"system":"http://nucc.org/provider-taxonomy","concept":[{"code":"101Y00000X","display":"Counselor"},{"code":"102L00000X","display":"Psychoanalyst"},{"code":"102X00000X","display":"Poetry Therapist"},{"code":"103G00000X","display":"Clinical Neuropsychologist"},{"code":"103K00000X","display":"Behavior Analyst"},{"code":"103T00000X","display":"Psychologist"},{"code":"104100000X","display":"Social Worker"},{"code":"106E00000X","display":"Assistant Behavior Analyst"},{"code":"106H00000X","display":"Marriage & Family Therapist"},{"code":"106S00000X","display":"Behavior Technician"},{"code":"111N00000X","display":"Chiropractor"},{"code":"122300000X","display":"Dentist"},{"code":"122400000X","display":"Denturist"},{"code":"124Q00000X","display":"Dental Hygienist"},{"code":"125J00000X","display":"Dental Therapist"},{"code":"125K00000X","display":"Advanced Practice Dental Therapist"},{"code":"125Q00000X","display":"Oral Medicinist"},{"code":"126800000X","display":"Dental Assistant"},{"code":"126900000X","display":"Dental Laboratory Technician"},{"code":"132700000X","display":"Dietary Manager"},{"code":"133N00000X","display":"Nutritionist"},{"code":"133V00000X","display":"Dietitian, Registered"},{"code":"136A00000X","display":"Dietetic Technician, Registered"},{"code":"146D00000X","display":"Personal Emergency Response Attendant"},{"code":"146L00000X","display":"Emergency Medical Technician, Paramedic"},{"code":"146M00000X","display":"Emergency Medical Technician, Intermediate"},{"code":"146N00000X","display":"Emergency Medical Technician, Basic"},{"code":"152W00000X","display":"Optometrist"},{"code":"156F00000X","display":"Technician/Technologist"},{"code":"163W00000X","display":"Registered Nurse"},{"code":"164W00000X","display":"Licensed Practical Nurse"},{"code":"164X00000X","display":"Licensed Vocational Nurse"},{"code":"167G00000X","display":"Licensed Psychiatric Technician"},{"code":"170100000X","display":"Medical Genetics, Ph.D. Medical Genetics"},{"code":"170300000X","display":"Genetic Counselor, MS"},{"code":"171000000X","display":"Military Health Care Provider"},{"code":"171100000X","display":"Acupuncturist"},{"code":"171M00000X","display":"Case Manager/Care Coordinator"},{"code":"171R00000X","display":"Interpreter"},{"code":"171W00000X","display":"Contractor"},{"code":"172A00000X","display":"Driver"},{"code":"172M00000X","display":"Mechanotherapist"},{"code":"172P00000X","display":"Naprapath"},{"code":"172V00000X","display":"Community Health Worker"},{"code":"173000000X","display":"Legal Medicine"},{"code":"173C00000X","display":"Reflexologist"},{"code":"173F00000X","display":"Sleep Specialist, PhD"},{"code":"174200000X","display":"Meals"},{"code":"174400000X","display":"Specialist"},{"code":"174H00000X","display":"Health Educator"},{"code":"174M00000X","display":"Veterinarian"},{"code":"174N00000X","display":"Lactation Consultant, Non-RN"},{"code":"174V00000X","display":"Clinical Ethicist"},{"code":"175F00000X","display":"Naturopath"},{"code":"175L00000X","display":"Homeopath"},{"code":"175M00000X","display":"Midwife, Lay"},{"code":"175T00000X","display":"Peer Specialist"},{"code":"176B00000X","display":"Midwife"},{"code":"176P00000X","display":"Funeral Director"},{"code":"177F00000X","display":"Lodging"},{"code":"183500000X","display":"Pharmacist"},{"code":"183700000X","display":"Pharmacy Technician"},{"code":"193200000X","display":"Multi-Specialty"},{"code":"193400000X","display":"Single Specialty"},{"code":"202C00000X","display":"Independent Medical Examiner"},{"code":"202K00000X","display":"Phlebology"},{"code":"204C00000X","display":"Neuromusculoskeletal Medicine, Sports Medicine"},{"code":"204D00000X","display":"Neuromusculoskeletal Medicine & OMM"},{"code":"204E00000X","display":"Oral & Maxillofacial Surgery"},{"code":"204F00000X","display":"Transplant Surgery"},{"code":"204R00000X","display":"Electrodiagnostic Medicine"},{"code":"207K00000X","display":"Allergy & Immunology"},{"code":"207L00000X","display":"Anesthesiology"},{"code":"207N00000X","display":"Dermatology"},{"code":"207P00000X","display":"Emergency Medicine"},{"code":"207Q00000X","display":"Family Medicine"},{"code":"207R00000X","display":"Internal Medicine"},{"code":"207T00000X","display":"Neurological Surgery"},{"code":"207U00000X","display":"Nuclear Medicine"},{"code":"207V00000X","display":"Obstetrics & Gynecology"},{"code":"207W00000X","display":"Ophthalmology"},{"code":"207X00000X","display":"Orthopaedic Surgery"},{"code":"207Y00000X","display":"Otolaryngology"},{"code":"208000000X","display":"Pediatrics"},{"code":"208100000X","display":"Physical Medicine & Rehabilitation"},{"code":"208200000X","display":"Plastic Surgery"},{"code":"208600000X","display":"Surgery"},{"code":"208800000X","display":"Urology"},{"code":"208C00000X","display":"Colon & Rectal Surgery"},{"code":"208D00000X","display":"General Practice"},{"code":"208G00000X","display":"Thoracic Surgery (Cardiothoracic Vascular Surgery)"},{"code":"208M00000X","display":"Hospitalist"},{"code":"208U00000X","display":"Clinical Pharmacology"},{"code":"209800000X","display":"Legal Medicine"},{"code":"211D00000X","display":"Assistant, Podiatric"},{"code":"213E00000X","display":"Podiatrist"},{"code":"221700000X","display":"Art Therapist"},{"code":"222Q00000X","display":"Developmental Therapist"},{"code":"222Z00000X","display":"Orthotist"},{"code":"224900000X","display":"Mastectomy Fitter"},{"code":"224L00000X","display":"Pedorthist"},{"code":"224P00000X","display":"Prosthetist"},{"code":"224Y00000X","display":"Clinical Exercise Physiologist"},{"code":"224Z00000X","display":"Occupational Therapy Assistant"},{"code":"225000000X","display":"Orthotic Fitter"},{"code":"225100000X","display":"Physical Therapist"},{"code":"225200000X","display":"Physical Therapy Assistant"},{"code":"225400000X","display":"Rehabilitation Practitioner"},{"code":"225500000X","display":"Specialist/Technologist"},{"code":"225600000X","display":"Dance Therapist"},{"code":"225700000X","display":"Massage Therapist"},{"code":"225800000X","display":"Recreation Therapist"},{"code":"225A00000X","display":"Music Therapist"},{"code":"225B00000X","display":"Pulmonary Function Technologist"},{"code":"225C00000X","display":"Rehabilitation Counselor"},{"code":"225X00000X","display":"Occupational Therapist"},{"code":"226000000X","display":"Recreational Therapist Assistant"},{"code":"226300000X","display":"Kinesiotherapist"},{"code":"227800000X","display":"Respiratory Therapist, Certified"},{"code":"227900000X","display":"Respiratory Therapist, Registered"},{"code":"229N00000X","display":"Anaplastologist"},{"code":"231H00000X","display":"Audiologist"},{"code":"235500000X","display":"Specialist/Technologist"},{"code":"235Z00000X","display":"Speech-Language Pathologist"},{"code":"237600000X","display":"Audiologist-Hearing Aid Fitter"},{"code":"237700000X","display":"Hearing Instrument Specialist"},{"code":"242T00000X","display":"Perfusionist"},{"code":"243U00000X","display":"Radiology Practitioner Assistant"},{"code":"246Q00000X","display":"Specialist/Technologist, Pathology"},{"code":"246R00000X","display":"Technician, Pathology"},{"code":"246W00000X","display":"Technician, Cardiology"},{"code":"246X00000X","display":"Specialist/Technologist Cardiovascular"},{"code":"246Y00000X","display":"Specialist/Technologist, Health Information"},{"code":"246Z00000X","display":"Specialist/Technologist, Other"},{"code":"247000000X","display":"Technician, Health Information"},{"code":"247100000X","display":"Radiologic Technologist"},{"code":"247200000X","display":"Technician, Other"},{"code":"251300000X","display":"Local Education Agency (LEA)"},{"code":"251B00000X","display":"Case Management"},{"code":"251C00000X","display":"Day Training, Developmentally Disabled Services"},{"code":"251E00000X","display":"Home Health"},{"code":"251F00000X","display":"Home Infusion"},{"code":"251G00000X","display":"Hospice Care, Community Based"},{"code":"251J00000X","display":"Nursing Care"},{"code":"251K00000X","display":"Public Health or Welfare"},{"code":"251S00000X","display":"Community/Behavioral Health"},{"code":"251T00000X","display":"Program of All-Inclusive Care for the Elderly (PACE) Provider Organization"},{"code":"251V00000X","display":"Voluntary or Charitable"},{"code":"251X00000X","display":"Supports Brokerage"},{"code":"252Y00000X","display":"Early Intervention Provider Agency"},{"code":"253J00000X","display":"Foster Care Agency"},{"code":"253Z00000X","display":"In Home Supportive Care"},{"code":"261Q00000X","display":"Clinic/Center"},{"code":"273100000X","display":"Epilepsy Unit"},{"code":"273R00000X","display":"Psychiatric Unit"},{"code":"273Y00000X","display":"Rehabilitation Unit"},{"code":"275N00000X","display":"Medicare Defined Swing Bed Unit"},{"code":"276400000X","display":"Rehabilitation, Substance Use Disorder Unit"},{"code":"281P00000X","display":"Chronic Disease Hospital"},{"code":"282E00000X","display":"Long Term Care Hospital"},{"code":"282J00000X","display":"Religious Nonmedical Health Care Institution"},{"code":"282N00000X","display":"General Acute Care Hospital"},{"code":"283Q00000X","display":"Psychiatric Hospital"},{"code":"283X00000X","display":"Rehabilitation Hospital"},{"code":"284300000X","display":"Special Hospital"},{"code":"286500000X","display":"Military Hospital"},{"code":"287300000X","display":"Christian Science Sanitorium"},{"code":"291900000X","display":"Military Clinical Medical Laboratory"},{"code":"291U00000X","display":"Clinical Medical Laboratory"},{"code":"292200000X","display":"Dental Laboratory"},{"code":"293D00000X","display":"Physiological Laboratory"},{"code":"302F00000X","display":"Exclusive Provider Organization"},{"code":"302R00000X","display":"Health Maintenance Organization"},{"code":"305R00000X","display":"Preferred Provider Organization"},{"code":"305S00000X","display":"Point of Service"},{"code":"310400000X","display":"Assisted Living Facility"},{"code":"310500000X","display":"Intermediate Care Facility, Mental Illness"},{"code":"311500000X","display":"Alzheimer Center (Dementia Center)"},{"code":"311Z00000X","display":"Custodial Care Facility"},{"code":"313M00000X","display":"Nursing Facility/Intermediate Care Facility"},{"code":"314000000X","display":"Skilled Nursing Facility"},{"code":"315D00000X","display":"Hospice, Inpatient"},{"code":"315P00000X","display":"Intermediate Care Facility, Mentally Retarded"},{"code":"317400000X","display":"Christian Science Facility"},{"code":"320600000X","display":"Residential Treatment Facility, Mental Retardation and/or Developmental Disabilities"},{"code":"320700000X","display":"Residential Treatment Facility, Physical Disabilities"},{"code":"320800000X","display":"Community Based Residential Treatment Facility, Mental Illness"},{"code":"320900000X","display":"Community Based Residential Treatment Facility, Mental Retardation and/or Developmental Disabilities"},{"code":"322D00000X","display":"Residential Treatment Facility, Emotionally Disturbed Children"},{"code":"323P00000X","display":"Psychiatric Residential Treatment Facility"},{"code":"324500000X","display":"Substance Abuse Rehabilitation Facility"},{"code":"331L00000X","display":"Blood Bank"},{"code":"332000000X","display":"Military/U.S. Coast Guard Pharmacy"},{"code":"332100000X","display":"Department of Veterans Affairs (VA) Pharmacy"},{"code":"332800000X","display":"Indian Health Service/Tribal/Urban Indian Health (I/T/U) Pharmacy"},{"code":"332900000X","display":"Non-Pharmacy Dispensing Site"},{"code":"332B00000X","display":"Durable Medical Equipment & Medical Supplies"},{"code":"332G00000X","display":"Eye Bank"},{"code":"332H00000X","display":"Eyewear Supplier"},{"code":"332S00000X","display":"Hearing Aid Equipment"},{"code":"332U00000X","display":"Home Delivered Meals"},{"code":"333300000X","display":"Emergency Response System Companies"},{"code":"333600000X","display":"Pharmacy"},{"code":"335E00000X","display":"Prosthetic/Orthotic Supplier"},{"code":"335G00000X","display":"Medical Foods Supplier"},{"code":"335U00000X","display":"Organ Procurement Organization"},{"code":"335V00000X","display":"Portable X-ray and/or Other Portable Diagnostic Imaging Supplier"},{"code":"341600000X","display":"Ambulance"},{"code":"341800000X","display":"Military/U.S. Coast Guard Transport"},{"code":"343800000X","display":"Secured Medical Transport (VAN)"},{"code":"343900000X","display":"Non-emergency Medical Transport (VAN)"},{"code":"344600000X","display":"Taxi"},{"code":"344800000X","display":"Air Carrier"},{"code":"347B00000X","display":"Bus"},{"code":"347C00000X","display":"Private Vehicle"},{"code":"347D00000X","display":"Train"},{"code":"347E00000X","display":"Transportation Broker"},{"code":"363A00000X","display":"Physician Assistant"},{"code":"363L00000X","display":"Nurse Practitioner"},{"code":"364S00000X","display":"Clinical Nurse Specialist"},{"code":"367500000X","display":"Nurse Anesthetist, Certified Registered"},{"code":"367A00000X","display":"Advanced Practice Midwife"},{"code":"367H00000X","display":"Anesthesiologist Assistant"},{"code":"372500000X","display":"Chore Provider"},{"code":"372600000X","display":"Adult Companion"},{"code":"373H00000X","display":"Day Training/Habilitation Specialist"},{"code":"374700000X","display":"Technician"},{"code":"374J00000X","display":"Doula"},{"code":"374K00000X","display":"Religious Nonmedical Practitioner"},{"code":"374T00000X","display":"Religious Nonmedical Nursing Personnel"},{"code":"374U00000X","display":"Home Health Aide"},{"code":"376G00000X","display":"Nursing Home Administrator"},{"code":"376J00000X","display":"Homemaker"},{"code":"376K00000X","display":"Nurse's Aide"},{"code":"385H00000X","display":"Respite Care"},{"code":"390200000X","display":"Student in an Organized Health Care Education/Training Program"},{"code":"405300000X","display":"Prevention Professional"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-provider-specialty.json b/resources/uscore_v3.1.0/ValueSet-us-core-provider-specialty.json new file mode 100755 index 000000000..fb5432cc2 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-provider-specialty.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-provider-specialty","text":{"status":"generated","div":"

    US Core Provider Speciality (NUCC)

    Provider speciality roles codes which are composed of the NUCC Health Care Provider Taxonomy Code Set for providers

    \n

    Copyright Statement: This value set includes content from NUCC Health Care Provider Taxonomy Code Set for providers which is copyright © 2016+ American Medical Association. For commercial use, including sales or licensing, a license must be obtained.

    This value set includes codes from the following code systems:

    • Include all codes defined in http://nucc.org/provider-taxonomy
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-provider-specialty","version":"3.1.0","name":"USCoreProviderSpecialityNucc","title":"US Core Provider Speciality (NUCC)","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"Provider speciality roles codes which are composed of the NUCC Health Care Provider Taxonomy Code Set for providers","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"This value set includes content from NUCC Health Care Provider Taxonomy Code Set for providers which is copyright © 2016+ American Medical Association. For commercial use, including sales or licensing, a license must be obtained.","compose":{"include":[{"system":"http://nucc.org/provider-taxonomy"}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-smoking-status-observation-codes.json b/resources/uscore_v3.1.0/ValueSet-us-core-smoking-status-observation-codes.json new file mode 100755 index 000000000..a0df32888 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-smoking-status-observation-codes.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-smoking-status-observation-codes","text":{"status":"generated","div":"

    US Core Smoking Status Observation Codes

    The US Core Smoking Status Observation Codes Value Set is a 'starter set' of concepts to capture smoking status.

    \n

    This value set includes codes from the following code systems:

    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-smoking-status-observation-codes","version":"3.1.0","name":"USCoreSmokingStatusObservationCodes","title":"US Core Smoking Status Observation Codes","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"The US Core Smoking Status Observation Codes Value Set is a 'starter set' of concepts to capture smoking status.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"http://loinc.org","concept":[{"code":"72166-2","display":"Tobacco smoking status NHIS"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-usps-state.json b/resources/uscore_v3.1.0/ValueSet-us-core-usps-state.json new file mode 100755 index 000000000..6fe42ea8f --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-usps-state.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-usps-state","text":{"status":"generated","div":"

    USPS Two Letter Alphabetic Codes

    This value set defines two letter USPS alphabetic codes.

    \n

    Copyright Statement: On July 1, 1963, the Post Office Department implemented the five-digit ZIP Code, which was placed after the state name in the last line of an address. To provide room for the ZIP Code, the Department issued two-letter abbreviations for all states and territories. Publication 59, Abbreviations for Use with ZIP Code, issued by the Department in October 1963. Currently there is no copyright restriction on this value set.

    This value set includes codes from the following code systems:

    • Include these codes as defined in https://www.usps.com/
      CodeDisplay
      AKAlaska
      ALAlabama
      ARArkansas
      ASAmerican Samoa
      AZArizona
      CACalifornia
      COColorado
      CTConnecticut
      DCDistrict of Columbia
      DEDelaware
      FLFlorida
      FMFederated States of Micronesia
      GAGeorgia
      GUGuam
      HIHawaii
      IAIowa
      IDIdaho
      ILIllinois
      INIndiana
      KSKansas
      KYKentucky
      LALouisiana
      MAMassachusetts
      MDMaryland
      MEMaine
      MHMarshall Islands
      MIMichigan
      MNMinnesota
      MOMissouri
      MPNorthern Mariana Islands
      MSMississippi
      MTMontana
      NCNorth Carolina
      NDNorth Dakota
      NENebraska
      NHNew Hampshire
      NJNew Jersey
      NMNew Mexico
      NVNevada
      NYNew York
      OHOhio
      OKOklahoma
      OROregon
      PAPennsylvania
      PRPuerto Rico
      PWPalau
      RIRhode Island
      SCSouth Carolina
      SDSouth Dakota
      TNTennessee
      TXTexas
      UMU.S. Minor Outlying Islands
      UTUtah
      VAVirginia
      VIVirgin Islands of the U.S.
      VTVermont
      WAWashington
      WIWisconsin
      WVWest Virginia
      WYWyoming
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-usps-state","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113883.4.642.3.40"}],"version":"3.1.0","name":"UspsTwoLetterAlphabeticCodes","title":"USPS Two Letter Alphabetic Codes","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"This value set defines two letter USPS alphabetic codes.","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"On July 1, 1963, the Post Office Department implemented the five-digit ZIP Code, which was placed after the state name in the last line of an address. To provide room for the ZIP Code, the Department issued two-letter abbreviations for all states and territories. Publication 59, Abbreviations for Use with ZIP Code, issued by the Department in October 1963. Currently there is no copyright restriction on this value set.","compose":{"include":[{"system":"https://www.usps.com/","concept":[{"code":"AK","display":"Alaska"},{"code":"AL","display":"Alabama"},{"code":"AR","display":"Arkansas"},{"code":"AS","display":"American Samoa"},{"code":"AZ","display":"Arizona"},{"code":"CA","display":"California"},{"code":"CO","display":"Colorado"},{"code":"CT","display":"Connecticut"},{"code":"DC","display":"District of Columbia"},{"code":"DE","display":"Delaware"},{"code":"FL","display":"Florida"},{"code":"FM","display":"Federated States of Micronesia"},{"code":"GA","display":"Georgia"},{"code":"GU","display":"Guam"},{"code":"HI","display":"Hawaii"},{"code":"IA","display":"Iowa"},{"code":"ID","display":"Idaho"},{"code":"IL","display":"Illinois"},{"code":"IN","display":"Indiana"},{"code":"KS","display":"Kansas"},{"code":"KY","display":"Kentucky"},{"code":"LA","display":"Louisiana"},{"code":"MA","display":"Massachusetts"},{"code":"MD","display":"Maryland"},{"code":"ME","display":"Maine"},{"code":"MH","display":"Marshall Islands"},{"code":"MI","display":"Michigan"},{"code":"MN","display":"Minnesota"},{"code":"MO","display":"Missouri"},{"code":"MP","display":"Northern Mariana Islands"},{"code":"MS","display":"Mississippi"},{"code":"MT","display":"Montana"},{"code":"NC","display":"North Carolina"},{"code":"ND","display":"North Dakota"},{"code":"NE","display":"Nebraska"},{"code":"NH","display":"New Hampshire"},{"code":"NJ","display":"New Jersey"},{"code":"NM","display":"New Mexico"},{"code":"NV","display":"Nevada"},{"code":"NY","display":"New York"},{"code":"OH","display":"Ohio"},{"code":"OK","display":"Oklahoma"},{"code":"OR","display":"Oregon"},{"code":"PA","display":"Pennsylvania"},{"code":"PR","display":"Puerto Rico"},{"code":"PW","display":"Palau"},{"code":"RI","display":"Rhode Island"},{"code":"SC","display":"South Carolina"},{"code":"SD","display":"South Dakota"},{"code":"TN","display":"Tennessee"},{"code":"TX","display":"Texas"},{"code":"UM","display":"U.S. Minor Outlying Islands"},{"code":"UT","display":"Utah"},{"code":"VA","display":"Virginia"},{"code":"VI","display":"Virgin Islands of the U.S."},{"code":"VT","display":"Vermont"},{"code":"WA","display":"Washington"},{"code":"WI","display":"Wisconsin"},{"code":"WV","display":"West Virginia"},{"code":"WY","display":"Wyoming"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ValueSet-us-core-vaccines-cvx.json b/resources/uscore_v3.1.0/ValueSet-us-core-vaccines-cvx.json new file mode 100755 index 000000000..c456cfc07 --- /dev/null +++ b/resources/uscore_v3.1.0/ValueSet-us-core-vaccines-cvx.json @@ -0,0 +1 @@ +{"resourceType":"ValueSet","id":"us-core-vaccines-cvx","text":{"status":"generated","div":"

    US Core Vaccine Administered Value Set (CVX)

    This identifies the vaccine substance administered - CVX codes. Inclusion Criteria: Any CVX code with CVX 'status' (VSAC Property) = Active,Inactive, Non-US except those noted in exclusions. Exclusion Criteria: CVX codes that have a CVX 'status' of either Pending or Never Active AND CVX codes with CVX 'Nonvaccine' property = True. Available at http://www2a.cdc.gov/vaccines/iis/iisstandards/vaccines.asp?rpt=cvx

    \n

    This value set includes codes from the following code systems:

    • Include these codes as defined in http://hl7.org/fhir/sid/cvx
      CodeDisplay
      01diphtheria, tetanus toxoids and pertussis vaccine
      02trivalent poliovirus vaccine, live, oral
      03measles, mumps and rubella virus vaccine
      04measles and rubella virus vaccine
      05measles virus vaccine
      06rubella virus vaccine
      07mumps virus vaccine
      08hepatitis B vaccine, pediatric or pediatric/adolescent dosage
      09tetanus and diphtheria toxoids, adsorbed, preservative free, for adult use (2 Lf of tetanus toxoid and 2 Lf of diphtheria toxoid)
      10poliovirus vaccine, inactivated
      100pneumococcal conjugate vaccine, 7 valent
      101typhoid Vi capsular polysaccharide vaccine
      102DTP- Haemophilus influenzae type b conjugate and hepatitis b vaccine
      103meningococcal C conjugate vaccine
      104hepatitis A and hepatitis B vaccine
      105vaccinia (smallpox) vaccine, diluted
      106diphtheria, tetanus toxoids and acellular pertussis vaccine, 5 pertussis antigens
      107diphtheria, tetanus toxoids and acellular pertussis vaccine, unspecified formulation
      108meningococcal ACWY vaccine, unspecified formulation
      109pneumococcal vaccine, unspecified formulation
      11pertussis vaccine
      110DTaP-hepatitis B and poliovirus vaccine
      111influenza virus vaccine, live, attenuated, for intranasal use
      112tetanus toxoid, unspecified formulation
      113tetanus and diphtheria toxoids, adsorbed, preservative free, for adult use (5 Lf of tetanus toxoid and 2 Lf of diphtheria toxoid)
      114meningococcal polysaccharide (groups A, C, Y and W-135) diphtheria toxoid conjugate vaccine (MCV4P)
      115tetanus toxoid, reduced diphtheria toxoid, and acellular pertussis vaccine, adsorbed
      116rotavirus, live, pentavalent vaccine
      117varicella zoster immune globulin (Investigational New Drug)
      118human papilloma virus vaccine, bivalent
      119rotavirus, live, monovalent vaccine
      12diphtheria antitoxin
      120diphtheria, tetanus toxoids and acellular pertussis vaccine, Haemophilus influenzae type b conjugate, and poliovirus vaccine, inactivated (DTaP-Hib-IPV)
      121zoster vaccine, live
      122rotavirus vaccine, unspecified formulation
      123influenza virus vaccine, H5N1, A/Vietnam/1203/2004 (national stockpile)
      125Novel Influenza-H1N1-09, live virus for nasal administration
      126Novel influenza-H1N1-09, preservative-free, injectable
      127Novel influenza-H1N1-09, injectable
      128Novel influenza-H1N1-09, all formulations
      129Japanese Encephalitis vaccine, unspecified formulation
      13tetanus immune globulin
      130Diphtheria, tetanus toxoids and acellular pertussis vaccine, and poliovirus vaccine, inactivated
      131Historical record of a typhus vaccination
      132Historical diphtheria and tetanus toxoids and acellular pertussis, poliovirus, Haemophilus b conjugate and hepatitis B (recombinant) vaccine.
      133pneumococcal conjugate vaccine, 13 valent
      134Japanese Encephalitis vaccine for intramuscular administration
      135influenza, high dose seasonal, preservative-free
      136meningococcal oligosaccharide (groups A, C, Y and W-135) diphtheria toxoid conjugate vaccine (MCV4O)
      137HPV, unspecified formulation
      138tetanus and diphtheria toxoids, not adsorbed, for adult use
      139Td(adult) unspecified formulation
      14immune globulin, unspecified formulation
      140Influenza, seasonal, injectable, preservative free
      141Influenza, seasonal, injectable
      142tetanus toxoid, not adsorbed
      143Adenovirus, type 4 and type 7, live, oral
      144seasonal influenza, intradermal, preservative free
      147Meningococcal, MCV4, unspecified conjugate formulation(groups A, C, Y and W-135)
      148Meningococcal Groups C and Y and Haemophilus b Tetanus Toxoid Conjugate Vaccine
      149influenza, live, intranasal, quadrivalent
      15influenza virus vaccine, split virus (incl. purified surface antigen)-retired CODE
      150Influenza, injectable, quadrivalent, preservative free
      151influenza nasal, unspecified formulation
      152Pneumococcal Conjugate, unspecified formulation
      153Influenza, injectable, Madin Darby Canine Kidney, preservative free
      155Seasonal, trivalent, recombinant, injectable influenza vaccine, preservative free
      156Rho(D) Immune globulin- IV or IM
      157Rho(D) Immune globulin - IM
      158influenza, injectable, quadrivalent, contains preservative
      159Rho(D) Unspecified formulation
      16influenza virus vaccine, whole virus
      160Influenza A monovalent (H5N1), adjuvanted, National stockpile 2013
      161Influenza, injectable,quadrivalent, preservative free, pediatric
      162meningococcal B vaccine, fully recombinant
      163meningococcal B vaccine, recombinant, OMV, adjuvanted
      164meningococcal B, unspecified formulation
      165Human Papillomavirus 9-valent vaccine
      166influenza, intradermal, quadrivalent, preservative free, injectable
      167meningococcal vaccine of unknown formulation and unknown serogroups
      168Seasonal trivalent influenza vaccine, adjuvanted, preservative free
      169Hep A, live attenuated-IM
      17Haemophilus influenzae type b vaccine, conjugate unspecified formulation
      170non-US diphtheria, tetanus toxoids and acellular pertussis vaccine, Haemophilus influenzae type b conjugate, and poliovirus vaccine, inactivated (DTaP-Hib-IPV)
      171Influenza, injectable, Madin Darby Canine Kidney, preservative free, quadrivalent
      172cholera, WC-rBS
      173cholera, BivWC
      174cholera, live attenuated
      175Human Rabies vaccine from human diploid cell culture
      176Human rabies vaccine from Chicken fibroblast culture
      177pneumococcal conjugate vaccine, 10 valent
      178Non-US bivalent oral polio vaccine (types 1 and 3)
      179Non-US monovalent oral polio vaccine, unspecified formulation
      18rabies vaccine, for intramuscular injection RETIRED CODE
      180tetanus immune globulin
      181anthrax immune globulin
      182Oral Polio Vaccine, Unspecified formulation
      183Yellow fever vaccine alternative formulation
      184Yellow fever vaccine, unspecified formulation
      185Seasonal, quadrivalent, recombinant, injectable influenza vaccine, preservative free
      186Influenza, injectable, Madin Darby Canine Kidney, quadrivalent with preservative
      187zoster vaccine recombinant
      188zoster vaccine, unspecified formulation
      189Hepatitis B vaccine (recombinant), CpG adjuvanted
      19Bacillus Calmette-Guerin vaccine
      20diphtheria, tetanus toxoids and acellular pertussis vaccine
      21varicella virus vaccine
      22DTP-Haemophilus influenzae type b conjugate vaccine
      23plague vaccine
      24anthrax vaccine
      25typhoid vaccine, live, oral
      26cholera vaccine, unspecified formulation
      27botulinum antitoxin
      28diphtheria and tetanus toxoids, adsorbed for pediatric use
      29cytomegalovirus immune globulin, intravenous
      30hepatitis B immune globulin
      31hepatitis A vaccine, pediatric dosage, unspecified formulation
      32meningococcal polysaccharide vaccine (MPSV4)
      33pneumococcal polysaccharide vaccine, 23 valent
      34rabies immune globulin
      35tetanus toxoid, adsorbed
      36varicella zoster immune globulin
      37yellow fever vaccine
      38rubella and mumps virus vaccine
      39Japanese Encephalitis Vaccine SC
      40rabies vaccine, for intradermal injection
      41typhoid vaccine, parenteral, other than acetone-killed, dried
      42hepatitis B vaccine, adolescent/high risk infant dosage
      43hepatitis B vaccine, adult dosage
      44hepatitis B vaccine, dialysis patient dosage
      45hepatitis B vaccine, unspecified formulation
      46Haemophilus influenzae type b vaccine, PRP-D conjugate
      47Haemophilus influenzae type b vaccine, HbOC conjugate
      48Haemophilus influenzae type b vaccine, PRP-T conjugate
      49Haemophilus influenzae type b vaccine, PRP-OMP conjugate
      50DTaP-Haemophilus influenzae type b conjugate vaccine
      51Haemophilus influenzae type b conjugate and Hepatitis B vaccine
      52hepatitis A vaccine, adult dosage
      53typhoid vaccine, parenteral, acetone-killed, dried (U.S. military)
      54adenovirus vaccine, type 4, live, oral
      55adenovirus vaccine, type 7, live, oral
      62human papilloma virus vaccine, quadrivalent
      66Lyme disease vaccine
      69parainfluenza-3 virus vaccine
      71respiratory syncytial virus immune globulin, intravenous
      74rotavirus, live, tetravalent vaccine
      75vaccinia (smallpox) vaccine
      76Staphylococcus bacteriophage lysate
      77tick-borne encephalitis vaccine
      78tularemia vaccine
      79vaccinia immune globulin
      80Venezuelan equine encephalitis, live, attenuated
      801AS03 Adjuvant
      81Venezuelan equine encephalitis, inactivated
      82adenovirus vaccine, unspecified formulation
      83hepatitis A vaccine, pediatric/adolescent dosage, 2 dose schedule
      84hepatitis A vaccine, pediatric/adolescent dosage, 3 dose schedule
      85hepatitis A vaccine, unspecified formulation
      86immune globulin, intramuscular
      87immune globulin, intravenous
      88influenza virus vaccine, unspecified formulation
      89poliovirus vaccine, unspecified formulation
      90rabies vaccine, unspecified formulation
      91typhoid vaccine, unspecified formulation
      92Venezuelan equine encephalitis vaccine, unspecified formulation
      93respiratory syncytial virus monoclonal antibody (palivizumab), intramuscular
      94measles, mumps, rubella, and varicella virus vaccine
      95tuberculin skin test; old tuberculin, multipuncture device
      96tuberculin skin test; purified protein derivative solution, intradermal
      97tuberculin skin test; purified protein derivative, multipuncture device
      98tuberculin skin test; unspecified formulation
      998no vaccine administered
    "},"url":"http://hl7.org/fhir/us/core/ValueSet/us-core-vaccines-cvx","identifier":[{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113762.1.4.1010.6"},{"system":"urn:ietf:rfc:3986","value":"urn:oid:2.16.840.1.113883.3.88.12.80.22"}],"version":"3.1.0","name":"USCoreVaccineAdministeredValueSetCvx","title":"US Core Vaccine Administered Value Set (CVX)","status":"active","date":"2019-05-21T00:00:00+10:00","publisher":"HL7 US Realm Steering Committee","contact":[{"telecom":[{"system":"other","value":"http://hl7.org/fhir"}]}],"description":"This identifies the vaccine substance administered - CVX codes. **Inclusion Criteria:** Any CVX code with CVX 'status' (VSAC Property) = `Active`,` Inactive`, `Non-US` except those noted in exclusions. **Exclusion Criteria:** CVX codes that have a CVX 'status' of either `Pending` or `Never Active` AND CVX codes with CVX 'Nonvaccine' property = True. Available at http://www2a.cdc.gov/vaccines/iis/iisstandards/vaccines.asp?rpt=cvx","jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"compose":{"include":[{"system":"http://hl7.org/fhir/sid/cvx","concept":[{"code":"01","display":"diphtheria, tetanus toxoids and pertussis vaccine"},{"code":"02","display":"trivalent poliovirus vaccine, live, oral"},{"code":"03","display":"measles, mumps and rubella virus vaccine"},{"code":"04","display":"measles and rubella virus vaccine"},{"code":"05","display":"measles virus vaccine"},{"code":"06","display":"rubella virus vaccine"},{"code":"07","display":"mumps virus vaccine"},{"code":"08","display":"hepatitis B vaccine, pediatric or pediatric/adolescent dosage"},{"code":"09","display":"tetanus and diphtheria toxoids, adsorbed, preservative free, for adult use (2 Lf of tetanus toxoid and 2 Lf of diphtheria toxoid)"},{"code":"10","display":"poliovirus vaccine, inactivated"},{"code":"100","display":"pneumococcal conjugate vaccine, 7 valent"},{"code":"101","display":"typhoid Vi capsular polysaccharide vaccine"},{"code":"102","display":"DTP- Haemophilus influenzae type b conjugate and hepatitis b vaccine"},{"code":"103","display":"meningococcal C conjugate vaccine"},{"code":"104","display":"hepatitis A and hepatitis B vaccine"},{"code":"105","display":"vaccinia (smallpox) vaccine, diluted"},{"code":"106","display":"diphtheria, tetanus toxoids and acellular pertussis vaccine, 5 pertussis antigens"},{"code":"107","display":"diphtheria, tetanus toxoids and acellular pertussis vaccine, unspecified formulation"},{"code":"108","display":"meningococcal ACWY vaccine, unspecified formulation"},{"code":"109","display":"pneumococcal vaccine, unspecified formulation"},{"code":"11","display":"pertussis vaccine"},{"code":"110","display":"DTaP-hepatitis B and poliovirus vaccine"},{"code":"111","display":"influenza virus vaccine, live, attenuated, for intranasal use"},{"code":"112","display":"tetanus toxoid, unspecified formulation"},{"code":"113","display":"tetanus and diphtheria toxoids, adsorbed, preservative free, for adult use (5 Lf of tetanus toxoid and 2 Lf of diphtheria toxoid)"},{"code":"114","display":"meningococcal polysaccharide (groups A, C, Y and W-135) diphtheria toxoid conjugate vaccine (MCV4P)"},{"code":"115","display":"tetanus toxoid, reduced diphtheria toxoid, and acellular pertussis vaccine, adsorbed"},{"code":"116","display":"rotavirus, live, pentavalent vaccine"},{"code":"117","display":"varicella zoster immune globulin (Investigational New Drug)"},{"code":"118","display":"human papilloma virus vaccine, bivalent"},{"code":"119","display":"rotavirus, live, monovalent vaccine"},{"code":"12","display":"diphtheria antitoxin"},{"code":"120","display":"diphtheria, tetanus toxoids and acellular pertussis vaccine, Haemophilus influenzae type b conjugate, and poliovirus vaccine, inactivated (DTaP-Hib-IPV)"},{"code":"121","display":"zoster vaccine, live"},{"code":"122","display":"rotavirus vaccine, unspecified formulation"},{"code":"123","display":"influenza virus vaccine, H5N1, A/Vietnam/1203/2004 (national stockpile)"},{"code":"125","display":"Novel Influenza-H1N1-09, live virus for nasal administration"},{"code":"126","display":"Novel influenza-H1N1-09, preservative-free, injectable"},{"code":"127","display":"Novel influenza-H1N1-09, injectable"},{"code":"128","display":"Novel influenza-H1N1-09, all formulations"},{"code":"129","display":"Japanese Encephalitis vaccine, unspecified formulation"},{"code":"13","display":"tetanus immune globulin"},{"code":"130","display":"Diphtheria, tetanus toxoids and acellular pertussis vaccine, and poliovirus vaccine, inactivated"},{"code":"131","display":"Historical record of a typhus vaccination"},{"code":"132","display":"Historical diphtheria and tetanus toxoids and acellular pertussis, poliovirus, Haemophilus b conjugate and hepatitis B (recombinant) vaccine."},{"code":"133","display":"pneumococcal conjugate vaccine, 13 valent"},{"code":"134","display":"Japanese Encephalitis vaccine for intramuscular administration"},{"code":"135","display":"influenza, high dose seasonal, preservative-free"},{"code":"136","display":"meningococcal oligosaccharide (groups A, C, Y and W-135) diphtheria toxoid conjugate vaccine (MCV4O)"},{"code":"137","display":"HPV, unspecified formulation"},{"code":"138","display":"tetanus and diphtheria toxoids, not adsorbed, for adult use"},{"code":"139","display":"Td(adult) unspecified formulation"},{"code":"14","display":"immune globulin, unspecified formulation"},{"code":"140","display":"Influenza, seasonal, injectable, preservative free"},{"code":"141","display":"Influenza, seasonal, injectable"},{"code":"142","display":"tetanus toxoid, not adsorbed"},{"code":"143","display":"Adenovirus, type 4 and type 7, live, oral"},{"code":"144","display":"seasonal influenza, intradermal, preservative free"},{"code":"147","display":"Meningococcal, MCV4, unspecified conjugate formulation(groups A, C, Y and W-135)"},{"code":"148","display":"Meningococcal Groups C and Y and Haemophilus b Tetanus Toxoid Conjugate Vaccine"},{"code":"149","display":"influenza, live, intranasal, quadrivalent"},{"code":"15","display":"influenza virus vaccine, split virus (incl. purified surface antigen)-retired CODE"},{"code":"150","display":"Influenza, injectable, quadrivalent, preservative free"},{"code":"151","display":"influenza nasal, unspecified formulation"},{"code":"152","display":"Pneumococcal Conjugate, unspecified formulation"},{"code":"153","display":"Influenza, injectable, Madin Darby Canine Kidney, preservative free"},{"code":"155","display":"Seasonal, trivalent, recombinant, injectable influenza vaccine, preservative free"},{"code":"156","display":"Rho(D) Immune globulin- IV or IM"},{"code":"157","display":"Rho(D) Immune globulin - IM"},{"code":"158","display":"influenza, injectable, quadrivalent, contains preservative"},{"code":"159","display":"Rho(D) Unspecified formulation"},{"code":"16","display":"influenza virus vaccine, whole virus"},{"code":"160","display":"Influenza A monovalent (H5N1), adjuvanted, National stockpile 2013"},{"code":"161","display":"Influenza, injectable,quadrivalent, preservative free, pediatric"},{"code":"162","display":"meningococcal B vaccine, fully recombinant"},{"code":"163","display":"meningococcal B vaccine, recombinant, OMV, adjuvanted"},{"code":"164","display":"meningococcal B, unspecified formulation"},{"code":"165","display":"Human Papillomavirus 9-valent vaccine"},{"code":"166","display":"influenza, intradermal, quadrivalent, preservative free, injectable"},{"code":"167","display":"meningococcal vaccine of unknown formulation and unknown serogroups"},{"code":"168","display":"Seasonal trivalent influenza vaccine, adjuvanted, preservative free"},{"code":"169","display":"Hep A, live attenuated-IM"},{"code":"17","display":"Haemophilus influenzae type b vaccine, conjugate unspecified formulation"},{"code":"170","display":"non-US diphtheria, tetanus toxoids and acellular pertussis vaccine, Haemophilus influenzae type b conjugate, and poliovirus vaccine, inactivated (DTaP-Hib-IPV)"},{"code":"171","display":"Influenza, injectable, Madin Darby Canine Kidney, preservative free, quadrivalent"},{"code":"172","display":"cholera, WC-rBS"},{"code":"173","display":"cholera, BivWC"},{"code":"174","display":"cholera, live attenuated"},{"code":"175","display":"Human Rabies vaccine from human diploid cell culture"},{"code":"176","display":"Human rabies vaccine from Chicken fibroblast culture"},{"code":"177","display":"pneumococcal conjugate vaccine, 10 valent"},{"code":"178","display":"Non-US bivalent oral polio vaccine (types 1 and 3)"},{"code":"179","display":"Non-US monovalent oral polio vaccine, unspecified formulation"},{"code":"18","display":"rabies vaccine, for intramuscular injection RETIRED CODE"},{"code":"180","display":"tetanus immune globulin"},{"code":"181","display":"anthrax immune globulin"},{"code":"182","display":"Oral Polio Vaccine, Unspecified formulation"},{"code":"183","display":"Yellow fever vaccine alternative formulation"},{"code":"184","display":"Yellow fever vaccine, unspecified formulation"},{"code":"185","display":"Seasonal, quadrivalent, recombinant, injectable influenza vaccine, preservative free"},{"code":"186","display":"Influenza, injectable, Madin Darby Canine Kidney, quadrivalent with preservative"},{"code":"187","display":"zoster vaccine recombinant"},{"code":"188","display":"zoster vaccine, unspecified formulation"},{"code":"189","display":"Hepatitis B vaccine (recombinant), CpG adjuvanted"},{"code":"19","display":"Bacillus Calmette-Guerin vaccine"},{"code":"20","display":"diphtheria, tetanus toxoids and acellular pertussis vaccine"},{"code":"21","display":"varicella virus vaccine"},{"code":"22","display":"DTP-Haemophilus influenzae type b conjugate vaccine"},{"code":"23","display":"plague vaccine"},{"code":"24","display":"anthrax vaccine"},{"code":"25","display":"typhoid vaccine, live, oral"},{"code":"26","display":"cholera vaccine, unspecified formulation"},{"code":"27","display":"botulinum antitoxin"},{"code":"28","display":"diphtheria and tetanus toxoids, adsorbed for pediatric use"},{"code":"29","display":"cytomegalovirus immune globulin, intravenous"},{"code":"30","display":"hepatitis B immune globulin"},{"code":"31","display":"hepatitis A vaccine, pediatric dosage, unspecified formulation"},{"code":"32","display":"meningococcal polysaccharide vaccine (MPSV4)"},{"code":"33","display":"pneumococcal polysaccharide vaccine, 23 valent"},{"code":"34","display":"rabies immune globulin"},{"code":"35","display":"tetanus toxoid, adsorbed"},{"code":"36","display":"varicella zoster immune globulin"},{"code":"37","display":"yellow fever vaccine"},{"code":"38","display":"rubella and mumps virus vaccine"},{"code":"39","display":"Japanese Encephalitis Vaccine SC"},{"code":"40","display":"rabies vaccine, for intradermal injection"},{"code":"41","display":"typhoid vaccine, parenteral, other than acetone-killed, dried"},{"code":"42","display":"hepatitis B vaccine, adolescent/high risk infant dosage"},{"code":"43","display":"hepatitis B vaccine, adult dosage"},{"code":"44","display":"hepatitis B vaccine, dialysis patient dosage"},{"code":"45","display":"hepatitis B vaccine, unspecified formulation"},{"code":"46","display":"Haemophilus influenzae type b vaccine, PRP-D conjugate"},{"code":"47","display":"Haemophilus influenzae type b vaccine, HbOC conjugate"},{"code":"48","display":"Haemophilus influenzae type b vaccine, PRP-T conjugate"},{"code":"49","display":"Haemophilus influenzae type b vaccine, PRP-OMP conjugate"},{"code":"50","display":"DTaP-Haemophilus influenzae type b conjugate vaccine"},{"code":"51","display":"Haemophilus influenzae type b conjugate and Hepatitis B vaccine"},{"code":"52","display":"hepatitis A vaccine, adult dosage"},{"code":"53","display":"typhoid vaccine, parenteral, acetone-killed, dried (U.S. military)"},{"code":"54","display":"adenovirus vaccine, type 4, live, oral"},{"code":"55","display":"adenovirus vaccine, type 7, live, oral"},{"code":"62","display":"human papilloma virus vaccine, quadrivalent"},{"code":"66","display":"Lyme disease vaccine"},{"code":"69","display":"parainfluenza-3 virus vaccine"},{"code":"71","display":"respiratory syncytial virus immune globulin, intravenous"},{"code":"74","display":"rotavirus, live, tetravalent vaccine"},{"code":"75","display":"vaccinia (smallpox) vaccine"},{"code":"76","display":"Staphylococcus bacteriophage lysate"},{"code":"77","display":"tick-borne encephalitis vaccine"},{"code":"78","display":"tularemia vaccine"},{"code":"79","display":"vaccinia immune globulin"},{"code":"80","display":"Venezuelan equine encephalitis, live, attenuated"},{"code":"801","display":"AS03 Adjuvant"},{"code":"81","display":"Venezuelan equine encephalitis, inactivated"},{"code":"82","display":"adenovirus vaccine, unspecified formulation"},{"code":"83","display":"hepatitis A vaccine, pediatric/adolescent dosage, 2 dose schedule"},{"code":"84","display":"hepatitis A vaccine, pediatric/adolescent dosage, 3 dose schedule"},{"code":"85","display":"hepatitis A vaccine, unspecified formulation"},{"code":"86","display":"immune globulin, intramuscular"},{"code":"87","display":"immune globulin, intravenous"},{"code":"88","display":"influenza virus vaccine, unspecified formulation"},{"code":"89","display":"poliovirus vaccine, unspecified formulation"},{"code":"90","display":"rabies vaccine, unspecified formulation"},{"code":"91","display":"typhoid vaccine, unspecified formulation"},{"code":"92","display":"Venezuelan equine encephalitis vaccine, unspecified formulation"},{"code":"93","display":"respiratory syncytial virus monoclonal antibody (palivizumab), intramuscular"},{"code":"94","display":"measles, mumps, rubella, and varicella virus vaccine"},{"code":"95","display":"tuberculin skin test; old tuberculin, multipuncture device"},{"code":"96","display":"tuberculin skin test; purified protein derivative solution, intradermal"},{"code":"97","display":"tuberculin skin test; purified protein derivative, multipuncture device"},{"code":"98","display":"tuberculin skin test; unspecified formulation"},{"code":"998","display":"no vaccine administered"}]}]}} \ No newline at end of file diff --git a/resources/uscore_v3.1.0/ig-r4.json b/resources/uscore_v3.1.0/ig-r4.json new file mode 100755 index 000000000..fcadb0a4f --- /dev/null +++ b/resources/uscore_v3.1.0/ig-r4.json @@ -0,0 +1 @@ +{"resourceType":"ImplementationGuide","id":"hl7.fhir.us.core","text":{"status":"generated","div":"

    USCore

    The official URL for this implementation guide is:

    http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core
    "},"url":"http://hl7.org/fhir/us/core/ImplementationGuide/hl7.fhir.us.core","version":"3.1.0","name":"USCore","title":"US Core","status":"active","date":"2019-11-06T13:08:22+11:00","publisher":"HL7 International - US Realm Steering Committee","contact":[{"telecom":[{"system":"url","value":"http://www.hl7.org/Special/committees/usrealm/index.cfm"}]}],"jurisdiction":[{"coding":[{"system":"urn:iso:std:iso:3166","code":"US","display":"United States of America"}]}],"copyright":"Used by permission of HL7 International, all rights reserved Creative Commons License","packageId":"hl7.fhir.us.core","license":"CC0-1.0","fhirVersion":["4.0.1"],"definition":{"grouping":[{"name":"base"}],"resource":[{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-glucose.html"}],"reference":{"reference":"Observation/urine-glucose"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Procedure"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Procedure-rehab.html"}],"reference":{"reference":"Procedure/rehab"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CareTeam"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CareTeam-example.html"}],"reference":{"reference":"CareTeam/example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-leukocyte-esterase.html"}],"reference":{"reference":"Observation/urine-leukocyte-esterase"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Bundle"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Bundle-66c8856b-ba11-4876-8aa8-467aad8c11a2.html"}],"reference":{"reference":"Bundle/66c8856b-ba11-4876-8aa8-467aad8c11a2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-bilirubin.html"}],"reference":{"reference":"Observation/urine-bilirubin"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Condition"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Condition-hc1.html"}],"reference":{"reference":"Condition/hc1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-sediment.html"}],"reference":{"reference":"Observation/urine-sediment"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Immunization"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Immunization-imm-1.html"}],"reference":{"reference":"Immunization/imm-1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-pediatric-wt-example.html"}],"reference":{"reference":"Observation/pediatric-wt-example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Organization"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Organization-saint-luke-w-endpoint.html"}],"reference":{"reference":"Organization/saint-luke-w-endpoint"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-ph.html"}],"reference":{"reference":"Observation/urine-ph"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Encounter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Encounter-example-1.html"}],"reference":{"reference":"Encounter/example-1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DiagnosticReport"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DiagnosticReport-chest-xray-report.html"}],"reference":{"reference":"DiagnosticReport/chest-xray-report"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-sodium.html"}],"reference":{"reference":"Observation/serum-sodium"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DiagnosticReport"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DiagnosticReport-cbc.html"}],"reference":{"reference":"DiagnosticReport/cbc"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-potassium.html"}],"reference":{"reference":"Observation/serum-potassium"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Encounter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Encounter-1036.html"}],"reference":{"reference":"Encounter/1036"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-some-day-smoker.html"}],"reference":{"reference":"Observation/some-day-smoker"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Location"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Location-hl7east.html"}],"reference":{"reference":"Location/hl7east"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-co2.html"}],"reference":{"reference":"Observation/serum-co2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-protein.html"}],"reference":{"reference":"Observation/urine-protein"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Procedure"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Procedure-defib-implant.html"}],"reference":{"reference":"Procedure/defib-implant"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-usg.html"}],"reference":{"reference":"Observation/usg"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-chloride.html"}],"reference":{"reference":"Observation/serum-chloride"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-calcium.html"}],"reference":{"reference":"Observation/serum-calcium"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-color.html"}],"reference":{"reference":"Observation/urine-color"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-bp-data-absent.html"}],"reference":{"reference":"Observation/bp-data-absent"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Patient"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Patient-example.html"}],"reference":{"reference":"Patient/example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-temperature.html"}],"reference":{"reference":"Observation/temperature"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-bmi.html"}],"reference":{"reference":"Observation/bmi"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Medication"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Medication-uscore-med2.html"}],"reference":{"reference":"Medication/uscore-med2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-cells.html"}],"reference":{"reference":"Observation/urine-cells"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-length.html"}],"reference":{"reference":"Observation/length"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Device"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Device-udi-2.html"}],"reference":{"reference":"Device/udi-2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"MedicationRequest"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"MedicationRequest-uscore-mo1.html"}],"reference":{"reference":"MedicationRequest/uscore-mo1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Practitioner"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Practitioner-practitioner-2.html"}],"reference":{"reference":"Practitioner/practitioner-2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Goal"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Goal-goal-1.html"}],"reference":{"reference":"Goal/goal-1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-rbcs.html"}],"reference":{"reference":"Observation/urine-rbcs"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urobilinogen.html"}],"reference":{"reference":"Observation/urobilinogen"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Medication"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Medication-uscore-med1.html"}],"reference":{"reference":"Medication/uscore-med1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-bacteria.html"}],"reference":{"reference":"Observation/urine-bacteria"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Bundle"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Bundle-uscore-mo3.html"}],"reference":{"reference":"Bundle/uscore-mo3"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-head-circumference.html"}],"reference":{"reference":"Observation/head-circumference"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"MedicationRequest"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"MedicationRequest-self-tylenol.html"}],"reference":{"reference":"MedicationRequest/self-tylenol"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DiagnosticReport"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DiagnosticReport-metabolic-panel.html"}],"reference":{"reference":"DiagnosticReport/metabolic-panel"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Device"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Device-udi-3.html"}],"reference":{"reference":"Device/udi-3"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"MedicationRequest"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"MedicationRequest-uscore-mo2.html"}],"reference":{"reference":"MedicationRequest/uscore-mo2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Bundle"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Bundle-c887e62f-6166-419f-8268-b5ecd6c7b901.html"}],"reference":{"reference":"Bundle/c887e62f-6166-419f-8268-b5ecd6c7b901"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-bun.html"}],"reference":{"reference":"Observation/bun"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Practitioner"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Practitioner-practitioner-1.html"}],"reference":{"reference":"Practitioner/practitioner-1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-neutrophils.html"}],"reference":{"reference":"Observation/neutrophils"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-nitrite.html"}],"reference":{"reference":"Observation/urine-nitrite"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-oxygen-saturation.html"}],"reference":{"reference":"Observation/oxygen-saturation"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DiagnosticReport"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DiagnosticReport-cardiology-report.html"}],"reference":{"reference":"DiagnosticReport/cardiology-report"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-vitals-panel.html"}],"reference":{"reference":"Observation/vitals-panel"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-blood-pressure.html"}],"reference":{"reference":"Observation/blood-pressure"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-wbcs.html"}],"reference":{"reference":"Observation/urine-wbcs"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-height.html"}],"reference":{"reference":"Observation/height"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Organization"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Organization-acme-lab.html"}],"reference":{"reference":"Organization/acme-lab"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Device"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Device-udi-1.html"}],"reference":{"reference":"Device/udi-1"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-hemoglobin.html"}],"reference":{"reference":"Observation/hemoglobin"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DocumentReference"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DocumentReference-episode-summary.html"}],"reference":{"reference":"DocumentReference/episode-summary"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-hemoglobin.html"}],"reference":{"reference":"Observation/urine-hemoglobin"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-heart-rate.html"}],"reference":{"reference":"Observation/heart-rate"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-epi-cells.html"}],"reference":{"reference":"Observation/urine-epi-cells"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"AllergyIntolerance"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"AllergyIntolerance-example.html"}],"reference":{"reference":"AllergyIntolerance/example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-blood-glucose.html"}],"reference":{"reference":"Observation/blood-glucose"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"DiagnosticReport"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"DiagnosticReport-urinalysis.html"}],"reference":{"reference":"DiagnosticReport/urinalysis"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Condition"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Condition-example.html"}],"reference":{"reference":"Condition/example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-creatinine.html"}],"reference":{"reference":"Observation/serum-creatinine"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-satO2-fiO2.html"}],"reference":{"reference":"Observation/satO2-fiO2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-serum-total-bilirubin.html"}],"reference":{"reference":"Observation/serum-total-bilirubin"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-pediatric-bmi-example.html"}],"reference":{"reference":"Observation/pediatric-bmi-example"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Organization"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Organization-example-organization-2.html"}],"reference":{"reference":"Organization/example-organization-2"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-weight.html"}],"reference":{"reference":"Observation/weight"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-mchc.html"}],"reference":{"reference":"Observation/mchc"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-clarity.html"}],"reference":{"reference":"Observation/urine-clarity"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CarePlan"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CarePlan-colonoscopy.html"}],"reference":{"reference":"CarePlan/colonoscopy"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-erythrocytes.html"}],"reference":{"reference":"Observation/erythrocytes"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-urine-ketone.html"}],"reference":{"reference":"Observation/urine-ketone"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"Observation"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"Observation-respiratory-rate.html"}],"reference":{"reference":"Observation/respiratory-rate"},"exampleBoolean":true},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-medication-codes.html"}],"reference":{"reference":"ValueSet/us-core-medication-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-immunization.html"}],"reference":{"reference":"StructureDefinition/us-core-immunization"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-location-address-state.html"}],"reference":{"reference":"SearchParameter/us-core-location-address-state"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-practitionerrole-practitioner.html"}],"reference":{"reference":"SearchParameter/us-core-practitionerrole-practitioner"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-observation-smokingstatus.html"}],"reference":{"reference":"ValueSet/us-core-observation-smokingstatus"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-omb-race-category.html"}],"reference":{"reference":"ValueSet/omb-race-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-practitionerrole.html"}],"reference":{"reference":"StructureDefinition/us-core-practitionerrole"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-allergy-substance.html"}],"reference":{"reference":"ValueSet/us-core-allergy-substance"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-narrative-status.html"}],"reference":{"reference":"ValueSet/us-core-narrative-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CodeSystem-cdcrec.html"}],"reference":{"reference":"CodeSystem/cdcrec"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-organization-name.html"}],"reference":{"reference":"SearchParameter/us-core-organization-name"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-observation-lab.html"}],"reference":{"reference":"StructureDefinition/us-core-observation-lab"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-diagnosticreport-code.html"}],"reference":{"reference":"SearchParameter/us-core-diagnosticreport-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-pediatric-bmi-for-age.html"}],"reference":{"reference":"StructureDefinition/pediatric-bmi-for-age"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-allergyintolerance.html"}],"reference":{"reference":"StructureDefinition/us-core-allergyintolerance"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-goal-lifecycle-status.html"}],"reference":{"reference":"SearchParameter/us-core-goal-lifecycle-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-procedure-code.html"}],"reference":{"reference":"SearchParameter/us-core-procedure-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-documentreference-type.html"}],"reference":{"reference":"ValueSet/us-core-documentreference-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-provenance-participant-type.html"}],"reference":{"reference":"ValueSet/us-core-provenance-participant-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-gender.html"}],"reference":{"reference":"SearchParameter/us-core-patient-gender"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-practitioner.html"}],"reference":{"reference":"StructureDefinition/us-core-practitioner"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-diagnosticreport-note.html"}],"reference":{"reference":"StructureDefinition/us-core-diagnosticreport-note"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-omb-ethnicity-category.html"}],"reference":{"reference":"ValueSet/omb-ethnicity-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-provenance.html"}],"reference":{"reference":"StructureDefinition/us-core-provenance"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"OperationDefinition"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"OperationDefinition-docref.html"}],"reference":{"reference":"OperationDefinition/docref"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-condition-clinical-status.html"}],"reference":{"reference":"SearchParameter/us-core-condition-clinical-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:extension"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-birthsex.html"}],"reference":{"reference":"StructureDefinition/us-core-birthsex"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-id.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-id"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careplan-category.html"}],"reference":{"reference":"SearchParameter/us-core-careplan-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-class.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-class"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-medicationrequest-patient.html"}],"reference":{"reference":"SearchParameter/us-core-medicationrequest-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CapabilityStatement"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CapabilityStatement-us-core-server.html"}],"reference":{"reference":"CapabilityStatement/us-core-server"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-condition-category.html"}],"reference":{"reference":"ValueSet/us-core-condition-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-detailed-ethnicity.html"}],"reference":{"reference":"ValueSet/detailed-ethnicity"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-patient.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-encounter.html"}],"reference":{"reference":"StructureDefinition/us-core-encounter"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-ndc-vaccine-codes.html"}],"reference":{"reference":"ValueSet/us-core-ndc-vaccine-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-patient.html"}],"reference":{"reference":"StructureDefinition/us-core-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-diagnosticreport-date.html"}],"reference":{"reference":"SearchParameter/us-core-diagnosticreport-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-procedure-icd10pcs.html"}],"reference":{"reference":"ValueSet/us-core-procedure-icd10pcs"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-provider-specialty.html"}],"reference":{"reference":"ValueSet/us-core-provider-specialty"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-procedure-date.html"}],"reference":{"reference":"SearchParameter/us-core-procedure-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-vaccines-cvx.html"}],"reference":{"reference":"ValueSet/us-core-vaccines-cvx"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-pulse-oximetry.html"}],"reference":{"reference":"StructureDefinition/us-core-pulse-oximetry"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-allergyintolerance-clinical-status.html"}],"reference":{"reference":"SearchParameter/us-core-allergyintolerance-clinical-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-date.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-medicationrequest-intent.html"}],"reference":{"reference":"SearchParameter/us-core-medicationrequest-intent"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-location.html"}],"reference":{"reference":"StructureDefinition/us-core-location"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-location-address.html"}],"reference":{"reference":"SearchParameter/us-core-location-address"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-observation-smoking-status-status.html"}],"reference":{"reference":"ValueSet/us-core-observation-smoking-status-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-usps-state.html"}],"reference":{"reference":"ValueSet/us-core-usps-state"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-practitioner-name.html"}],"reference":{"reference":"SearchParameter/us-core-practitioner-name"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-encounter-type.html"}],"reference":{"reference":"ValueSet/us-core-encounter-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-period.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-period"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-observation-code.html"}],"reference":{"reference":"SearchParameter/us-core-observation-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-location-name.html"}],"reference":{"reference":"SearchParameter/us-core-location-name"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-condition-onset-date.html"}],"reference":{"reference":"SearchParameter/us-core-condition-onset-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-given.html"}],"reference":{"reference":"SearchParameter/us-core-patient-given"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-procedure.html"}],"reference":{"reference":"StructureDefinition/us-core-procedure"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-type.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-condition-code.html"}],"reference":{"reference":"ValueSet/us-core-condition-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CodeSystem-condition-category.html"}],"reference":{"reference":"CodeSystem/condition-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-medicationrequest-encounter.html"}],"reference":{"reference":"SearchParameter/us-core-medicationrequest-encounter"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-patient.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-organization-address.html"}],"reference":{"reference":"SearchParameter/us-core-organization-address"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-observation-category.html"}],"reference":{"reference":"SearchParameter/us-core-observation-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-medication.html"}],"reference":{"reference":"StructureDefinition/us-core-medication"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-diagnosticreport-status.html"}],"reference":{"reference":"SearchParameter/us-core-diagnosticreport-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-observation-date.html"}],"reference":{"reference":"SearchParameter/us-core-observation-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-birthsex.html"}],"reference":{"reference":"ValueSet/birthsex"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-diagnosticreport-category.html"}],"reference":{"reference":"SearchParameter/us-core-diagnosticreport-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-observation-status.html"}],"reference":{"reference":"SearchParameter/us-core-observation-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-diagnosticreport-report-and-note-codes.html"}],"reference":{"reference":"ValueSet/us-core-diagnosticreport-report-and-note-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-provider-role.html"}],"reference":{"reference":"ValueSet/us-core-provider-role"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-ethnicity.html"}],"reference":{"reference":"SearchParameter/us-core-ethnicity"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-documentreference.html"}],"reference":{"reference":"StructureDefinition/us-core-documentreference"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:extension"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-direct.html"}],"reference":{"reference":"StructureDefinition/us-core-direct"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-smoking-status-observation-codes.html"}],"reference":{"reference":"ValueSet/us-core-smoking-status-observation-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-careteam-provider-roles.html"}],"reference":{"reference":"ValueSet/us-core-careteam-provider-roles"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-type.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-date.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-diagnosticreport-category.html"}],"reference":{"reference":"ValueSet/us-core-diagnosticreport-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-birthdate.html"}],"reference":{"reference":"SearchParameter/us-core-patient-birthdate"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-careteam.html"}],"reference":{"reference":"StructureDefinition/us-core-careteam"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-procedure-status.html"}],"reference":{"reference":"SearchParameter/us-core-procedure-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-clinical-note-type.html"}],"reference":{"reference":"ValueSet/us-core-clinical-note-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-status.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ConceptMap"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ConceptMap-ndc-cvx.html"}],"reference":{"reference":"ConceptMap/ndc-cvx"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:extension"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-ethnicity.html"}],"reference":{"reference":"StructureDefinition/us-core-ethnicity"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careplan-status.html"}],"reference":{"reference":"SearchParameter/us-core-careplan-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-careplan.html"}],"reference":{"reference":"StructureDefinition/us-core-careplan"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-condition-patient.html"}],"reference":{"reference":"SearchParameter/us-core-condition-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-allergyintolerance-patient.html"}],"reference":{"reference":"SearchParameter/us-core-allergyintolerance-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-device-patient.html"}],"reference":{"reference":"SearchParameter/us-core-device-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-condition-code.html"}],"reference":{"reference":"SearchParameter/us-core-condition-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-observation-patient.html"}],"reference":{"reference":"SearchParameter/us-core-observation-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-race.html"}],"reference":{"reference":"SearchParameter/us-core-race"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careplan-patient.html"}],"reference":{"reference":"SearchParameter/us-core-careplan-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-family.html"}],"reference":{"reference":"SearchParameter/us-core-patient-family"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-smokingstatus.html"}],"reference":{"reference":"StructureDefinition/us-core-smokingstatus"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-medicationrequest-status.html"}],"reference":{"reference":"SearchParameter/us-core-medicationrequest-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:extension"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-race.html"}],"reference":{"reference":"StructureDefinition/us-core-race"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-location-address-postalcode.html"}],"reference":{"reference":"SearchParameter/us-core-location-address-postalcode"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-id.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-id"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-medicationrequest-authoredon.html"}],"reference":{"reference":"SearchParameter/us-core-medicationrequest-authoredon"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-status.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-documentreference-category.html"}],"reference":{"reference":"ValueSet/us-core-documentreference-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-procedure-patient.html"}],"reference":{"reference":"SearchParameter/us-core-procedure-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-goal-target-date.html"}],"reference":{"reference":"SearchParameter/us-core-goal-target-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-diagnosticreport-patient.html"}],"reference":{"reference":"SearchParameter/us-core-diagnosticreport-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careplan-date.html"}],"reference":{"reference":"SearchParameter/us-core-careplan-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careteam-patient.html"}],"reference":{"reference":"SearchParameter/us-core-careteam-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-organization.html"}],"reference":{"reference":"StructureDefinition/us-core-organization"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-immunization-date.html"}],"reference":{"reference":"SearchParameter/us-core-immunization-date"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-encounter-identifier.html"}],"reference":{"reference":"SearchParameter/us-core-encounter-identifier"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-practitionerrole-specialty.html"}],"reference":{"reference":"SearchParameter/us-core-practitionerrole-specialty"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-name.html"}],"reference":{"reference":"SearchParameter/us-core-patient-name"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-device-type.html"}],"reference":{"reference":"SearchParameter/us-core-device-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-procedure-code.html"}],"reference":{"reference":"ValueSet/us-core-procedure-code"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-diagnosticreport-lab.html"}],"reference":{"reference":"StructureDefinition/us-core-diagnosticreport-lab"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-goal-patient.html"}],"reference":{"reference":"SearchParameter/us-core-goal-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-simple-language.html"}],"reference":{"reference":"ValueSet/simple-language"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-immunization-patient.html"}],"reference":{"reference":"SearchParameter/us-core-immunization-patient"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-condition.html"}],"reference":{"reference":"StructureDefinition/us-core-condition"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-pediatric-weight-for-height.html"}],"reference":{"reference":"StructureDefinition/pediatric-weight-for-height"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-observation-value-codes.html"}],"reference":{"reference":"ValueSet/us-core-observation-value-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-id.html"}],"reference":{"reference":"SearchParameter/us-core-patient-id"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-location-address-city.html"}],"reference":{"reference":"SearchParameter/us-core-location-address-city"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-goal.html"}],"reference":{"reference":"StructureDefinition/us-core-goal"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-careteam-status.html"}],"reference":{"reference":"SearchParameter/us-core-careteam-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CodeSystem-us-core-documentreference-category.html"}],"reference":{"reference":"CodeSystem/us-core-documentreference-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CodeSystem-us-core-provenance-participant-type.html"}],"reference":{"reference":"CodeSystem/us-core-provenance-participant-type"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-us-core-diagnosticreport-lab-codes.html"}],"reference":{"reference":"ValueSet/us-core-diagnosticreport-lab-codes"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CodeSystem"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CodeSystem-careplan-category.html"}],"reference":{"reference":"CodeSystem/careplan-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-documentreference-category.html"}],"reference":{"reference":"SearchParameter/us-core-documentreference-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"CapabilityStatement"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"CapabilityStatement-us-core-client.html"}],"reference":{"reference":"CapabilityStatement/us-core-client"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-practitioner-identifier.html"}],"reference":{"reference":"SearchParameter/us-core-practitioner-identifier"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-patient-identifier.html"}],"reference":{"reference":"SearchParameter/us-core-patient-identifier"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-condition-category.html"}],"reference":{"reference":"SearchParameter/us-core-condition-category"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"SearchParameter"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"SearchParameter-us-core-immunization-status.html"}],"reference":{"reference":"SearchParameter/us-core-immunization-status"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-medicationrequest.html"}],"reference":{"reference":"StructureDefinition/us-core-medicationrequest"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"StructureDefinition:resource"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"StructureDefinition-us-core-implantable-device.html"}],"reference":{"reference":"StructureDefinition/us-core-implantable-device"},"exampleBoolean":false},{"extension":[{"url":"http://hl7.org/fhir/tools/StructureDefinition/resource-information","valueString":"ValueSet"},{"url":"http://hl7.org/fhir/StructureDefinition/implementationguide-page","valueUri":"ValueSet-detailed-race.html"}],"reference":{"reference":"ValueSet/detailed-race"},"exampleBoolean":false}],"page":{"nameUrl":"index.html","title":"Home","generation":"markdown","page":[{"nameUrl":"guidance.html","title":"Guidance","generation":"markdown","page":[{"nameUrl":"general-guidance.html","title":"General Guidance","generation":"markdown"},{"nameUrl":"clinical-notes-guidance.html","title":"Clinical Notes Guidance","generation":"markdown"},{"nameUrl":"all-meds.html","title":"Medication List Guidance","generation":"markdown"},{"nameUrl":"basic-provenance.html","title":"Basic Provenance","generation":"markdown"},{"nameUrl":"r2-r4-guidance.html","title":"DSTU2 to R4 Conversion","generation":"markdown"},{"nameUrl":"future-of-us-core.html","title":"Future of US Core","generation":"markdown"}]},{"nameUrl":"profiles.html","title":"Profiles and Extensions","generation":"markdown","page":[{"nameUrl":"StructureDefinition-us-core-immunization.html","title":"StructureDefinition US Core Immunization","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-practitionerrole.html","title":"StructureDefinition US Core PractitionerRole","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-observation-lab.html","title":"StructureDefinition US Core Observation Lab","generation":"generated"},{"nameUrl":"StructureDefinition-pediatric-bmi-for-age.html","title":"StructureDefinition Pediatric Bmi For Age","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-allergyintolerance.html","title":"StructureDefinition US Core AllergyIntolerance","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-practitioner.html","title":"StructureDefinition US Core Practitioner","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-diagnosticreport-note.html","title":"StructureDefinition US Core DiagnosticReport Note","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-provenance.html","title":"StructureDefinition US Core Provenance","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-birthsex.html","title":"StructureDefinition US Core Birthsex","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-encounter.html","title":"StructureDefinition US Core Encounter","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-patient.html","title":"StructureDefinition US Core Patient","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-pulse-oximetry.html","title":"StructureDefinition US Core Pulse Oximetry","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-location.html","title":"StructureDefinition US Core Location","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-procedure.html","title":"StructureDefinition US Core Procedure","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-medication.html","title":"StructureDefinition US Core Medication","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-documentreference.html","title":"StructureDefinition US Core DocumentReference","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-direct.html","title":"StructureDefinition US Core Direct","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-careteam.html","title":"StructureDefinition US Core CareTeam","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-ethnicity.html","title":"StructureDefinition US Core Ethnicity","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-careplan.html","title":"StructureDefinition US Core CarePlan","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-smokingstatus.html","title":"StructureDefinition US Core Smokingstatus","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-race.html","title":"StructureDefinition US Core Race","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-organization.html","title":"StructureDefinition US Core Organization","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-diagnosticreport-lab.html","title":"StructureDefinition US Core DiagnosticReport Lab","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-condition.html","title":"StructureDefinition US Core Condition","generation":"generated"},{"nameUrl":"StructureDefinition-pediatric-weight-for-height.html","title":"StructureDefinition Pediatric Weight For Height","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-goal.html","title":"StructureDefinition US Core Goal","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-medicationrequest.html","title":"StructureDefinition US Core MedicationRequest","generation":"generated"},{"nameUrl":"StructureDefinition-us-core-implantable-device.html","title":"StructureDefinition US Core Implantable Device","generation":"generated"}]},{"nameUrl":"operations.html","title":"Operations","generation":"markdown","page":[{"nameUrl":"OperationDefinition-docref.html","title":"OperationDefinition Docref","generation":"generated"}]},{"nameUrl":"terminology.html","title":"Terminology","generation":"markdown","page":[{"nameUrl":"ValueSet-us-core-medication-codes.html","title":"ValueSet US Core Medication Codes","generation":"generated"},{"nameUrl":"ValueSet-us-core-observation-smokingstatus.html","title":"ValueSet US Core Observation Smokingstatus","generation":"generated"},{"nameUrl":"ValueSet-omb-race-category.html","title":"ValueSet Omb Race Category","generation":"generated"},{"nameUrl":"ValueSet-us-core-allergy-substance.html","title":"ValueSet US Core Allergy Substance","generation":"generated"},{"nameUrl":"ValueSet-us-core-narrative-status.html","title":"ValueSet US Core Narrative Status","generation":"generated"},{"nameUrl":"ValueSet-us-core-documentreference-type.html","title":"ValueSet US Core DocumentReference Type","generation":"generated"},{"nameUrl":"ValueSet-omb-ethnicity-category.html","title":"ValueSet Omb Ethnicity Category","generation":"generated"},{"nameUrl":"ValueSet-us-core-condition-category.html","title":"ValueSet US Core Condition Category","generation":"generated"},{"nameUrl":"ValueSet-detailed-ethnicity.html","title":"ValueSet Detailed Ethnicity","generation":"generated"},{"nameUrl":"ValueSet-us-core-ndc-vaccine-codes.html","title":"ValueSet US Core Ndc Vaccine Codes","generation":"generated"},{"nameUrl":"ValueSet-us-core-procedure-icd10pcs.html","title":"ValueSet US Core Procedure Icd10pcs","generation":"generated"},{"nameUrl":"ValueSet-us-core-provider-specialty.html","title":"ValueSet US Core Provider Specialty","generation":"generated"},{"nameUrl":"ValueSet-us-core-vaccines-cvx.html","title":"ValueSet US Core Vaccines Cvx","generation":"generated"},{"nameUrl":"ValueSet-us-core-observation-smoking-status-status.html","title":"ValueSet US Core Observation Smoking Status Status","generation":"generated"},{"nameUrl":"ValueSet-us-core-usps-state.html","title":"ValueSet US Core Usps State","generation":"generated"},{"nameUrl":"ValueSet-us-core-encounter-type.html","title":"ValueSet US Core Encounter Type","generation":"generated"},{"nameUrl":"ValueSet-us-core-condition-code.html","title":"ValueSet US Core Condition Code","generation":"generated"},{"nameUrl":"ValueSet-birthsex.html","title":"ValueSet Birthsex","generation":"generated"},{"nameUrl":"ValueSet-us-core-diagnosticreport-report-and-note-codes.html","title":"ValueSet US Core DiagnosticReport Report And Note Codes","generation":"generated"},{"nameUrl":"ValueSet-us-core-provider-role.html","title":"ValueSet US Core Provider Role","generation":"generated"},{"nameUrl":"ValueSet-us-core-smoking-status-observation-codes.html","title":"ValueSet US Core Smoking Status Observation Codes","generation":"generated"},{"nameUrl":"ValueSet-us-core-careteam-provider-roles.html","title":"ValueSet US Core CareTeam Provider Roles","generation":"generated"},{"nameUrl":"ValueSet-us-core-diagnosticreport-category.html","title":"ValueSet US Core DiagnosticReport Category","generation":"generated"},{"nameUrl":"ValueSet-us-core-clinical-note-type.html","title":"ValueSet US Core Clinical Note Type","generation":"generated"},{"nameUrl":"ValueSet-us-core-documentreference-category.html","title":"ValueSet US Core DocumentReference Category","generation":"generated"},{"nameUrl":"ValueSet-us-core-procedure-code.html","title":"ValueSet US Core Procedure Code","generation":"generated"},{"nameUrl":"ValueSet-simple-language.html","title":"ValueSet Simple Language","generation":"generated"},{"nameUrl":"ValueSet-us-core-observation-value-codes.html","title":"ValueSet US Core Observation Value Codes","generation":"generated"},{"nameUrl":"ValueSet-us-core-diagnosticreport-lab-codes.html","title":"ValueSet US Core DiagnosticReport Lab Codes","generation":"generated"},{"nameUrl":"ValueSet-detailed-race.html","title":"ValueSet Detailed Race","generation":"generated"},{"nameUrl":"CodeSystem-cdcrec.html","title":"CodeSystem Cdcrec","generation":"generated"},{"nameUrl":"CodeSystem-condition-category.html","title":"CodeSystem Condition Category","generation":"generated"},{"nameUrl":"CodeSystem-us-core-documentreference-category.html","title":"CodeSystem US Core DocumentReference Category","generation":"generated"},{"nameUrl":"CodeSystem-careplan-category.html","title":"CodeSystem CarePlan Category","generation":"generated"},{"nameUrl":"ConceptMap-ndc-cvx.html","title":"ConceptMap Ndc Cvx","generation":"generated"}]},{"nameUrl":"searchparameters.html","title":"Search Parameters","generation":"markdown","page":[{"nameUrl":"SearchParameter-us-core-location-address-state.html","title":"SearchParameter US Core Location Address State","generation":"generated"},{"nameUrl":"SearchParameter-us-core-practitionerrole-practitioner.html","title":"SearchParameter US Core PractitionerRole Practitioner","generation":"generated"},{"nameUrl":"SearchParameter-us-core-organization-name.html","title":"SearchParameter US Core Organization Name","generation":"generated"},{"nameUrl":"SearchParameter-us-core-diagnosticreport-code.html","title":"SearchParameter US Core DiagnosticReport Code","generation":"generated"},{"nameUrl":"SearchParameter-us-core-goal-lifecycle-status.html","title":"SearchParameter US Core Goal Lifecycle Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-procedure-code.html","title":"SearchParameter US Core Procedure Code","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-gender.html","title":"SearchParameter US Core Patient Gender","generation":"generated"},{"nameUrl":"SearchParameter-us-core-condition-clinical-status.html","title":"SearchParameter US Core Condition Clinical Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-id.html","title":"SearchParameter US Core DocumentReference Id","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careplan-category.html","title":"SearchParameter US Core CarePlan Category","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-class.html","title":"SearchParameter US Core Encounter Class","generation":"generated"},{"nameUrl":"SearchParameter-us-core-medicationrequest-patient.html","title":"SearchParameter US Core MedicationRequest Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-patient.html","title":"SearchParameter US Core DocumentReference Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-diagnosticreport-date.html","title":"SearchParameter US Core DiagnosticReport Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-procedure-date.html","title":"SearchParameter US Core Procedure Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-allergyintolerance-clinical-status.html","title":"SearchParameter US Core AllergyIntolerance Clinical Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-date.html","title":"SearchParameter US Core DocumentReference Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-medicationrequest-intent.html","title":"SearchParameter US Core MedicationRequest Intent","generation":"generated"},{"nameUrl":"SearchParameter-us-core-location-address.html","title":"SearchParameter US Core Location Address","generation":"generated"},{"nameUrl":"SearchParameter-us-core-practitioner-name.html","title":"SearchParameter US Core Practitioner Name","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-period.html","title":"SearchParameter US Core DocumentReference Period","generation":"generated"},{"nameUrl":"SearchParameter-us-core-observation-code.html","title":"SearchParameter US Core Observation Code","generation":"generated"},{"nameUrl":"SearchParameter-us-core-location-name.html","title":"SearchParameter US Core Location Name","generation":"generated"},{"nameUrl":"SearchParameter-us-core-condition-onset-date.html","title":"SearchParameter US Core Condition Onset Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-given.html","title":"SearchParameter US Core Patient Given","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-type.html","title":"SearchParameter US Core Encounter Type","generation":"generated"},{"nameUrl":"SearchParameter-us-core-medicationrequest-encounter.html","title":"SearchParameter US Core MedicationRequest Encounter","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-patient.html","title":"SearchParameter US Core Encounter Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-organization-address.html","title":"SearchParameter US Core Organization Address","generation":"generated"},{"nameUrl":"SearchParameter-us-core-observation-category.html","title":"SearchParameter US Core Observation Category","generation":"generated"},{"nameUrl":"SearchParameter-us-core-diagnosticreport-status.html","title":"SearchParameter US Core DiagnosticReport Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-observation-date.html","title":"SearchParameter US Core Observation Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-diagnosticreport-category.html","title":"SearchParameter US Core DiagnosticReport Category","generation":"generated"},{"nameUrl":"SearchParameter-us-core-observation-status.html","title":"SearchParameter US Core Observation Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-ethnicity.html","title":"SearchParameter US Core Ethnicity","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-type.html","title":"SearchParameter US Core DocumentReference Type","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-date.html","title":"SearchParameter US Core Encounter Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-birthdate.html","title":"SearchParameter US Core Patient Birthdate","generation":"generated"},{"nameUrl":"SearchParameter-us-core-procedure-status.html","title":"SearchParameter US Core Procedure Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-status.html","title":"SearchParameter US Core Encounter Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careplan-status.html","title":"SearchParameter US Core CarePlan Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-condition-patient.html","title":"SearchParameter US Core Condition Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-allergyintolerance-patient.html","title":"SearchParameter US Core AllergyIntolerance Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-device-patient.html","title":"SearchParameter US Core Device Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-condition-code.html","title":"SearchParameter US Core Condition Code","generation":"generated"},{"nameUrl":"SearchParameter-us-core-observation-patient.html","title":"SearchParameter US Core Observation Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-race.html","title":"SearchParameter US Core Race","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careplan-patient.html","title":"SearchParameter US Core CarePlan Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-family.html","title":"SearchParameter US Core Patient Family","generation":"generated"},{"nameUrl":"SearchParameter-us-core-medicationrequest-status.html","title":"SearchParameter US Core MedicationRequest Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-location-address-postalcode.html","title":"SearchParameter US Core Location Address Postalcode","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-id.html","title":"SearchParameter US Core Encounter Id","generation":"generated"},{"nameUrl":"SearchParameter-us-core-medicationrequest-authoredon.html","title":"SearchParameter US Core MedicationRequest Authoredon","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-status.html","title":"SearchParameter US Core DocumentReference Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-procedure-patient.html","title":"SearchParameter US Core Procedure Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-goal-target-date.html","title":"SearchParameter US Core Goal Target Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-diagnosticreport-patient.html","title":"SearchParameter US Core DiagnosticReport Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careplan-date.html","title":"SearchParameter US Core CarePlan Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careteam-patient.html","title":"SearchParameter US Core CareTeam Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-immunization-date.html","title":"SearchParameter US Core Immunization Date","generation":"generated"},{"nameUrl":"SearchParameter-us-core-encounter-identifier.html","title":"SearchParameter US Core Encounter Identifier","generation":"generated"},{"nameUrl":"SearchParameter-us-core-practitionerrole-specialty.html","title":"SearchParameter US Core PractitionerRole Specialty","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-name.html","title":"SearchParameter US Core Patient Name","generation":"generated"},{"nameUrl":"SearchParameter-us-core-device-type.html","title":"SearchParameter US Core Device Type","generation":"generated"},{"nameUrl":"SearchParameter-us-core-goal-patient.html","title":"SearchParameter US Core Goal Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-immunization-patient.html","title":"SearchParameter US Core Immunization Patient","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-id.html","title":"SearchParameter US Core Patient Id","generation":"generated"},{"nameUrl":"SearchParameter-us-core-location-address-city.html","title":"SearchParameter US Core Location Address City","generation":"generated"},{"nameUrl":"SearchParameter-us-core-careteam-status.html","title":"SearchParameter US Core CareTeam Status","generation":"generated"},{"nameUrl":"SearchParameter-us-core-documentreference-category.html","title":"SearchParameter US Core DocumentReference Category","generation":"generated"},{"nameUrl":"SearchParameter-us-core-practitioner-identifier.html","title":"SearchParameter US Core Practitioner Identifier","generation":"generated"},{"nameUrl":"SearchParameter-us-core-patient-identifier.html","title":"SearchParameter US Core Patient Identifier","generation":"generated"},{"nameUrl":"SearchParameter-us-core-condition-category.html","title":"SearchParameter US Core Condition Category","generation":"generated"},{"nameUrl":"SearchParameter-us-core-immunization-status.html","title":"SearchParameter US Core Immunization Status","generation":"generated"}]},{"nameUrl":"capstatements.html","title":"Capability Statements","generation":"markdown","page":[{"nameUrl":"CapabilityStatement-us-core-server.html","title":"CapabilityStatement US Core Server","generation":"generated"},{"nameUrl":"CapabilityStatement-us-core-client.html","title":"CapabilityStatement US Core Client","generation":"generated"}]},{"nameUrl":"security.html","title":"Security","generation":"markdown"},{"nameUrl":"downloads.html","title":"Downloads","generation":"markdown"},{"nameUrl":"all-examples.html","title":"All Examples","generation":"markdown"},{"nameUrl":"toc.html","title":"Table of Contents","generation":"html"}]}}} \ No newline at end of file From 4e88586d38137823fdc13be71abd062215dbe361 Mon Sep 17 00:00:00 2001 From: Chase Date: Fri, 8 Nov 2019 09:29:24 -0500 Subject: [PATCH 059/173] update for 3.1.0 --- config.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config.yml b/config.yml index 91af03f9b..f94387a9b 100644 --- a/config.yml +++ b/config.yml @@ -43,8 +43,7 @@ modules: - onc_r4 - smart - argonaut - - uscore_v3.0.0 - - uscore_v3.0.1 + - uscore_v3.1.0 # preset fhir servers: optional. Minimally requires name, uri, module, optional inferno_uri, client_id, client_secret, scopes, instructions link presets: From d44f79fb4bec184d8dbcb00b92ce671ec9b04660 Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 12 Nov 2019 10:10:53 -0500 Subject: [PATCH 060/173] removing 300 and 301 tests --- lib/app/modules/onc_program_r4_module.yml | 47 +- .../pediatric_bmi_for_age_sequence.rb | 334 ------------- .../pediatric_weight_for_height_sequence.rb | 334 ------------- .../us_core_allergyintolerance_sequence.rb | 214 -------- .../us_core_careplan_sequence.rb | 289 ----------- .../us_core_careteam_sequence.rb | 188 ------- .../us_core_condition_sequence.rb | 306 ------------ .../uscore_v3.0.0/us_core_device_sequence.rb | 215 -------- .../us_core_diagnosticreport_lab_sequence.rb | 383 --------------- .../us_core_diagnosticreport_note_sequence.rb | 383 --------------- .../us_core_documentreference_sequence.rb | 384 --------------- .../us_core_encounter_sequence.rb | 368 -------------- .../uscore_v3.0.0/us_core_goal_sequence.rb | 253 ---------- .../us_core_immunization_sequence.rb | 254 ---------- .../us_core_location_sequence.rb | 303 ------------ .../us_core_medication_sequence.rb | 126 ----- .../us_core_medicationrequest_sequence.rb | 265 ---------- .../us_core_medicationstatement_sequence.rb | 276 ----------- .../us_core_observation_lab_sequence.rb | 324 ------------- .../us_core_organization_sequence.rb | 228 --------- .../uscore_v3.0.0/us_core_patient_sequence.rb | 376 -------------- .../us_core_practitioner_sequence.rb | 224 --------- .../us_core_practitionerrole_sequence.rb | 247 ---------- .../us_core_procedure_sequence.rb | 287 ----------- .../us_core_smokingstatus_sequence.rb | 311 ------------ lib/app/modules/uscore_v3.0.0_module.yml | 49 -- .../pediatric_bmi_for_age_sequence.rb | 338 ------------- .../pediatric_weight_for_height_sequence.rb | 338 ------------- .../us_core_allergyintolerance_sequence.rb | 235 --------- .../us_core_careplan_sequence.rb | 308 ------------ .../us_core_careteam_sequence.rb | 207 -------- .../us_core_condition_sequence.rb | 327 ------------- .../us_core_diagnosticreport_lab_sequence.rb | 424 ---------------- .../us_core_diagnosticreport_note_sequence.rb | 423 ---------------- .../us_core_documentreference_sequence.rb | 397 --------------- .../us_core_encounter_sequence.rb | 389 --------------- .../uscore_v3.0.1/us_core_goal_sequence.rb | 273 ----------- .../us_core_immunization_sequence.rb | 275 ----------- .../us_core_implantable_device_sequence.rb | 242 --------- .../us_core_location_sequence.rb | 324 ------------- .../us_core_medication_sequence.rb | 144 ------ .../us_core_medicationrequest_sequence.rb | 328 ------------- .../us_core_observation_lab_sequence.rb | 328 ------------- .../us_core_organization_sequence.rb | 252 ---------- .../uscore_v3.0.1/us_core_patient_sequence.rb | 397 --------------- .../us_core_practitioner_sequence.rb | 244 ---------- .../us_core_practitionerrole_sequence.rb | 268 ---------- .../us_core_procedure_sequence.rb | 292 ----------- .../us_core_provenance_sequence.rb | 135 ------ .../us_core_pulse_oximetry_sequence.rb | 459 ------------------ .../us_core_smokingstatus_sequence.rb | 314 ------------ lib/app/modules/uscore_v3.0.1_module.yml | 50 -- .../us_core_r4/clinicalnotes_sequence_test.rb | 2 +- test/unit/test_instance_test.rb | 2 +- 54 files changed, 25 insertions(+), 14658 deletions(-) delete mode 100644 lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_medication_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.0_module.yml delete mode 100644 lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_provenance_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb delete mode 100644 lib/app/modules/uscore_v3.0.1_module.yml diff --git a/lib/app/modules/onc_program_r4_module.yml b/lib/app/modules/onc_program_r4_module.yml index d63733af7..bfcd1a140 100644 --- a/lib/app/modules/onc_program_r4_module.yml +++ b/lib/app/modules/onc_program_r4_module.yml @@ -109,29 +109,28 @@ test_sets: - patient_id - token sequences: - - USCore300AllergyintoleranceSequence - - USCore300CareplanSequence - - USCore300CareteamSequence - - USCore300ConditionSequence - - USCore300DeviceSequence - - USCore300DiagnosticreportNoteSequence - - USCore300DiagnosticreportLabSequence - - USCore300DocumentreferenceSequence - - USCore300EncounterSequence - - USCore300GoalSequence - - USCore300ImmunizationSequence - - USCore300MedicationrequestSequence - - USCore300MedicationstatementSequence - - USCore300SmokingstatusSequence - - USCore300PediatricWeightForHeightSequence - - USCore300ObservationLabSequence - - USCore300PediatricBmiForAgeSequence - - USCore300PatientSequence - - USCore300ProcedureSequence + - USCore310AllergyintoleranceSequence + - USCore310CareplanSequence + - USCore310CareteamSequence + - USCore310ConditionSequence + - USCore310ImplantableDeviceSequence + - USCore310DiagnosticreportNoteSequence + - USCore310DiagnosticreportLabSequence + - USCore310DocumentreferenceSequence + - USCore310EncounterSequence + - USCore310GoalSequence + - USCore310ImmunizationSequence + - USCore310MedicationrequestSequence + - USCore310SmokingstatusSequence + - USCore310PediatricWeightForHeightSequence + - USCore310ObservationLabSequence + - USCore310PediatricBmiForAgeSequence + - USCore310PatientSequence + - USCore310ProcedureSequence - R4ProvenanceSequence - USCoreR4ClinicalNotesSequence - - USCore300LocationSequence - - USCore300MedicationSequence - - USCore300OrganizationSequence - - USCore300PractitionerSequence - - USCore300PractitionerroleSequence \ No newline at end of file + - USCore310LocationSequence + - USCore310MedicationSequence + - USCore310OrganizationSequence + - USCore310PractitionerSequence + - USCore310PractitionerroleSequence \ No newline at end of file diff --git a/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb deleted file mode 100644 index f302e0044..000000000 --- a/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb +++ /dev/null @@ -1,334 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300PediatricBmiForAgeSequence < SequenceBase - title 'Pediatric BMI for Age Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPBMIAO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Observation search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '59576-9' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '59576-9' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.category', - 'Observation.category', - 'Observation.category.coding', - 'Observation.category.coding.system', - 'Observation.category.coding.code', - 'Observation.subject', - 'Observation.effectiveDateTime', - 'Observation.effectivePeriod', - 'Observation.valueQuantity.value', - 'Observation.valueQuantity.unit', - 'Observation.valueQuantity.system', - 'Observation.valueQuantity.code', - 'Observation.dataAbsentReason', - 'Observation.component', - 'Observation.component.code', - 'Observation.component.valueQuantity', - 'Observation.component.valueCodeableConcept', - 'Observation.component.valueString', - 'Observation.component.valueBoolean', - 'Observation.component.valueInteger', - 'Observation.component.valueRange', - 'Observation.component.valueRatio', - 'Observation.component.valueSampledData', - 'Observation.component.valueTime', - 'Observation.component.valueDateTime', - 'Observation.component.valuePeriod', - 'Observation.component.dataAbsentReason' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb deleted file mode 100644 index 2e3a247e8..000000000 --- a/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb +++ /dev/null @@ -1,334 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300PediatricWeightForHeightSequence < SequenceBase - title 'Pediatric Weight for Height Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPWHO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Observation search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '77606-2' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '77606-2' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.category', - 'Observation.category', - 'Observation.category.coding', - 'Observation.category.coding.system', - 'Observation.category.coding.code', - 'Observation.subject', - 'Observation.effectiveDateTime', - 'Observation.effectivePeriod', - 'Observation.valueQuantity.value', - 'Observation.valueQuantity.unit', - 'Observation.valueQuantity.system', - 'Observation.valueQuantity.code', - 'Observation.dataAbsentReason', - 'Observation.component', - 'Observation.component.code', - 'Observation.component.valueQuantity', - 'Observation.component.valueCodeableConcept', - 'Observation.component.valueString', - 'Observation.component.valueBoolean', - 'Observation.component.valueInteger', - 'Observation.component.valueRange', - 'Observation.component.valueRatio', - 'Observation.component.valueSampledData', - 'Observation.component.valueTime', - 'Observation.component.valueDateTime', - 'Observation.component.valuePeriod', - 'Observation.component.dataAbsentReason' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb deleted file mode 100644 index 802fea0f0..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb +++ /dev/null @@ -1,214 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300AllergyintoleranceSequence < SequenceBase - title 'AllergyIntolerance Tests' - - description 'Verify that AllergyIntolerance resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCAI' - - requires :token, :patient_id - conformance_supports :AllergyIntolerance - - def validate_resource_item(resource, property, value) - case property - - when 'clinical-status' - value_found = can_resolve_path(resource, 'clinicalStatus.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'clinical-status on resource does not match clinical-status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects AllergyIntolerance search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from AllergyIntolerance search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @allergyintolerance = reply&.resource&.entry&.first&.resource - @allergyintolerance_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('AllergyIntolerance'), reply) - save_delayed_sequence_references(@allergyintolerance_ary) - validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) - end - - test 'Server returns expected results from AllergyIntolerance search by patient+clinical-status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@allergyintolerance.nil?, 'Expected valid AllergyIntolerance resource to be present' - - patient_val = @instance.patient_id - clinical_status_val = get_value_for_search_param(resolve_element_from_path(@allergyintolerance_ary, 'clinicalStatus')) - search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) - validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) - assert_response_ok(reply) - end - - test 'AllergyIntolerance read resource supported' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) - end - - test 'AllergyIntolerance vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) - end - - test 'AllergyIntolerance history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) - end - - test 'AllergyIntolerance resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '07' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('AllergyIntolerance') - end - - test 'At least one of every must support element is provided in any AllergyIntolerance for this patient.' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @allergyintolerance_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'AllergyIntolerance.clinicalStatus', - 'AllergyIntolerance.verificationStatus', - 'AllergyIntolerance.code', - 'AllergyIntolerance.patient' - ] - must_support_elements.each do |path| - @allergyintolerance_ary&.each do |resource| - truncated_path = path.gsub('AllergyIntolerance.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @allergyintolerance_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided AllergyIntolerance resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@allergyintolerance) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb deleted file mode 100644 index d326424b1..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb +++ /dev/null @@ -1,289 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300CareplanSequence < SequenceBase - title 'CarePlan Tests' - - description 'Verify that CarePlan resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCCP' - - requires :token, :patient_id - conformance_supports :CarePlan - - def validate_resource_item(resource, property, value) - case property - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'date' - value_found = can_resolve_path(resource, 'period') do |period| - validate_period_search(value, period) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects CarePlan search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'assess-plan' } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from CarePlan search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, category: 'assess-plan' } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @careplan = reply&.resource&.entry&.first&.resource - @careplan_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) - save_delayed_sequence_references(@careplan_ary) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - end - - test 'Server returns expected results from CarePlan search by patient+category+status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from CarePlan search by patient+category+status+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) - date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from CarePlan search by patient+category+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'CarePlan read resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@careplan, versioned_resource_class('CarePlan')) - end - - test 'CarePlan vread resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@careplan, versioned_resource_class('CarePlan')) - end - - test 'CarePlan history resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@careplan, versioned_resource_class('CarePlan')) - end - - test 'CarePlan resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '09' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('CarePlan') - end - - test 'At least one of every must support element is provided in any CarePlan for this patient.' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careplan_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'CarePlan.text', - 'CarePlan.text.status', - 'CarePlan.status', - 'CarePlan.intent', - 'CarePlan.category', - 'CarePlan.category', - 'CarePlan.subject' - ] - must_support_elements.each do |path| - @careplan_ary&.each do |resource| - truncated_path = path.gsub('CarePlan.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @careplan_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided CarePlan resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@careplan) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb deleted file mode 100644 index dc7d6e840..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb +++ /dev/null @@ -1,188 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300CareteamSequence < SequenceBase - title 'CareTeam Tests' - - description 'Verify that CareTeam resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCCT' - - requires :token, :patient_id - conformance_supports :CareTeam - - def validate_resource_item(resource, property, value) - case property - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects CareTeam search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, status: 'active' } - - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from CareTeam search by patient+status' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, status: 'active' } - - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @careteam = reply&.resource&.entry&.first&.resource - @careteam_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) - save_delayed_sequence_references(@careteam_ary) - validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) - end - - test 'CareTeam read resource supported' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@careteam, versioned_resource_class('CareTeam')) - end - - test 'CareTeam vread resource supported' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@careteam, versioned_resource_class('CareTeam')) - end - - test 'CareTeam history resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@careteam, versioned_resource_class('CareTeam')) - end - - test 'CareTeam resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '06' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('CareTeam') - end - - test 'At least one of every must support element is provided in any CareTeam for this patient.' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careteam_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'CareTeam.status', - 'CareTeam.subject', - 'CareTeam.participant', - 'CareTeam.participant.role', - 'CareTeam.participant.member' - ] - must_support_elements.each do |path| - @careteam_ary&.each do |resource| - truncated_path = path.gsub('CareTeam.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @careteam_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided CareTeam resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '08' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@careteam) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb deleted file mode 100644 index 505db2837..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb +++ /dev/null @@ -1,306 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300ConditionSequence < SequenceBase - title 'Condition Tests' - - description 'Verify that Condition resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCC' - - requires :token, :patient_id - conformance_supports :Condition - - def validate_resource_item(resource, property, value) - case property - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'clinical-status' - value_found = can_resolve_path(resource, 'clinicalStatus.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'clinical-status on resource does not match clinical-status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'onset-date' - value_found = can_resolve_path(resource, 'onsetDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'onset-date on resource does not match onset-date requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Condition search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Condition search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @condition = reply&.resource&.entry&.first&.resource - @condition_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Condition'), reply) - save_delayed_sequence_references(@condition_ary) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - end - - test 'Server returns expected results from Condition search by patient+onset-date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - onset_date_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'onsetDateTime')) - search_params = { 'patient': patient_val, 'onset-date': onset_date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, onset_date_val) - comparator_search_params = { 'patient': patient_val, 'onset-date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Condition'), comparator_search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Condition search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Condition search by patient+code' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Condition search by patient+clinical-status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - clinical_status_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'clinicalStatus')) - search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - end - - test 'Condition read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@condition, versioned_resource_class('Condition')) - end - - test 'Condition vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@condition, versioned_resource_class('Condition')) - end - - test 'Condition history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@condition, versioned_resource_class('Condition')) - end - - test 'Condition resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Condition') - end - - test 'At least one of every must support element is provided in any Condition for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @condition_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Condition.clinicalStatus', - 'Condition.verificationStatus', - 'Condition.category', - 'Condition.code', - 'Condition.subject' - ] - must_support_elements.each do |path| - @condition_ary&.each do |resource| - truncated_path = path.gsub('Condition.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @condition_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Condition resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@condition) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb deleted file mode 100644 index 27f123c44..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb +++ /dev/null @@ -1,215 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300DeviceSequence < SequenceBase - title 'Device Tests' - - description 'Verify that Device resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCD' - - requires :token, :patient_id - conformance_supports :Device - - def validate_resource_item(resource, property, value) - case property - - when 'patient' - value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'type' - value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'type on resource does not match type requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Device search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Device'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Device search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Device'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @device = reply&.resource&.entry&.first&.resource - @device_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Device'), reply) - save_delayed_sequence_references(@device_ary) - validate_search_reply(versioned_resource_class('Device'), reply, search_params) - end - - test 'Server returns expected results from Device search by patient+type' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@device.nil?, 'Expected valid Device resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@device_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Device'), search_params) - validate_search_reply(versioned_resource_class('Device'), reply, search_params) - assert_response_ok(reply) - end - - test 'Device read resource supported' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@device, versioned_resource_class('Device')) - end - - test 'Device vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@device, versioned_resource_class('Device')) - end - - test 'Device history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@device, versioned_resource_class('Device')) - end - - test 'Device resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '07' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-device' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Device') - end - - test 'At least one of every must support element is provided in any Device for this patient.' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @device_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Device.udiCarrier', - 'Device.udiCarrier.carrierAIDC', - 'Device.udiCarrier.carrierHRF', - 'Device.type', - 'Device.patient' - ] - must_support_elements.each do |path| - @device_ary&.each do |resource| - truncated_path = path.gsub('Device.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @device_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Device resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@device) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb deleted file mode 100644 index ed17e2733..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb +++ /dev/null @@ -1,383 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300DiagnosticreportLabSequence < SequenceBase - title 'DiagnosticReport for Laboratory Results Reporting Tests' - - description 'Verify that DiagnosticReport resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCDRLRR' - - requires :token, :patient_id - conformance_supports :DiagnosticReport - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects DiagnosticReport search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'LAB' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, category: 'LAB' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @diagnosticreport = reply&.resource&.entry&.first&.resource - @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - save_delayed_sequence_references(@diagnosticreport_ary) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - end - - test 'Server returns expected results from DiagnosticReport search by patient+code' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+code+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { patient: @instance.patient_id, category: 'LAB' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'DiagnosticReport create resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport read resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport vread resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport history resource supported' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '13' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('DiagnosticReport', Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - end - - test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do - metadata do - id '14' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'DiagnosticReport.status', - 'DiagnosticReport.category', - 'DiagnosticReport.code', - 'DiagnosticReport.subject', - 'DiagnosticReport.effectiveDateTime', - 'DiagnosticReport.effectivePeriod', - 'DiagnosticReport.issued', - 'DiagnosticReport.performer', - 'DiagnosticReport.result', - 'DiagnosticReport.media', - 'DiagnosticReport.presentedForm' - ] - must_support_elements.each do |path| - @diagnosticreport_ary&.each do |resource| - truncated_path = path.gsub('DiagnosticReport.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @diagnosticreport_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '15' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@diagnosticreport) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb deleted file mode 100644 index 5db5d57ca..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb +++ /dev/null @@ -1,383 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300DiagnosticreportNoteSequence < SequenceBase - title 'DiagnosticReport for Report and Note exchange Tests' - - description 'Verify that DiagnosticReport resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCDRRN' - - requires :token, :patient_id - conformance_supports :DiagnosticReport - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects DiagnosticReport search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @diagnosticreport = reply&.resource&.entry&.first&.resource - @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - save_delayed_sequence_references(@diagnosticreport_ary) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - end - - test 'Server returns expected results from DiagnosticReport search by patient+code' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+code+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'DiagnosticReport create resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport read resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport vread resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport history resource supported' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '13' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('DiagnosticReport', Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - end - - test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do - metadata do - id '14' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'DiagnosticReport.status', - 'DiagnosticReport.category', - 'DiagnosticReport.code', - 'DiagnosticReport.subject', - 'DiagnosticReport.encounter', - 'DiagnosticReport.effectiveDateTime', - 'DiagnosticReport.effectivePeriod', - 'DiagnosticReport.issued', - 'DiagnosticReport.performer', - 'DiagnosticReport.media', - 'DiagnosticReport.presentedForm' - ] - must_support_elements.each do |path| - @diagnosticreport_ary&.each do |resource| - truncated_path = path.gsub('DiagnosticReport.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @diagnosticreport_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '15' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@diagnosticreport) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb deleted file mode 100644 index 8940fc626..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb +++ /dev/null @@ -1,384 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300DocumentreferenceSequence < SequenceBase - title 'DocumentReference Tests' - - description 'Verify that DocumentReference resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCDR' - - requires :token, :patient_id - conformance_supports :DocumentReference - - def validate_resource_item(resource, property, value) - case property - - when '_id' - value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } - assert value_found, '_id on resource does not match _id requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'type' - value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'type on resource does not match type requested' - - when 'date' - value_found = can_resolve_path(resource, 'date') { |value_in_resource| value_in_resource == value } - assert value_found, 'date on resource does not match date requested' - - when 'period' - value_found = can_resolve_path(resource, 'context.period') do |period| - validate_period_search(value, period) - end - assert value_found, 'period on resource does not match period requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects DocumentReference search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from DocumentReference search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @documentreference = reply&.resource&.entry&.first&.resource - @documentreference_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DocumentReference'), reply) - save_delayed_sequence_references(@documentreference_ary) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - end - - test 'Server returns expected results from DocumentReference search by _id' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - id_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'id')) - search_params = { '_id': id_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+category+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'date')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+type' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+status' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+type+period' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) - period_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'context.period')) - search_params = { 'patient': patient_val, 'type': type_val, 'period': period_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, period_val) - comparator_search_params = { 'patient': patient_val, 'type': type_val, 'period': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), comparator_search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'DocumentReference create resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_create_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference read resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference vread resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference history resource supported' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '13' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('DocumentReference') - end - - test 'At least one of every must support element is provided in any DocumentReference for this patient.' do - metadata do - id '14' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @documentreference_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'DocumentReference.identifier', - 'DocumentReference.status', - 'DocumentReference.type', - 'DocumentReference.category', - 'DocumentReference.subject', - 'DocumentReference.date', - 'DocumentReference.author', - 'DocumentReference.custodian', - 'DocumentReference.content', - 'DocumentReference.content.attachment', - 'DocumentReference.content.attachment.contentType', - 'DocumentReference.content.attachment.data', - 'DocumentReference.content.attachment.url', - 'DocumentReference.content.format', - 'DocumentReference.context', - 'DocumentReference.context.encounter', - 'DocumentReference.context.period' - ] - must_support_elements.each do |path| - @documentreference_ary&.each do |resource| - truncated_path = path.gsub('DocumentReference.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @documentreference_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided DocumentReference resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '15' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@documentreference) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb deleted file mode 100644 index 848a8a636..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb +++ /dev/null @@ -1,368 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300EncounterSequence < SequenceBase - title 'Encounter Tests' - - description 'Verify that Encounter resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCE' - - requires :token, :patient_id - conformance_supports :Encounter - - def validate_resource_item(resource, property, value) - case property - - when '_id' - value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } - assert value_found, '_id on resource does not match _id requested' - - when 'class' - value_found = can_resolve_path(resource, 'local_class.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'class on resource does not match class requested' - - when 'date' - value_found = can_resolve_path(resource, 'period') do |period| - validate_period_search(value, period) - end - assert value_found, 'date on resource does not match date requested' - - when 'identifier' - value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } - assert value_found, 'identifier on resource does not match identifier requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'type' - value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'type on resource does not match type requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Encounter search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Encounter search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @encounter = reply&.resource&.entry&.first&.resource - @encounter_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Encounter'), reply) - save_delayed_sequence_references(@encounter_ary) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - end - - test 'Server returns expected results from Encounter search by _id' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - id_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'id')) - search_params = { '_id': id_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by date+patient' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - date_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'period')) - patient_val = @instance.patient_id - search_params = { 'date': date_val, 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'date': comparator_val, 'patient': patient_val } - reply = get_resource_by_params(versioned_resource_class('Encounter'), comparator_search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Encounter search by identifier' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - identifier_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'identifier')) - search_params = { 'identifier': identifier_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by patient+status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by class+patient' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - class_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'local_class')) - patient_val = @instance.patient_id - search_params = { 'class': class_val, 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by patient+type' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Encounter read resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@encounter, versioned_resource_class('Encounter')) - end - - test 'Encounter vread resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@encounter, versioned_resource_class('Encounter')) - end - - test 'Encounter history resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@encounter, versioned_resource_class('Encounter')) - end - - test 'Encounter resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '12' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Encounter') - end - - test 'At least one of every must support element is provided in any Encounter for this patient.' do - metadata do - id '13' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @encounter_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Encounter.identifier', - 'Encounter.identifier.system', - 'Encounter.identifier.value', - 'Encounter.status', - 'Encounter.local_class', - 'Encounter.type', - 'Encounter.subject', - 'Encounter.participant', - 'Encounter.participant.type', - 'Encounter.participant.period', - 'Encounter.participant.individual', - 'Encounter.period', - 'Encounter.reasonCode', - 'Encounter.hospitalization', - 'Encounter.hospitalization.dischargeDisposition', - 'Encounter.location', - 'Encounter.location.location' - ] - must_support_elements.each do |path| - @encounter_ary&.each do |resource| - truncated_path = path.gsub('Encounter.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @encounter_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Encounter resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '14' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@encounter) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb deleted file mode 100644 index 7f3eec716..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb +++ /dev/null @@ -1,253 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300GoalSequence < SequenceBase - title 'Goal Tests' - - description 'Verify that Goal resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCG' - - requires :token, :patient_id - conformance_supports :Goal - - def validate_resource_item(resource, property, value) - case property - - when 'lifecycle-status' - value_found = can_resolve_path(resource, 'lifecycleStatus') { |value_in_resource| value_in_resource == value } - assert value_found, 'lifecycle-status on resource does not match lifecycle-status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'target-date' - value_found = can_resolve_path(resource, 'target.dueDate') do |date| - validate_date_search(value, date) - end - assert value_found, 'target-date on resource does not match target-date requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Goal search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Goal search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @goal = reply&.resource&.entry&.first&.resource - @goal_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Goal'), reply) - save_delayed_sequence_references(@goal_ary) - validate_search_reply(versioned_resource_class('Goal'), reply, search_params) - end - - test 'Server returns expected results from Goal search by patient+target-date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@goal.nil?, 'Expected valid Goal resource to be present' - - patient_val = @instance.patient_id - target_date_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'target.dueDate')) - search_params = { 'patient': patient_val, 'target-date': target_date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - validate_search_reply(versioned_resource_class('Goal'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, target_date_val) - comparator_search_params = { 'patient': patient_val, 'target-date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Goal'), comparator_search_params) - validate_search_reply(versioned_resource_class('Goal'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Goal search by patient+lifecycle-status' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@goal.nil?, 'Expected valid Goal resource to be present' - - patient_val = @instance.patient_id - lifecycle_status_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'lifecycleStatus')) - search_params = { 'patient': patient_val, 'lifecycle-status': lifecycle_status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - validate_search_reply(versioned_resource_class('Goal'), reply, search_params) - assert_response_ok(reply) - end - - test 'Goal read resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@goal, versioned_resource_class('Goal')) - end - - test 'Goal vread resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@goal, versioned_resource_class('Goal')) - end - - test 'Goal history resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@goal, versioned_resource_class('Goal')) - end - - test 'Goal resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '08' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Goal') - end - - test 'At least one of every must support element is provided in any Goal for this patient.' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @goal_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Goal.lifecycleStatus', - 'Goal.description', - 'Goal.subject', - 'Goal.target', - 'Goal.target.dueDate', - 'Goal.target.dueDuration' - ] - must_support_elements.each do |path| - @goal_ary&.each do |resource| - truncated_path = path.gsub('Goal.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @goal_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Goal resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@goal) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb deleted file mode 100644 index 3dad84c88..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb +++ /dev/null @@ -1,254 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300ImmunizationSequence < SequenceBase - title 'Immunization Tests' - - description 'Verify that Immunization resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCI' - - requires :token, :patient_id - conformance_supports :Immunization - - def validate_resource_item(resource, property, value) - case property - - when 'patient' - value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'date' - value_found = can_resolve_path(resource, 'occurrenceDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Immunization search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Immunization search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @immunization = reply&.resource&.entry&.first&.resource - @immunization_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Immunization'), reply) - save_delayed_sequence_references(@immunization_ary) - validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) - end - - test 'Server returns expected results from Immunization search by patient+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@immunization.nil?, 'Expected valid Immunization resource to be present' - - patient_val = @instance.patient_id - date_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Immunization'), comparator_search_params) - validate_search_reply(versioned_resource_class('Immunization'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Immunization search by patient+status' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@immunization.nil?, 'Expected valid Immunization resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) - assert_response_ok(reply) - end - - test 'Immunization read resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@immunization, versioned_resource_class('Immunization')) - end - - test 'Immunization vread resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@immunization, versioned_resource_class('Immunization')) - end - - test 'Immunization history resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@immunization, versioned_resource_class('Immunization')) - end - - test 'Immunization resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '08' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Immunization') - end - - test 'At least one of every must support element is provided in any Immunization for this patient.' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @immunization_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Immunization.status', - 'Immunization.statusReason', - 'Immunization.vaccineCode', - 'Immunization.patient', - 'Immunization.occurrenceDateTime', - 'Immunization.occurrenceString', - 'Immunization.primarySource' - ] - must_support_elements.each do |path| - @immunization_ary&.each do |resource| - truncated_path = path.gsub('Immunization.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @immunization_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Immunization resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@immunization) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb deleted file mode 100644 index 735887720..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb +++ /dev/null @@ -1,303 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300LocationSequence < SequenceBase - title 'Location Tests' - - description 'Verify that Location resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCL' - - requires :token - conformance_supports :Location - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'name' - value_found = can_resolve_path(resource, 'name') { |value_in_resource| value_in_resource == value } - assert value_found, 'name on resource does not match name requested' - - when 'address' - value_found = can_resolve_path(resource, 'address') do |address| - address&.text&.start_with?(value) || - address&.city&.start_with?(value) || - address&.state&.start_with?(value) || - address&.postalCode&.start_with?(value) || - address&.country&.start_with?(value) - end - assert value_found, 'address on resource does not match address requested' - - when 'address-city' - value_found = can_resolve_path(resource, 'address.city') { |value_in_resource| value_in_resource == value } - assert value_found, 'address-city on resource does not match address-city requested' - - when 'address-state' - value_found = can_resolve_path(resource, 'address.state') { |value_in_resource| value_in_resource == value } - assert value_found, 'address-state on resource does not match address-state requested' - - when 'address-postalcode' - value_found = can_resolve_path(resource, 'address.postalCode') { |value_in_resource| value_in_resource == value } - assert value_found, 'address-postalcode on resource does not match address-postalcode requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read Location from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - location_id = @instance.resource_references.find { |reference| reference.resource_type == 'Location' }&.resource_id - skip 'No Location references found from the prior searches' if location_id.nil? - @location = fetch_resource('Location', location_id) - @location_ary = Array.wrap(@location) - @resources_found = !@location.nil? - end - - test 'Server rejects Location search without authorization' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Location search by name' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @location = reply&.resource&.entry&.first&.resource - @location_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Location'), reply) - save_delayed_sequence_references(@location_ary) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - end - - test 'Server returns expected results from Location search by address' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address')) - search_params = { 'address': address_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Location search by address-city' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_city_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.city')) - search_params = { 'address-city': address_city_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Location search by address-state' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_state_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.state')) - search_params = { 'address-state': address_state_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Location search by address-postalcode' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_postalcode_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.postalCode')) - search_params = { 'address-postalcode': address_postalcode_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Location vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Location, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@location, versioned_resource_class('Location')) - end - - test 'Location history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Location, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@location, versioned_resource_class('Location')) - end - - test 'Location resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-location' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Location') - end - - test 'At least one of every must support element is provided in any Location for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @location_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Location.status', - 'Location.name', - 'Location.telecom', - 'Location.address', - 'Location.address.line', - 'Location.address.city', - 'Location.address.state', - 'Location.address.postalCode', - 'Location.managingOrganization' - ] - must_support_elements.each do |path| - @location_ary&.each do |resource| - truncated_path = path.gsub('Location.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @location_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Location resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Location, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@location) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medication_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medication_sequence.rb deleted file mode 100644 index 1bbc2d208..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_medication_sequence.rb +++ /dev/null @@ -1,126 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300MedicationSequence < SequenceBase - title 'Medication Tests' - - description 'Verify that Medication resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCM' - - requires :token - conformance_supports :Medication - delayed_sequence - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read Medication from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - medication_id = @instance.resource_references.find { |reference| reference.resource_type == 'Medication' }&.resource_id - skip 'No Medication references found from the prior searches' if medication_id.nil? - @medication = fetch_resource('Medication', medication_id) - @medication_ary = Array.wrap(@medication) - @resources_found = !@medication.nil? - end - - test 'Medication vread resource supported' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Medication, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@medication, versioned_resource_class('Medication')) - end - - test 'Medication history resource supported' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Medication, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@medication, versioned_resource_class('Medication')) - end - - test 'Medication resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '04' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Medication') - end - - test 'At least one of every must support element is provided in any Medication for this patient.' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medication_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Medication.code' - ] - must_support_elements.each do |path| - @medication_ary&.each do |resource| - truncated_path = path.gsub('Medication.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @medication_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Medication resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '06' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Medication, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@medication) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb deleted file mode 100644 index 9d132d97d..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb +++ /dev/null @@ -1,265 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300MedicationrequestSequence < SequenceBase - title 'MedicationRequest Tests' - - description 'Verify that MedicationRequest resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCMR' - - requires :token, :patient_id - conformance_supports :MedicationRequest - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'authoredon' - value_found = can_resolve_path(resource, 'authoredOn') { |value_in_resource| value_in_resource == value } - assert value_found, 'authoredon on resource does not match authoredon requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects MedicationRequest search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from MedicationRequest search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @medicationrequest = reply&.resource&.entry&.first&.resource - @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) - save_delayed_sequence_references(@medicationrequest_ary) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) - end - - test 'Server returns expected results from MedicationRequest search by patient+status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from MedicationRequest search by patient+authoredon' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' - - patient_val = @instance.patient_id - authoredon_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'authoredOn')) - search_params = { 'patient': patient_val, 'authoredon': authoredon_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) - assert_response_ok(reply) - end - - test 'MedicationRequest read resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) - end - - test 'MedicationRequest vread resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) - end - - test 'MedicationRequest history resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) - end - - test 'Server returns the appropriate resource from the following _includes: MedicationRequest:medication' do - metadata do - id '08' - link 'https://www.hl7.org/fhir/search.html#include' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_include'] = 'MedicationRequest:medication' - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } - assert medication_results, 'No Medication resources were returned from this search' - end - - test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '09' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('MedicationRequest') - end - - test 'At least one of every must support element is provided in any MedicationRequest for this patient.' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medicationrequest_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'MedicationRequest.status', - 'MedicationRequest.medicationCodeableConcept', - 'MedicationRequest.medicationReference', - 'MedicationRequest.subject', - 'MedicationRequest.authoredOn', - 'MedicationRequest.requester', - 'MedicationRequest.dosageInstruction', - 'MedicationRequest.dosageInstruction.text' - ] - must_support_elements.each do |path| - @medicationrequest_ary&.each do |resource| - truncated_path = path.gsub('MedicationRequest.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @medicationrequest_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided MedicationRequest resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@medicationrequest) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb deleted file mode 100644 index bf31c25f7..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb +++ /dev/null @@ -1,276 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300MedicationstatementSequence < SequenceBase - title 'MedicationStatement Tests' - - description 'Verify that MedicationStatement resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCMS' - - requires :token, :patient_id - conformance_supports :MedicationStatement - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'effective' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'effective on resource does not match effective requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects MedicationStatement search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from MedicationStatement search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @medicationstatement = reply&.resource&.entry&.first&.resource - @medicationstatement_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('MedicationStatement'), reply) - save_delayed_sequence_references(@medicationstatement_ary) - validate_search_reply(versioned_resource_class('MedicationStatement'), reply, search_params) - end - - test 'Server returns expected results from MedicationStatement search by patient+effective' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationstatement.nil?, 'Expected valid MedicationStatement resource to be present' - - patient_val = @instance.patient_id - effective_val = get_value_for_search_param(resolve_element_from_path(@medicationstatement_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'effective': effective_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) - validate_search_reply(versioned_resource_class('MedicationStatement'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, effective_val) - comparator_search_params = { 'patient': patient_val, 'effective': comparator_val } - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), comparator_search_params) - validate_search_reply(versioned_resource_class('MedicationStatement'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from MedicationStatement search by patient+status' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationstatement.nil?, 'Expected valid MedicationStatement resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@medicationstatement_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) - validate_search_reply(versioned_resource_class('MedicationStatement'), reply, search_params) - assert_response_ok(reply) - end - - test 'MedicationStatement read resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationStatement, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) - end - - test 'MedicationStatement vread resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationStatement, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) - end - - test 'MedicationStatement history resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationStatement, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) - end - - test 'Server returns the appropriate resource from the following _includes: MedicationStatement:medication' do - metadata do - id '08' - link 'https://www.hl7.org/fhir/search.html#include' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_include'] = 'MedicationStatement:medication' - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } - assert medication_results, 'No Medication resources were returned from this search' - end - - test 'MedicationStatement resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '09' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationstatement' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('MedicationStatement') - end - - test 'At least one of every must support element is provided in any MedicationStatement for this patient.' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medicationstatement_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'MedicationStatement.status', - 'MedicationStatement.medicationCodeableConcept', - 'MedicationStatement.medicationReference', - 'MedicationStatement.subject', - 'MedicationStatement.effectiveDateTime', - 'MedicationStatement.effectivePeriod', - 'MedicationStatement.dateAsserted', - 'MedicationStatement.derivedFrom' - ] - must_support_elements.each do |path| - @medicationstatement_ary&.each do |resource| - truncated_path = path.gsub('MedicationStatement.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @medicationstatement_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided MedicationStatement resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationStatement, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@medicationstatement) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb deleted file mode 100644 index 70f9732db..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb +++ /dev/null @@ -1,324 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300ObservationLabSequence < SequenceBase - title 'Laboratory Result Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCLRO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Observation search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'laboratory' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, category: 'laboratory' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.category', - 'Observation.code', - 'Observation.subject', - 'Observation.effectiveDateTime', - 'Observation.effectivePeriod', - 'Observation.valueQuantity', - 'Observation.valueCodeableConcept', - 'Observation.valueString', - 'Observation.valueBoolean', - 'Observation.valueInteger', - 'Observation.valueRange', - 'Observation.valueRatio', - 'Observation.valueSampledData', - 'Observation.valueTime', - 'Observation.valueDateTime', - 'Observation.valuePeriod', - 'Observation.dataAbsentReason' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb deleted file mode 100644 index c4e234494..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb +++ /dev/null @@ -1,228 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300OrganizationSequence < SequenceBase - title 'Organization Tests' - - description 'Verify that Organization resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCO' - - requires :token - conformance_supports :Organization - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'name' - value_found = can_resolve_path(resource, 'name') { |value_in_resource| value_in_resource == value } - assert value_found, 'name on resource does not match name requested' - - when 'address' - value_found = can_resolve_path(resource, 'address') do |address| - address&.text&.start_with?(value) || - address&.city&.start_with?(value) || - address&.state&.start_with?(value) || - address&.postalCode&.start_with?(value) || - address&.country&.start_with?(value) - end - assert value_found, 'address on resource does not match address requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read Organization from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - organization_id = @instance.resource_references.find { |reference| reference.resource_type == 'Organization' }&.resource_id - skip 'No Organization references found from the prior searches' if organization_id.nil? - @organization = fetch_resource('Organization', organization_id) - @organization_ary = Array.wrap(@organization) - @resources_found = !@organization.nil? - end - - test 'Server rejects Organization search without authorization' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Organization search by name' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @organization = reply&.resource&.entry&.first&.resource - @organization_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Organization'), reply) - save_delayed_sequence_references(@organization_ary) - validate_search_reply(versioned_resource_class('Organization'), reply, search_params) - end - - test 'Server returns expected results from Organization search by address' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@organization.nil?, 'Expected valid Organization resource to be present' - - address_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'address')) - search_params = { 'address': address_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) - validate_search_reply(versioned_resource_class('Organization'), reply, search_params) - assert_response_ok(reply) - end - - test 'Organization vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Organization, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@organization, versioned_resource_class('Organization')) - end - - test 'Organization history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Organization, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@organization, versioned_resource_class('Organization')) - end - - test 'Organization resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '07' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Organization') - end - - test 'At least one of every must support element is provided in any Organization for this patient.' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @organization_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Organization.identifier', - 'Organization.identifier.system', - 'Organization.active', - 'Organization.name', - 'Organization.telecom', - 'Organization.address', - 'Organization.address.line', - 'Organization.address.city', - 'Organization.address.state', - 'Organization.address.postalCode', - 'Organization.address.country', - 'Organization.endpoint' - ] - must_support_elements.each do |path| - @organization_ary&.each do |resource| - truncated_path = path.gsub('Organization.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @organization_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Organization resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Organization, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@organization) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb deleted file mode 100644 index 0588aca4b..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb +++ /dev/null @@ -1,376 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300PatientSequence < SequenceBase - title 'Patient Tests' - - description 'Verify that Patient resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCP' - - requires :token, :patient_id - conformance_supports :Patient - - def validate_resource_item(resource, property, value) - case property - - when '_id' - value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } - assert value_found, '_id on resource does not match _id requested' - - when 'birthdate' - value_found = can_resolve_path(resource, 'birthDate') do |date| - validate_date_search(value, date) - end - assert value_found, 'birthdate on resource does not match birthdate requested' - - when 'family' - value_found = can_resolve_path(resource, 'name.family') { |value_in_resource| value_in_resource == value } - assert value_found, 'family on resource does not match family requested' - - when 'gender' - value_found = can_resolve_path(resource, 'gender') { |value_in_resource| value_in_resource == value } - assert value_found, 'gender on resource does not match gender requested' - - when 'given' - value_found = can_resolve_path(resource, 'name.given') { |value_in_resource| value_in_resource == value } - assert value_found, 'given on resource does not match given requested' - - when 'identifier' - value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } - assert value_found, 'identifier on resource does not match identifier requested' - - when 'name' - value = value.downcase - value_found = can_resolve_path(resource, 'name') do |name| - name&.text&.start_with?(value) || - name&.family&.downcase&.include?(value) || - name&.given&.any? { |given| given.downcase.start_with?(value) } || - name&.prefix&.any? { |prefix| prefix.downcase.start_with?(value) } || - name&.suffix&.any? { |suffix| suffix.downcase.start_with?(value) } - end - assert value_found, 'name on resource does not match name requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Patient search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { '_id': @instance.patient_id } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Patient search by _id' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { '_id': @instance.patient_id } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @patient = reply&.resource&.entry&.first&.resource - @patient_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Patient'), reply) - save_delayed_sequence_references(@patient_ary) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - end - - test 'Server returns expected results from Patient search by identifier' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - identifier_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'identifier')) - search_params = { 'identifier': identifier_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by name' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by birthdate+name' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'birthdate': birthdate_val, 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by gender+name' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'gender': gender_val, 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by family+gender' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) - gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) - search_params = { 'family': family_val, 'gender': gender_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by birthdate+family' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) - family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) - search_params = { 'birthdate': birthdate_val, 'family': family_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Patient read resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@patient, versioned_resource_class('Patient')) - end - - test 'Patient vread resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@patient, versioned_resource_class('Patient')) - end - - test 'Patient history resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@patient, versioned_resource_class('Patient')) - end - - test 'Patient resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '12' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Patient') - end - - test 'At least one of every must support element is provided in any Patient for this patient.' do - metadata do - id '13' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @patient_ary&.any? - must_support_confirmed = {} - extensions_list = { - 'Patient.extension:race': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race', - 'Patient.extension:ethnicity': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity', - 'Patient.extension:birthsex': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex' - } - extensions_list.each do |id, url| - @patient_ary&.each do |resource| - must_support_confirmed[id] = true if resource.extension.any? { |extension| extension.url == url } - break if must_support_confirmed[id] - end - skip_notification = "Could not find #{id} in any of the #{@patient_ary.length} provided Patient resource(s)" - skip skip_notification unless must_support_confirmed[id] - end - - must_support_elements = [ - 'Patient.identifier', - 'Patient.identifier.system', - 'Patient.identifier.value', - 'Patient.name', - 'Patient.name.family', - 'Patient.name.given', - 'Patient.telecom', - 'Patient.telecom.system', - 'Patient.telecom.value', - 'Patient.gender', - 'Patient.birthDate', - 'Patient.address', - 'Patient.address.line', - 'Patient.address.city', - 'Patient.address.state', - 'Patient.address.postalCode', - 'Patient.communication', - 'Patient.communication.language' - ] - must_support_elements.each do |path| - @patient_ary&.each do |resource| - truncated_path = path.gsub('Patient.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @patient_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Patient resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '14' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@patient) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb deleted file mode 100644 index ca09ae8e9..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb +++ /dev/null @@ -1,224 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300PractitionerSequence < SequenceBase - title 'Practitioner Tests' - - description 'Verify that Practitioner resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPR' - - requires :token - conformance_supports :Practitioner - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'name' - value = value.downcase - value_found = can_resolve_path(resource, 'name') do |name| - name&.text&.start_with?(value) || - name&.family&.downcase&.include?(value) || - name&.given&.any? { |given| given.downcase.start_with?(value) } || - name&.prefix&.any? { |prefix| prefix.downcase.start_with?(value) } || - name&.suffix&.any? { |suffix| suffix.downcase.start_with?(value) } - end - assert value_found, 'name on resource does not match name requested' - - when 'identifier' - value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } - assert value_found, 'identifier on resource does not match identifier requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read Practitioner from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - practitioner_id = @instance.resource_references.find { |reference| reference.resource_type == 'Practitioner' }&.resource_id - skip 'No Practitioner references found from the prior searches' if practitioner_id.nil? - @practitioner = fetch_resource('Practitioner', practitioner_id) - @practitioner_ary = Array.wrap(@practitioner) - @resources_found = !@practitioner.nil? - end - - test 'Server rejects Practitioner search without authorization' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Practitioner search by name' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @practitioner = reply&.resource&.entry&.first&.resource - @practitioner_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Practitioner'), reply) - save_delayed_sequence_references(@practitioner_ary) - validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) - end - - test 'Server returns expected results from Practitioner search by identifier' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@practitioner.nil?, 'Expected valid Practitioner resource to be present' - - identifier_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'identifier')) - search_params = { 'identifier': identifier_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) - validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) - assert_response_ok(reply) - end - - test 'Practitioner vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Practitioner, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@practitioner, versioned_resource_class('Practitioner')) - end - - test 'Practitioner history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Practitioner, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@practitioner, versioned_resource_class('Practitioner')) - end - - test 'Practitioner resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '07' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Practitioner') - end - - test 'At least one of every must support element is provided in any Practitioner for this patient.' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitioner_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Practitioner.identifier', - 'Practitioner.identifier.system', - 'Practitioner.identifier.value', - 'Practitioner.identifier', - 'Practitioner.identifier.system', - 'Practitioner.name', - 'Practitioner.name.family' - ] - must_support_elements.each do |path| - @practitioner_ary&.each do |resource| - truncated_path = path.gsub('Practitioner.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @practitioner_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Practitioner resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Practitioner, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@practitioner) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb deleted file mode 100644 index f8e6cf2d8..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb +++ /dev/null @@ -1,247 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300PractitionerroleSequence < SequenceBase - title 'PractitionerRole Tests' - - description 'Verify that PractitionerRole resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPRO' - - requires :token - conformance_supports :PractitionerRole - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'specialty' - value_found = can_resolve_path(resource, 'specialty.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'specialty on resource does not match specialty requested' - - when 'practitioner' - value_found = can_resolve_path(resource, 'practitioner.reference') { |value_in_resource| value_in_resource == value } - assert value_found, 'practitioner on resource does not match practitioner requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read PractitionerRole from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - practitionerrole_id = @instance.resource_references.find { |reference| reference.resource_type == 'PractitionerRole' }&.resource_id - skip 'No PractitionerRole references found from the prior searches' if practitionerrole_id.nil? - @practitionerrole = fetch_resource('PractitionerRole', practitionerrole_id) - @practitionerrole_ary = Array.wrap(@practitionerrole) - @resources_found = !@practitionerrole.nil? - end - - test 'Server rejects PractitionerRole search without authorization' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from PractitionerRole search by specialty' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @practitionerrole = reply&.resource&.entry&.first&.resource - @practitionerrole_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('PractitionerRole'), reply) - save_delayed_sequence_references(@practitionerrole_ary) - validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) - end - - test 'Server returns expected results from PractitionerRole search by practitioner' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@practitionerrole.nil?, 'Expected valid PractitionerRole resource to be present' - - practitioner_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'practitioner')) - search_params = { 'practitioner': practitioner_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) - assert_response_ok(reply) - end - - test 'PractitionerRole vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:PractitionerRole, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) - end - - test 'PractitionerRole history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:PractitionerRole, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) - end - - test 'Server returns the appropriate resource from the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do - metadata do - id '07' - link 'https://www.hl7.org/fhir/search.html#include' - description %( - ) - versions :r4 - end - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_include'] = 'PractitionerRole:endpoint' - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - endpoint_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Endpoint' } - assert endpoint_results, 'No Endpoint resources were returned from this search' - - search_params['_include'] = 'PractitionerRole:practitioner' - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - practitioner_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Practitioner' } - assert practitioner_results, 'No Practitioner resources were returned from this search' - end - - test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '08' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('PractitionerRole') - end - - test 'At least one of every must support element is provided in any PractitionerRole for this patient.' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitionerrole_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'PractitionerRole.practitioner', - 'PractitionerRole.organization', - 'PractitionerRole.code', - 'PractitionerRole.specialty', - 'PractitionerRole.location', - 'PractitionerRole.telecom', - 'PractitionerRole.telecom.system', - 'PractitionerRole.telecom.value', - 'PractitionerRole.endpoint' - ] - must_support_elements.each do |path| - @practitionerrole_ary&.each do |resource| - truncated_path = path.gsub('PractitionerRole.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @practitionerrole_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided PractitionerRole resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:PractitionerRole, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@practitionerrole) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb deleted file mode 100644 index c1e6c605f..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb +++ /dev/null @@ -1,287 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300ProcedureSequence < SequenceBase - title 'Procedure Tests' - - description 'Verify that Procedure resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPROC' - - requires :token, :patient_id - conformance_supports :Procedure - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'date' - value_found = can_resolve_path(resource, 'occurrenceDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Procedure search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Procedure search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @procedure = reply&.resource&.entry&.first&.resource - @procedure_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Procedure'), reply) - save_delayed_sequence_references(@procedure_ary) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - end - - test 'Server returns expected results from Procedure search by patient+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - - patient_val = @instance.patient_id - date_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Procedure'), comparator_search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Procedure search by patient+code+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Procedure'), comparator_search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Procedure search by patient+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - assert_response_ok(reply) - end - - test 'Procedure read resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@procedure, versioned_resource_class('Procedure')) - end - - test 'Procedure vread resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@procedure, versioned_resource_class('Procedure')) - end - - test 'Procedure history resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@procedure, versioned_resource_class('Procedure')) - end - - test 'Procedure resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '09' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Procedure') - end - - test 'At least one of every must support element is provided in any Procedure for this patient.' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @procedure_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Procedure.status', - 'Procedure.code', - 'Procedure.subject', - 'Procedure.performedDateTime', - 'Procedure.performedPeriod' - ] - must_support_elements.each do |path| - @procedure_ary&.each do |resource| - truncated_path = path.gsub('Procedure.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @procedure_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Procedure resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@procedure) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb deleted file mode 100644 index fadec6939..000000000 --- a/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb +++ /dev/null @@ -1,311 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300SmokingstatusSequence < SequenceBase - title 'Smoking Status Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCSSO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Observation search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '72166-2' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '72166-2' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Observation'), comparator_search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.code', - 'Observation.subject', - 'Observation.issued', - 'Observation.valueCodeableConcept' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.0_module.yml b/lib/app/modules/uscore_v3.0.0_module.yml deleted file mode 100644 index 672e59439..000000000 --- a/lib/app/modules/uscore_v3.0.0_module.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: uscore_v3.0.0 -title: US Core R4 v3.0.0 -description : US Core R4 v3.0.0 -fhir_version: r4 -default_test_set: ad_hoc_testing -test_sets: - ad_hoc_testing: - view: default - tests: - - name: Discovery - sequences: - - UsCoreR4CapabilityStatementSequence - - SMARTDiscoverySequence - run_all: true - - name: Authorization and Authentication - sequences: - - DynamicRegistrationSequence - - ManualRegistrationSequence - - StandaloneLaunchSequence - - EHRLaunchSequence - - name: US Core R4 Patient Based Profiles - run_all: true - sequences: - - USCore300AllergyintoleranceSequence - - USCore300CareplanSequence - - USCore300CareteamSequence - - USCore300ConditionSequence - - USCore300DeviceSequence - - USCore300DiagnosticreportNoteSequence - - USCore300DiagnosticreportLabSequence - - USCore300DocumentreferenceSequence - - USCore300EncounterSequence - - USCore300GoalSequence - - USCore300ImmunizationSequence - - USCore300MedicationrequestSequence - - USCore300MedicationstatementSequence - - USCore300SmokingstatusSequence - - USCore300PediatricWeightForHeightSequence - - USCore300ObservationLabSequence - - USCore300PediatricBmiForAgeSequence - - USCore300PatientSequence - - USCore300ProcedureSequence - - R4ProvenanceSequence - - USCoreR4ClinicalNotesSequence - - USCore300LocationSequence - - USCore300MedicationSequence - - USCore300OrganizationSequence - - USCore300PractitionerSequence - - USCore300PractitionerroleSequence diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb deleted file mode 100644 index 6ee9522dd..000000000 --- a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb +++ /dev/null @@ -1,338 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301PediatricBmiForAgeSequence < SequenceBase - title 'Pediatric BMI for Age Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPBMIAO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Observation search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '59576-9' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '59576-9' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '59576-9' } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.category', - 'Observation.category', - 'Observation.category.coding', - 'Observation.category.coding.system', - 'Observation.category.coding.code', - 'Observation.subject', - 'Observation.effectiveDateTime', - 'Observation.effectivePeriod', - 'Observation.valueQuantity', - 'Observation.valueQuantity.value', - 'Observation.valueQuantity.unit', - 'Observation.valueQuantity.system', - 'Observation.valueQuantity.code', - 'Observation.dataAbsentReason', - 'Observation.component', - 'Observation.component.code', - 'Observation.component.valueQuantity', - 'Observation.component.valueCodeableConcept', - 'Observation.component.valueString', - 'Observation.component.valueBoolean', - 'Observation.component.valueInteger', - 'Observation.component.valueRange', - 'Observation.component.valueRatio', - 'Observation.component.valueSampledData', - 'Observation.component.valueTime', - 'Observation.component.valueDateTime', - 'Observation.component.valuePeriod', - 'Observation.component.dataAbsentReason' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb deleted file mode 100644 index c982fa0b9..000000000 --- a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb +++ /dev/null @@ -1,338 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301PediatricWeightForHeightSequence < SequenceBase - title 'Pediatric Weight for Height Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPWHO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Observation search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '77606-2' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '77606-2' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '77606-2' } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.category', - 'Observation.category', - 'Observation.category.coding', - 'Observation.category.coding.system', - 'Observation.category.coding.code', - 'Observation.subject', - 'Observation.effectiveDateTime', - 'Observation.effectivePeriod', - 'Observation.valueQuantity', - 'Observation.valueQuantity.value', - 'Observation.valueQuantity.unit', - 'Observation.valueQuantity.system', - 'Observation.valueQuantity.code', - 'Observation.dataAbsentReason', - 'Observation.component', - 'Observation.component.code', - 'Observation.component.valueQuantity', - 'Observation.component.valueCodeableConcept', - 'Observation.component.valueString', - 'Observation.component.valueBoolean', - 'Observation.component.valueInteger', - 'Observation.component.valueRange', - 'Observation.component.valueRatio', - 'Observation.component.valueSampledData', - 'Observation.component.valueTime', - 'Observation.component.valueDateTime', - 'Observation.component.valuePeriod', - 'Observation.component.dataAbsentReason' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb deleted file mode 100644 index bf0b47cdf..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb +++ /dev/null @@ -1,235 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301AllergyintoleranceSequence < SequenceBase - title 'AllergyIntolerance Tests' - - description 'Verify that AllergyIntolerance resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCAI' - - requires :token, :patient_id - conformance_supports :AllergyIntolerance - - def validate_resource_item(resource, property, value) - case property - - when 'clinical-status' - value_found = can_resolve_path(resource, 'clinicalStatus.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'clinical-status on resource does not match clinical-status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects AllergyIntolerance search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from AllergyIntolerance search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @allergyintolerance = reply&.resource&.entry&.first&.resource - @allergyintolerance_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('AllergyIntolerance'), reply) - save_delayed_sequence_references(@allergyintolerance_ary) - validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) - end - - test 'Server returns expected results from AllergyIntolerance search by patient+clinical-status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@allergyintolerance.nil?, 'Expected valid AllergyIntolerance resource to be present' - - patient_val = @instance.patient_id - clinical_status_val = get_value_for_search_param(resolve_element_from_path(@allergyintolerance_ary, 'clinicalStatus')) - search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) - validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) - assert_response_ok(reply) - end - - test 'AllergyIntolerance read resource supported' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) - end - - test 'AllergyIntolerance vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) - end - - test 'AllergyIntolerance history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '07' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'AllergyIntolerance resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '08' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('AllergyIntolerance') - end - - test 'At least one of every must support element is provided in any AllergyIntolerance for this patient.' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @allergyintolerance_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'AllergyIntolerance.clinicalStatus', - 'AllergyIntolerance.verificationStatus', - 'AllergyIntolerance.code', - 'AllergyIntolerance.patient' - ] - must_support_elements.each do |path| - @allergyintolerance_ary&.each do |resource| - truncated_path = path.gsub('AllergyIntolerance.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @allergyintolerance_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided AllergyIntolerance resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@allergyintolerance) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb deleted file mode 100644 index 81ae5eca0..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb +++ /dev/null @@ -1,308 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301CareplanSequence < SequenceBase - title 'CarePlan Tests' - - description 'Verify that CarePlan resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCCP' - - requires :token, :patient_id - conformance_supports :CarePlan - - def validate_resource_item(resource, property, value) - case property - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'date' - value_found = can_resolve_path(resource, 'period') do |period| - validate_period_search(value, period) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects CarePlan search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'assess-plan' } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from CarePlan search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, category: 'assess-plan' } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @careplan = reply&.resource&.entry&.first&.resource - @careplan_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) - save_delayed_sequence_references(@careplan_ary) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - end - - test 'Server returns expected results from CarePlan search by patient+category+status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from CarePlan search by patient+category+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from CarePlan search by patient+category+status+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) - date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'CarePlan read resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@careplan, versioned_resource_class('CarePlan')) - end - - test 'CarePlan vread resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@careplan, versioned_resource_class('CarePlan')) - end - - test 'CarePlan history resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@careplan, versioned_resource_class('CarePlan')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, category: 'assess-plan' } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'CarePlan resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('CarePlan') - end - - test 'At least one of every must support element is provided in any CarePlan for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careplan_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'CarePlan.text', - 'CarePlan.text.status', - 'CarePlan.status', - 'CarePlan.intent', - 'CarePlan.category', - 'CarePlan.category', - 'CarePlan.subject' - ] - must_support_elements.each do |path| - @careplan_ary&.each do |resource| - truncated_path = path.gsub('CarePlan.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @careplan_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided CarePlan resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@careplan) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb deleted file mode 100644 index 0788b0168..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb +++ /dev/null @@ -1,207 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301CareteamSequence < SequenceBase - title 'CareTeam Tests' - - description 'Verify that CareTeam resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCCT' - - requires :token, :patient_id - conformance_supports :CareTeam - - def validate_resource_item(resource, property, value) - case property - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects CareTeam search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, status: 'active' } - - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from CareTeam search by patient+status' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, status: 'active' } - - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @careteam = reply&.resource&.entry&.first&.resource - @careteam_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) - save_delayed_sequence_references(@careteam_ary) - validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) - end - - test 'CareTeam read resource supported' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@careteam, versioned_resource_class('CareTeam')) - end - - test 'CareTeam vread resource supported' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@careteam, versioned_resource_class('CareTeam')) - end - - test 'CareTeam history resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@careteam, versioned_resource_class('CareTeam')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '06' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, status: 'active' } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'CareTeam resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '07' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('CareTeam') - end - - test 'At least one of every must support element is provided in any CareTeam for this patient.' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careteam_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'CareTeam.status', - 'CareTeam.subject', - 'CareTeam.participant', - 'CareTeam.participant.role', - 'CareTeam.participant.member' - ] - must_support_elements.each do |path| - @careteam_ary&.each do |resource| - truncated_path = path.gsub('CareTeam.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @careteam_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided CareTeam resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@careteam) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb deleted file mode 100644 index f73176437..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb +++ /dev/null @@ -1,327 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301ConditionSequence < SequenceBase - title 'Condition Tests' - - description 'Verify that Condition resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCC' - - requires :token, :patient_id - conformance_supports :Condition - - def validate_resource_item(resource, property, value) - case property - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'clinical-status' - value_found = can_resolve_path(resource, 'clinicalStatus.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'clinical-status on resource does not match clinical-status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'onset-date' - value_found = can_resolve_path(resource, 'onsetDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'onset-date on resource does not match onset-date requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Condition search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Condition search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @condition = reply&.resource&.entry&.first&.resource - @condition_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Condition'), reply) - save_delayed_sequence_references(@condition_ary) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - end - - test 'Server returns expected results from Condition search by patient+clinical-status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - clinical_status_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'clinicalStatus')) - search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Condition search by patient+onset-date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - onset_date_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'onsetDateTime')) - search_params = { 'patient': patient_val, 'onset-date': onset_date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, onset_date_val) - comparator_search_params = { 'patient': patient_val, 'onset-date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Condition'), comparator_search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Condition search by patient+code' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Condition search by patient+category' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - end - - test 'Condition read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@condition, versioned_resource_class('Condition')) - end - - test 'Condition vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@condition, versioned_resource_class('Condition')) - end - - test 'Condition history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@condition, versioned_resource_class('Condition')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Condition resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Condition') - end - - test 'At least one of every must support element is provided in any Condition for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @condition_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Condition.clinicalStatus', - 'Condition.verificationStatus', - 'Condition.category', - 'Condition.code', - 'Condition.subject' - ] - must_support_elements.each do |path| - @condition_ary&.each do |resource| - truncated_path = path.gsub('Condition.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @condition_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Condition resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@condition) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb deleted file mode 100644 index 6ec20cf7c..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb +++ /dev/null @@ -1,424 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301DiagnosticreportLabSequence < SequenceBase - title 'DiagnosticReport for Laboratory Results Reporting Tests' - - description 'Verify that DiagnosticReport resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCDRLRR' - - requires :token, :patient_id - conformance_supports :DiagnosticReport - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects DiagnosticReport search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'LAB' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, category: 'LAB' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @diagnosticreport = reply&.resource&.entry&.first&.resource - @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - save_delayed_sequence_references(@diagnosticreport_ary) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - end - - test 'Server returns expected results from DiagnosticReport search by patient' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+code' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+status' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { patient: @instance.patient_id, category: 'LAB' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'DiagnosticReport create resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport read resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport vread resource supported' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport history resource supported' do - metadata do - id '13' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '14' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, category: 'LAB' } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '15' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('DiagnosticReport', Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - end - - test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do - metadata do - id '16' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'DiagnosticReport.status', - 'DiagnosticReport.category', - 'DiagnosticReport.category', - 'DiagnosticReport.code', - 'DiagnosticReport.subject', - 'DiagnosticReport.effectiveDateTime', - 'DiagnosticReport.effectivePeriod', - 'DiagnosticReport.issued', - 'DiagnosticReport.performer', - 'DiagnosticReport.result', - 'DiagnosticReport.media', - 'DiagnosticReport.presentedForm' - ] - must_support_elements.each do |path| - @diagnosticreport_ary&.each do |resource| - truncated_path = path.gsub('DiagnosticReport.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @diagnosticreport_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '17' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@diagnosticreport) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb deleted file mode 100644 index d2ecbf49b..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb +++ /dev/null @@ -1,423 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301DiagnosticreportNoteSequence < SequenceBase - title 'DiagnosticReport for Report and Note exchange Tests' - - description 'Verify that DiagnosticReport resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCDRRN' - - requires :token, :patient_id - conformance_supports :DiagnosticReport - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects DiagnosticReport search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @diagnosticreport = reply&.resource&.entry&.first&.resource - @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - save_delayed_sequence_references(@diagnosticreport_ary) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - end - - test 'Server returns expected results from DiagnosticReport search by patient' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+code' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+status' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'DiagnosticReport create resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport read resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport vread resource supported' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport history resource supported' do - metadata do - id '13' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '14' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: 'LP29684-5' } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '15' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('DiagnosticReport', Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - end - - test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do - metadata do - id '16' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'DiagnosticReport.status', - 'DiagnosticReport.category', - 'DiagnosticReport.code', - 'DiagnosticReport.subject', - 'DiagnosticReport.encounter', - 'DiagnosticReport.effectiveDateTime', - 'DiagnosticReport.effectivePeriod', - 'DiagnosticReport.issued', - 'DiagnosticReport.performer', - 'DiagnosticReport.media', - 'DiagnosticReport.presentedForm' - ] - must_support_elements.each do |path| - @diagnosticreport_ary&.each do |resource| - truncated_path = path.gsub('DiagnosticReport.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @diagnosticreport_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '17' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@diagnosticreport) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb deleted file mode 100644 index 800374ed5..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb +++ /dev/null @@ -1,397 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301DocumentreferenceSequence < SequenceBase - title 'DocumentReference Tests' - - description 'Verify that DocumentReference resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCDR' - - requires :token, :patient_id - conformance_supports :DocumentReference - - def validate_resource_item(resource, property, value) - case property - - when '_id' - value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } - assert value_found, '_id on resource does not match _id requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'type' - value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'type on resource does not match type requested' - - when 'date' - value_found = can_resolve_path(resource, 'date') { |value_in_resource| value_in_resource == value } - assert value_found, 'date on resource does not match date requested' - - when 'period' - value_found = can_resolve_path(resource, 'context.period') do |period| - validate_period_search(value, period) - end - assert value_found, 'period on resource does not match period requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects DocumentReference search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from DocumentReference search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @documentreference = reply&.resource&.entry&.first&.resource - @documentreference_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DocumentReference'), reply) - save_delayed_sequence_references(@documentreference_ary) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - end - - test 'Server returns expected results from DocumentReference search by _id' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - id_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'id')) - search_params = { '_id': id_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+category+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'date')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+category' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+type' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+status' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+type+period' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) - period_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'context.period')) - search_params = { 'patient': patient_val, 'type': type_val, 'period': period_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'DocumentReference create resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_create_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference read resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference vread resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference history resource supported' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'DocumentReference resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '14' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('DocumentReference') - end - - test 'At least one of every must support element is provided in any DocumentReference for this patient.' do - metadata do - id '15' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @documentreference_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'DocumentReference.identifier', - 'DocumentReference.status', - 'DocumentReference.type', - 'DocumentReference.category', - 'DocumentReference.subject', - 'DocumentReference.date', - 'DocumentReference.author', - 'DocumentReference.custodian', - 'DocumentReference.content', - 'DocumentReference.content.attachment', - 'DocumentReference.content.attachment.contentType', - 'DocumentReference.content.attachment.data', - 'DocumentReference.content.attachment.url', - 'DocumentReference.content.format', - 'DocumentReference.context', - 'DocumentReference.context.encounter', - 'DocumentReference.context.period' - ] - must_support_elements.each do |path| - @documentreference_ary&.each do |resource| - truncated_path = path.gsub('DocumentReference.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @documentreference_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided DocumentReference resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '16' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@documentreference) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb deleted file mode 100644 index fb15ff64a..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb +++ /dev/null @@ -1,389 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301EncounterSequence < SequenceBase - title 'Encounter Tests' - - description 'Verify that Encounter resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCE' - - requires :token, :patient_id - conformance_supports :Encounter - - def validate_resource_item(resource, property, value) - case property - - when '_id' - value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } - assert value_found, '_id on resource does not match _id requested' - - when 'class' - value_found = can_resolve_path(resource, 'local_class.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'class on resource does not match class requested' - - when 'date' - value_found = can_resolve_path(resource, 'period') do |period| - validate_period_search(value, period) - end - assert value_found, 'date on resource does not match date requested' - - when 'identifier' - value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } - assert value_found, 'identifier on resource does not match identifier requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'type' - value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'type on resource does not match type requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Encounter search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Encounter search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @encounter = reply&.resource&.entry&.first&.resource - @encounter_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Encounter'), reply) - save_delayed_sequence_references(@encounter_ary) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - end - - test 'Server returns expected results from Encounter search by _id' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - id_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'id')) - search_params = { '_id': id_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by date+patient' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - date_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'period')) - patient_val = @instance.patient_id - search_params = { 'date': date_val, 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'date': comparator_val, 'patient': patient_val } - reply = get_resource_by_params(versioned_resource_class('Encounter'), comparator_search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Encounter search by identifier' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - identifier_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'identifier')) - search_params = { 'identifier': identifier_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by patient+status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by patient+type' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by class+patient' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - class_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'local_class')) - patient_val = @instance.patient_id - search_params = { 'class': class_val, 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Encounter read resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@encounter, versioned_resource_class('Encounter')) - end - - test 'Encounter vread resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@encounter, versioned_resource_class('Encounter')) - end - - test 'Encounter history resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@encounter, versioned_resource_class('Encounter')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Encounter resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '13' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Encounter') - end - - test 'At least one of every must support element is provided in any Encounter for this patient.' do - metadata do - id '14' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @encounter_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Encounter.identifier', - 'Encounter.identifier.system', - 'Encounter.identifier.value', - 'Encounter.status', - 'Encounter.local_class', - 'Encounter.type', - 'Encounter.subject', - 'Encounter.participant', - 'Encounter.participant.type', - 'Encounter.participant.period', - 'Encounter.participant.individual', - 'Encounter.period', - 'Encounter.reasonCode', - 'Encounter.hospitalization', - 'Encounter.hospitalization.dischargeDisposition', - 'Encounter.location', - 'Encounter.location.location' - ] - must_support_elements.each do |path| - @encounter_ary&.each do |resource| - truncated_path = path.gsub('Encounter.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @encounter_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Encounter resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '15' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@encounter) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb deleted file mode 100644 index ae5627ab8..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb +++ /dev/null @@ -1,273 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301GoalSequence < SequenceBase - title 'Goal Tests' - - description 'Verify that Goal resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCG' - - requires :token, :patient_id - conformance_supports :Goal - - def validate_resource_item(resource, property, value) - case property - - when 'lifecycle-status' - value_found = can_resolve_path(resource, 'lifecycleStatus') { |value_in_resource| value_in_resource == value } - assert value_found, 'lifecycle-status on resource does not match lifecycle-status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'target-date' - value_found = can_resolve_path(resource, 'target.dueDate') do |date| - validate_date_search(value, date) - end - assert value_found, 'target-date on resource does not match target-date requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Goal search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Goal search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @goal = reply&.resource&.entry&.first&.resource - @goal_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Goal'), reply) - save_delayed_sequence_references(@goal_ary) - validate_search_reply(versioned_resource_class('Goal'), reply, search_params) - end - - test 'Server returns expected results from Goal search by patient+target-date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@goal.nil?, 'Expected valid Goal resource to be present' - - patient_val = @instance.patient_id - target_date_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'target.dueDate')) - search_params = { 'patient': patient_val, 'target-date': target_date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - validate_search_reply(versioned_resource_class('Goal'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, target_date_val) - comparator_search_params = { 'patient': patient_val, 'target-date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Goal'), comparator_search_params) - validate_search_reply(versioned_resource_class('Goal'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Goal search by patient+lifecycle-status' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@goal.nil?, 'Expected valid Goal resource to be present' - - patient_val = @instance.patient_id - lifecycle_status_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'lifecycleStatus')) - search_params = { 'patient': patient_val, 'lifecycle-status': lifecycle_status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - validate_search_reply(versioned_resource_class('Goal'), reply, search_params) - assert_response_ok(reply) - end - - test 'Goal read resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@goal, versioned_resource_class('Goal')) - end - - test 'Goal vread resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@goal, versioned_resource_class('Goal')) - end - - test 'Goal history resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@goal, versioned_resource_class('Goal')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '08' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Goal resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '09' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Goal') - end - - test 'At least one of every must support element is provided in any Goal for this patient.' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @goal_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Goal.lifecycleStatus', - 'Goal.description', - 'Goal.subject', - 'Goal.target', - 'Goal.target.dueDate' - ] - must_support_elements.each do |path| - @goal_ary&.each do |resource| - truncated_path = path.gsub('Goal.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @goal_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Goal resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@goal) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb deleted file mode 100644 index 05e7f092c..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb +++ /dev/null @@ -1,275 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301ImmunizationSequence < SequenceBase - title 'Immunization Tests' - - description 'Verify that Immunization resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCI' - - requires :token, :patient_id - conformance_supports :Immunization - - def validate_resource_item(resource, property, value) - case property - - when 'patient' - value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'date' - value_found = can_resolve_path(resource, 'occurrenceDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Immunization search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Immunization search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @immunization = reply&.resource&.entry&.first&.resource - @immunization_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Immunization'), reply) - save_delayed_sequence_references(@immunization_ary) - validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) - end - - test 'Server returns expected results from Immunization search by patient+status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@immunization.nil?, 'Expected valid Immunization resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Immunization search by patient+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@immunization.nil?, 'Expected valid Immunization resource to be present' - - patient_val = @instance.patient_id - date_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Immunization'), comparator_search_params) - validate_search_reply(versioned_resource_class('Immunization'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Immunization read resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@immunization, versioned_resource_class('Immunization')) - end - - test 'Immunization vread resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@immunization, versioned_resource_class('Immunization')) - end - - test 'Immunization history resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@immunization, versioned_resource_class('Immunization')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '08' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Immunization resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '09' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Immunization') - end - - test 'At least one of every must support element is provided in any Immunization for this patient.' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @immunization_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Immunization.status', - 'Immunization.statusReason', - 'Immunization.vaccineCode', - 'Immunization.patient', - 'Immunization.occurrenceDateTime', - 'Immunization.occurrenceString', - 'Immunization.primarySource' - ] - must_support_elements.each do |path| - @immunization_ary&.each do |resource| - truncated_path = path.gsub('Immunization.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @immunization_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Immunization resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@immunization) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb deleted file mode 100644 index a5007e240..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb +++ /dev/null @@ -1,242 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301ImplantableDeviceSequence < SequenceBase - title 'Implantable Device Tests' - - description 'Verify that Device resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCID' - - requires :token, :patient_id - conformance_supports :Device - - def validate_resource_item(resource, property, value) - case property - - when 'patient' - value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'type' - value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'type on resource does not match type requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Device search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Device'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Device search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Device'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @device = reply&.resource&.entry&.first&.resource - @device_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Device'), reply) - save_delayed_sequence_references(@device_ary) - validate_search_reply(versioned_resource_class('Device'), reply, search_params) - end - - test 'Server returns expected results from Device search by patient+type' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@device.nil?, 'Expected valid Device resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@device_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Device'), search_params) - validate_search_reply(versioned_resource_class('Device'), reply, search_params) - assert_response_ok(reply) - end - - test 'Device read resource supported' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@device, versioned_resource_class('Device')) - end - - test 'Device vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@device, versioned_resource_class('Device')) - end - - test 'Device history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@device, versioned_resource_class('Device')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '07' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Device'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Device resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '08' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Device') - end - - test 'At least one of every must support element is provided in any Device for this patient.' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @device_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Device.udiCarrier', - 'Device.udiCarrier.deviceIdentifier', - 'Device.udiCarrier.carrierAIDC', - 'Device.udiCarrier.carrierHRF', - 'Device.distinctIdentifier', - 'Device.manufactureDate', - 'Device.expirationDate', - 'Device.lotNumber', - 'Device.serialNumber', - 'Device.type', - 'Device.patient' - ] - must_support_elements.each do |path| - @device_ary&.each do |resource| - truncated_path = path.gsub('Device.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @device_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Device resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@device) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb deleted file mode 100644 index 8dd89980a..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb +++ /dev/null @@ -1,324 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301LocationSequence < SequenceBase - title 'Location Tests' - - description 'Verify that Location resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCL' - - requires :token - conformance_supports :Location - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'name' - value_found = can_resolve_path(resource, 'name') { |value_in_resource| value_in_resource == value } - assert value_found, 'name on resource does not match name requested' - - when 'address' - value_found = can_resolve_path(resource, 'address') do |address| - address&.text&.start_with?(value) || - address&.city&.start_with?(value) || - address&.state&.start_with?(value) || - address&.postalCode&.start_with?(value) || - address&.country&.start_with?(value) - end - assert value_found, 'address on resource does not match address requested' - - when 'address-city' - value_found = can_resolve_path(resource, 'address.city') { |value_in_resource| value_in_resource == value } - assert value_found, 'address-city on resource does not match address-city requested' - - when 'address-state' - value_found = can_resolve_path(resource, 'address.state') { |value_in_resource| value_in_resource == value } - assert value_found, 'address-state on resource does not match address-state requested' - - when 'address-postalcode' - value_found = can_resolve_path(resource, 'address.postalCode') { |value_in_resource| value_in_resource == value } - assert value_found, 'address-postalcode on resource does not match address-postalcode requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read Location from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - location_id = @instance.resource_references.find { |reference| reference.resource_type == 'Location' }&.resource_id - skip 'No Location references found from the prior searches' if location_id.nil? - @location = fetch_resource('Location', location_id) - @location_ary = Array.wrap(@location) - @resources_found = !@location.nil? - end - - test 'Server rejects Location search without authorization' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Location search by name' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @location = reply&.resource&.entry&.first&.resource - @location_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Location'), reply) - save_delayed_sequence_references(@location_ary) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - end - - test 'Server returns expected results from Location search by address' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address')) - search_params = { 'address': address_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Location search by address-city' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_city_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.city')) - search_params = { 'address-city': address_city_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Location search by address-state' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_state_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.state')) - search_params = { 'address-state': address_state_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Location search by address-postalcode' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_postalcode_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.postalCode')) - search_params = { 'address-postalcode': address_postalcode_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Location vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Location, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@location, versioned_resource_class('Location')) - end - - test 'Location history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Location, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@location, versioned_resource_class('Location')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Location resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-location' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Location') - end - - test 'At least one of every must support element is provided in any Location for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @location_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Location.status', - 'Location.name', - 'Location.telecom', - 'Location.address', - 'Location.address.line', - 'Location.address.city', - 'Location.address.state', - 'Location.address.postalCode', - 'Location.managingOrganization' - ] - must_support_elements.each do |path| - @location_ary&.each do |resource| - truncated_path = path.gsub('Location.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @location_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Location resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Location, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@location) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb deleted file mode 100644 index b5c129b95..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb +++ /dev/null @@ -1,144 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301MedicationSequence < SequenceBase - title 'Medication Tests' - - description 'Verify that Medication resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCM' - - requires :token - conformance_supports :Medication - delayed_sequence - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read Medication from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - medication_id = @instance.resource_references.find { |reference| reference.resource_type == 'Medication' }&.resource_id - skip 'No Medication references found from the prior searches' if medication_id.nil? - @medication = fetch_resource('Medication', medication_id) - @medication_ary = Array.wrap(@medication) - @resources_found = !@medication.nil? - end - - test 'Medication vread resource supported' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Medication, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@medication, versioned_resource_class('Medication')) - end - - test 'Medication history resource supported' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Medication, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@medication, versioned_resource_class('Medication')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '04' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = {} - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Medication'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Medication resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '05' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Medication') - end - - test 'At least one of every must support element is provided in any Medication for this patient.' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medication_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Medication.code' - ] - must_support_elements.each do |path| - @medication_ary&.each do |resource| - truncated_path = path.gsub('Medication.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @medication_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Medication resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '07' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Medication, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@medication) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb deleted file mode 100644 index 021d12b22..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb +++ /dev/null @@ -1,328 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301MedicationrequestSequence < SequenceBase - title 'MedicationRequest Tests' - - description 'Verify that MedicationRequest resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCMR' - - requires :token, :patient_id - conformance_supports :MedicationRequest - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'intent' - value_found = can_resolve_path(resource, 'intent') { |value_in_resource| value_in_resource == value } - assert value_found, 'intent on resource does not match intent requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'encounter' - value_found = can_resolve_path(resource, 'encounter.reference') { |value_in_resource| value_in_resource == value } - assert value_found, 'encounter on resource does not match encounter requested' - - when 'authoredon' - value_found = can_resolve_path(resource, 'authoredOn') { |value_in_resource| value_in_resource == value } - assert value_found, 'authoredon on resource does not match authoredon requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects MedicationRequest search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - search_params = { 'patient': patient_val, 'intent': intent_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from MedicationRequest search by patient+intent' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - search_params = { 'patient': patient_val, 'intent': intent_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @medicationrequest = reply&.resource&.entry&.first&.resource - @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) - save_delayed_sequence_references(@medicationrequest_ary) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) - end - - test 'Server returns expected results from MedicationRequest search by patient+intent+status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' - - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - status_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) - search_params = { 'patient': patient_val, 'intent': intent_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from MedicationRequest search by patient+intent+encounter' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' - - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - encounter_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'encounter')) - search_params = { 'patient': patient_val, 'intent': intent_val, 'encounter': encounter_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from MedicationRequest search by patient+intent+authoredon' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' - - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - authoredon_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'authoredOn')) - search_params = { 'patient': patient_val, 'intent': intent_val, 'authoredon': authoredon_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) - assert_response_ok(reply) - end - - test 'MedicationRequest read resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) - end - - test 'MedicationRequest vread resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) - end - - test 'MedicationRequest history resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) - end - - test 'Server returns the appropriate resource from the following _includes: MedicationRequest:medication' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/search.html#include' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - search_params = { 'patient': patient_val, 'intent': intent_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_include'] = 'MedicationRequest:medication' - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } - assert medication_results, 'No Medication resources were returned from this search' - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - search_params = { 'patient': patient_val, 'intent': intent_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('MedicationRequest') - end - - test 'At least one of every must support element is provided in any MedicationRequest for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medicationrequest_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'MedicationRequest.status', - 'MedicationRequest.intent', - 'MedicationRequest.reportedBoolean', - 'MedicationRequest.reportedReference', - 'MedicationRequest.medicationCodeableConcept', - 'MedicationRequest.medicationReference', - 'MedicationRequest.subject', - 'MedicationRequest.encounter', - 'MedicationRequest.authoredOn', - 'MedicationRequest.requester', - 'MedicationRequest.dosageInstruction', - 'MedicationRequest.dosageInstruction.text' - ] - must_support_elements.each do |path| - @medicationrequest_ary&.each do |resource| - truncated_path = path.gsub('MedicationRequest.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @medicationrequest_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided MedicationRequest resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@medicationrequest) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb deleted file mode 100644 index 81e69f168..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb +++ /dev/null @@ -1,328 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301ObservationLabSequence < SequenceBase - title 'Laboratory Result Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCLRO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Observation search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'laboratory' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, category: 'laboratory' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, category: 'laboratory' } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.category', - 'Observation.category', - 'Observation.code', - 'Observation.subject', - 'Observation.effectiveDateTime', - 'Observation.effectivePeriod', - 'Observation.valueQuantity', - 'Observation.valueCodeableConcept', - 'Observation.valueString', - 'Observation.valueBoolean', - 'Observation.valueInteger', - 'Observation.valueRange', - 'Observation.valueRatio', - 'Observation.valueSampledData', - 'Observation.valueTime', - 'Observation.valueDateTime', - 'Observation.valuePeriod', - 'Observation.dataAbsentReason' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb deleted file mode 100644 index 92fe5c67e..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb +++ /dev/null @@ -1,252 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301OrganizationSequence < SequenceBase - title 'Organization Tests' - - description 'Verify that Organization resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCO' - - requires :token - conformance_supports :Organization - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'name' - value_found = can_resolve_path(resource, 'name') { |value_in_resource| value_in_resource == value } - assert value_found, 'name on resource does not match name requested' - - when 'address' - value_found = can_resolve_path(resource, 'address') do |address| - address&.text&.start_with?(value) || - address&.city&.start_with?(value) || - address&.state&.start_with?(value) || - address&.postalCode&.start_with?(value) || - address&.country&.start_with?(value) - end - assert value_found, 'address on resource does not match address requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read Organization from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - organization_id = @instance.resource_references.find { |reference| reference.resource_type == 'Organization' }&.resource_id - skip 'No Organization references found from the prior searches' if organization_id.nil? - @organization = fetch_resource('Organization', organization_id) - @organization_ary = Array.wrap(@organization) - @resources_found = !@organization.nil? - end - - test 'Server rejects Organization search without authorization' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Organization search by name' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @organization = reply&.resource&.entry&.first&.resource - @organization_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Organization'), reply) - save_delayed_sequence_references(@organization_ary) - validate_search_reply(versioned_resource_class('Organization'), reply, search_params) - end - - test 'Server returns expected results from Organization search by address' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@organization.nil?, 'Expected valid Organization resource to be present' - - address_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'address')) - search_params = { 'address': address_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) - validate_search_reply(versioned_resource_class('Organization'), reply, search_params) - assert_response_ok(reply) - end - - test 'Organization vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Organization, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@organization, versioned_resource_class('Organization')) - end - - test 'Organization history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Organization, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@organization, versioned_resource_class('Organization')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '07' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Organization resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '08' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Organization') - end - - test 'At least one of every must support element is provided in any Organization for this patient.' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @organization_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Organization.identifier', - 'Organization.identifier.system', - 'Organization.identifier.value', - 'Organization.identifier', - 'Organization.identifier', - 'Organization.active', - 'Organization.name', - 'Organization.telecom', - 'Organization.address', - 'Organization.address.line', - 'Organization.address.city', - 'Organization.address.state', - 'Organization.address.postalCode', - 'Organization.address.country', - 'Organization.endpoint' - ] - must_support_elements.each do |path| - @organization_ary&.each do |resource| - truncated_path = path.gsub('Organization.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @organization_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Organization resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Organization, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@organization) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb deleted file mode 100644 index 99ea2e091..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb +++ /dev/null @@ -1,397 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301PatientSequence < SequenceBase - title 'Patient Tests' - - description 'Verify that Patient resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCP' - - requires :token, :patient_id - conformance_supports :Patient - - def validate_resource_item(resource, property, value) - case property - - when '_id' - value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } - assert value_found, '_id on resource does not match _id requested' - - when 'birthdate' - value_found = can_resolve_path(resource, 'birthDate') do |date| - validate_date_search(value, date) - end - assert value_found, 'birthdate on resource does not match birthdate requested' - - when 'family' - value_found = can_resolve_path(resource, 'name.family') { |value_in_resource| value_in_resource == value } - assert value_found, 'family on resource does not match family requested' - - when 'gender' - value_found = can_resolve_path(resource, 'gender') { |value_in_resource| value_in_resource == value } - assert value_found, 'gender on resource does not match gender requested' - - when 'given' - value_found = can_resolve_path(resource, 'name.given') { |value_in_resource| value_in_resource == value } - assert value_found, 'given on resource does not match given requested' - - when 'identifier' - value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } - assert value_found, 'identifier on resource does not match identifier requested' - - when 'name' - value = value.downcase - value_found = can_resolve_path(resource, 'name') do |name| - name&.text&.start_with?(value) || - name&.family&.downcase&.include?(value) || - name&.given&.any? { |given| given.downcase.start_with?(value) } || - name&.prefix&.any? { |prefix| prefix.downcase.start_with?(value) } || - name&.suffix&.any? { |suffix| suffix.downcase.start_with?(value) } - end - assert value_found, 'name on resource does not match name requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Patient search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { '_id': @instance.patient_id } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Patient search by _id' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { '_id': @instance.patient_id } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @patient = reply&.resource&.entry&.first&.resource - @patient_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Patient'), reply) - save_delayed_sequence_references(@patient_ary) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - end - - test 'Server returns expected results from Patient search by identifier' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - identifier_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'identifier')) - search_params = { 'identifier': identifier_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by name' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by birthdate+name' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'birthdate': birthdate_val, 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by gender+name' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'gender': gender_val, 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by family+gender' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) - gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) - search_params = { 'family': family_val, 'gender': gender_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by birthdate+family' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) - family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) - search_params = { 'birthdate': birthdate_val, 'family': family_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Patient read resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@patient, versioned_resource_class('Patient')) - end - - test 'Patient vread resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@patient, versioned_resource_class('Patient')) - end - - test 'Patient history resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@patient, versioned_resource_class('Patient')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { '_id': @instance.patient_id } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Patient resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '13' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Patient') - end - - test 'At least one of every must support element is provided in any Patient for this patient.' do - metadata do - id '14' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @patient_ary&.any? - must_support_confirmed = {} - extensions_list = { - 'Patient.extension:race': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race', - 'Patient.extension:ethnicity': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity', - 'Patient.extension:birthsex': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex' - } - extensions_list.each do |id, url| - @patient_ary&.each do |resource| - must_support_confirmed[id] = true if resource.extension.any? { |extension| extension.url == url } - break if must_support_confirmed[id] - end - skip_notification = "Could not find #{id} in any of the #{@patient_ary.length} provided Patient resource(s)" - skip skip_notification unless must_support_confirmed[id] - end - - must_support_elements = [ - 'Patient.identifier', - 'Patient.identifier.system', - 'Patient.identifier.value', - 'Patient.name', - 'Patient.name.family', - 'Patient.name.given', - 'Patient.telecom', - 'Patient.telecom.system', - 'Patient.telecom.value', - 'Patient.telecom.use', - 'Patient.gender', - 'Patient.birthDate', - 'Patient.address', - 'Patient.address.line', - 'Patient.address.city', - 'Patient.address.state', - 'Patient.address.postalCode', - 'Patient.address.period', - 'Patient.communication', - 'Patient.communication.language' - ] - must_support_elements.each do |path| - @patient_ary&.each do |resource| - truncated_path = path.gsub('Patient.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @patient_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Patient resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '15' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@patient) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb deleted file mode 100644 index 43964a374..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb +++ /dev/null @@ -1,244 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301PractitionerSequence < SequenceBase - title 'Practitioner Tests' - - description 'Verify that Practitioner resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPR' - - requires :token - conformance_supports :Practitioner - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'name' - value = value.downcase - value_found = can_resolve_path(resource, 'name') do |name| - name&.text&.start_with?(value) || - name&.family&.downcase&.include?(value) || - name&.given&.any? { |given| given.downcase.start_with?(value) } || - name&.prefix&.any? { |prefix| prefix.downcase.start_with?(value) } || - name&.suffix&.any? { |suffix| suffix.downcase.start_with?(value) } - end - assert value_found, 'name on resource does not match name requested' - - when 'identifier' - value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } - assert value_found, 'identifier on resource does not match identifier requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read Practitioner from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - practitioner_id = @instance.resource_references.find { |reference| reference.resource_type == 'Practitioner' }&.resource_id - skip 'No Practitioner references found from the prior searches' if practitioner_id.nil? - @practitioner = fetch_resource('Practitioner', practitioner_id) - @practitioner_ary = Array.wrap(@practitioner) - @resources_found = !@practitioner.nil? - end - - test 'Server rejects Practitioner search without authorization' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Practitioner search by name' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @practitioner = reply&.resource&.entry&.first&.resource - @practitioner_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Practitioner'), reply) - save_delayed_sequence_references(@practitioner_ary) - validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) - end - - test 'Server returns expected results from Practitioner search by identifier' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@practitioner.nil?, 'Expected valid Practitioner resource to be present' - - identifier_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'identifier')) - search_params = { 'identifier': identifier_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) - validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) - assert_response_ok(reply) - end - - test 'Practitioner vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Practitioner, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@practitioner, versioned_resource_class('Practitioner')) - end - - test 'Practitioner history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Practitioner, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@practitioner, versioned_resource_class('Practitioner')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '07' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Practitioner resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '08' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Practitioner') - end - - test 'At least one of every must support element is provided in any Practitioner for this patient.' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitioner_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Practitioner.identifier', - 'Practitioner.identifier.system', - 'Practitioner.identifier.value', - 'Practitioner.identifier', - 'Practitioner.name', - 'Practitioner.name.family' - ] - must_support_elements.each do |path| - @practitioner_ary&.each do |resource| - truncated_path = path.gsub('Practitioner.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @practitioner_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Practitioner resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Practitioner, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@practitioner) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb deleted file mode 100644 index a3aa35126..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb +++ /dev/null @@ -1,268 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301PractitionerroleSequence < SequenceBase - title 'PractitionerRole Tests' - - description 'Verify that PractitionerRole resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPRO' - - requires :token - conformance_supports :PractitionerRole - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'specialty' - value_found = can_resolve_path(resource, 'specialty.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'specialty on resource does not match specialty requested' - - when 'practitioner' - value_found = can_resolve_path(resource, 'practitioner.reference') { |value_in_resource| value_in_resource == value } - assert value_found, 'practitioner on resource does not match practitioner requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read PractitionerRole from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - practitionerrole_id = @instance.resource_references.find { |reference| reference.resource_type == 'PractitionerRole' }&.resource_id - skip 'No PractitionerRole references found from the prior searches' if practitionerrole_id.nil? - @practitionerrole = fetch_resource('PractitionerRole', practitionerrole_id) - @practitionerrole_ary = Array.wrap(@practitionerrole) - @resources_found = !@practitionerrole.nil? - end - - test 'Server rejects PractitionerRole search without authorization' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from PractitionerRole search by specialty' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @practitionerrole = reply&.resource&.entry&.first&.resource - @practitionerrole_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('PractitionerRole'), reply) - save_delayed_sequence_references(@practitionerrole_ary) - validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) - end - - test 'Server returns expected results from PractitionerRole search by practitioner' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@practitionerrole.nil?, 'Expected valid PractitionerRole resource to be present' - - practitioner_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'practitioner')) - search_params = { 'practitioner': practitioner_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) - assert_response_ok(reply) - end - - test 'PractitionerRole vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:PractitionerRole, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) - end - - test 'PractitionerRole history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:PractitionerRole, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) - end - - test 'Server returns the appropriate resource from the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do - metadata do - id '07' - link 'https://www.hl7.org/fhir/search.html#include' - description %( - ) - versions :r4 - end - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_include'] = 'PractitionerRole:endpoint' - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - endpoint_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Endpoint' } - assert endpoint_results, 'No Endpoint resources were returned from this search' - - search_params['_include'] = 'PractitionerRole:practitioner' - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - practitioner_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Practitioner' } - assert practitioner_results, 'No Practitioner resources were returned from this search' - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '08' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '09' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('PractitionerRole') - end - - test 'At least one of every must support element is provided in any PractitionerRole for this patient.' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitionerrole_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'PractitionerRole.practitioner', - 'PractitionerRole.organization', - 'PractitionerRole.code', - 'PractitionerRole.specialty', - 'PractitionerRole.location', - 'PractitionerRole.telecom', - 'PractitionerRole.telecom.system', - 'PractitionerRole.telecom.value', - 'PractitionerRole.endpoint' - ] - must_support_elements.each do |path| - @practitionerrole_ary&.each do |resource| - truncated_path = path.gsub('PractitionerRole.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @practitionerrole_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided PractitionerRole resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:PractitionerRole, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@practitionerrole) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb deleted file mode 100644 index 77e8b156d..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb +++ /dev/null @@ -1,292 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301ProcedureSequence < SequenceBase - title 'Procedure Tests' - - description 'Verify that Procedure resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPROC' - - requires :token, :patient_id - conformance_supports :Procedure - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'date' - value_found = can_resolve_path(resource, 'occurrenceDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Procedure search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Procedure search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @procedure = reply&.resource&.entry&.first&.resource - @procedure_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Procedure'), reply) - save_delayed_sequence_references(@procedure_ary) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - end - - test 'Server returns expected results from Procedure search by patient+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - - patient_val = @instance.patient_id - date_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Procedure search by patient+code+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Procedure search by patient+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - assert_response_ok(reply) - end - - test 'Procedure read resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@procedure, versioned_resource_class('Procedure')) - end - - test 'Procedure vread resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@procedure, versioned_resource_class('Procedure')) - end - - test 'Procedure history resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@procedure, versioned_resource_class('Procedure')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Procedure resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Procedure') - end - - test 'At least one of every must support element is provided in any Procedure for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @procedure_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Procedure.status', - 'Procedure.code', - 'Procedure.subject', - 'Procedure.performedDateTime', - 'Procedure.performedPeriod' - ] - must_support_elements.each do |path| - @procedure_ary&.each do |resource| - truncated_path = path.gsub('Procedure.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @procedure_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Procedure resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@procedure) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_provenance_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_provenance_sequence.rb deleted file mode 100644 index 0421a35de..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_provenance_sequence.rb +++ /dev/null @@ -1,135 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301ProvenanceSequence < SequenceBase - title 'Provenance Tests' - - description 'Verify that Provenance resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPROV' - - requires :token - conformance_supports :Provenance - delayed_sequence - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Can read Provenance from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - provenance_id = @instance.resource_references.find { |reference| reference.resource_type == 'Provenance' }&.resource_id - skip 'No Provenance references found from the prior searches' if provenance_id.nil? - @provenance = fetch_resource('Provenance', provenance_id) - @provenance_ary = Array.wrap(@provenance) - @resources_found = !@provenance.nil? - end - - test 'Provenance vread resource supported' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Provenance, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@provenance, versioned_resource_class('Provenance')) - end - - test 'Provenance history resource supported' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Provenance, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@provenance, versioned_resource_class('Provenance')) - end - - test 'Provenance resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '04' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Provenance') - end - - test 'At least one of every must support element is provided in any Provenance for this patient.' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @provenance_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Provenance.target', - 'Provenance.recorded', - 'Provenance.agent', - 'Provenance.agent.type', - 'Provenance.agent.who', - 'Provenance.agent.onBehalfOf', - 'Provenance.agent', - 'Provenance.agent.type', - 'Provenance.agent', - 'Provenance.agent.type' - ] - must_support_elements.each do |path| - @provenance_ary&.each do |resource| - truncated_path = path.gsub('Provenance.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @provenance_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Provenance resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '06' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Provenance, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@provenance) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb deleted file mode 100644 index 0450daeb1..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb +++ /dev/null @@ -1,459 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301PulseOximetrySequence < SequenceBase - title 'Pulse Oximetry Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Observation search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '59408-5' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '59408-5' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '59408-5' } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.category', - 'Observation.category', - 'Observation.category.coding', - 'Observation.category.coding.system', - 'Observation.category.coding.code', - 'Observation.code', - 'Observation.code.coding', - 'Observation.code.coding', - 'Observation.code.coding.system', - 'Observation.code.coding.code', - 'Observation.subject', - 'Observation.effectiveDateTime', - 'Observation.effectivePeriod', - 'Observation.valueQuantity', - 'Observation.valueQuantity.value', - 'Observation.valueQuantity.unit', - 'Observation.valueQuantity.system', - 'Observation.valueQuantity.code', - 'Observation.dataAbsentReason', - 'Observation.component', - 'Observation.component.code', - 'Observation.component.valueQuantity', - 'Observation.component.valueCodeableConcept', - 'Observation.component.valueString', - 'Observation.component.valueBoolean', - 'Observation.component.valueInteger', - 'Observation.component.valueRange', - 'Observation.component.valueRatio', - 'Observation.component.valueSampledData', - 'Observation.component.valueTime', - 'Observation.component.valueDateTime', - 'Observation.component.valuePeriod', - 'Observation.component.dataAbsentReason', - 'Observation.component', - 'Observation.component.code', - 'Observation.component.valueQuantity', - 'Observation.component.valueCodeableConcept', - 'Observation.component.valueString', - 'Observation.component.valueBoolean', - 'Observation.component.valueInteger', - 'Observation.component.valueRange', - 'Observation.component.valueRatio', - 'Observation.component.valueSampledData', - 'Observation.component.valueTime', - 'Observation.component.valueDateTime', - 'Observation.component.valuePeriod', - 'Observation.component.valueQuantity.value', - 'Observation.component.valueCodeableConcept.value', - 'Observation.component.valueString.value', - 'Observation.component.valueBoolean.value', - 'Observation.component.valueInteger.value', - 'Observation.component.valueRange.value', - 'Observation.component.valueRatio.value', - 'Observation.component.valueSampledData.value', - 'Observation.component.valueTime.value', - 'Observation.component.valueDateTime.value', - 'Observation.component.valuePeriod.value', - 'Observation.component.valueQuantity.unit', - 'Observation.component.valueCodeableConcept.unit', - 'Observation.component.valueString.unit', - 'Observation.component.valueBoolean.unit', - 'Observation.component.valueInteger.unit', - 'Observation.component.valueRange.unit', - 'Observation.component.valueRatio.unit', - 'Observation.component.valueSampledData.unit', - 'Observation.component.valueTime.unit', - 'Observation.component.valueDateTime.unit', - 'Observation.component.valuePeriod.unit', - 'Observation.component.valueQuantity.system', - 'Observation.component.valueCodeableConcept.system', - 'Observation.component.valueString.system', - 'Observation.component.valueBoolean.system', - 'Observation.component.valueInteger.system', - 'Observation.component.valueRange.system', - 'Observation.component.valueRatio.system', - 'Observation.component.valueSampledData.system', - 'Observation.component.valueTime.system', - 'Observation.component.valueDateTime.system', - 'Observation.component.valuePeriod.system', - 'Observation.component.valueQuantity.code', - 'Observation.component.valueCodeableConcept.code', - 'Observation.component.valueString.code', - 'Observation.component.valueBoolean.code', - 'Observation.component.valueInteger.code', - 'Observation.component.valueRange.code', - 'Observation.component.valueRatio.code', - 'Observation.component.valueSampledData.code', - 'Observation.component.valueTime.code', - 'Observation.component.valueDateTime.code', - 'Observation.component.valuePeriod.code', - 'Observation.component.dataAbsentReason', - 'Observation.component', - 'Observation.component.code', - 'Observation.component.valueQuantity', - 'Observation.component.valueCodeableConcept', - 'Observation.component.valueString', - 'Observation.component.valueBoolean', - 'Observation.component.valueInteger', - 'Observation.component.valueRange', - 'Observation.component.valueRatio', - 'Observation.component.valueSampledData', - 'Observation.component.valueTime', - 'Observation.component.valueDateTime', - 'Observation.component.valuePeriod', - 'Observation.component.valueQuantity.value', - 'Observation.component.valueCodeableConcept.value', - 'Observation.component.valueString.value', - 'Observation.component.valueBoolean.value', - 'Observation.component.valueInteger.value', - 'Observation.component.valueRange.value', - 'Observation.component.valueRatio.value', - 'Observation.component.valueSampledData.value', - 'Observation.component.valueTime.value', - 'Observation.component.valueDateTime.value', - 'Observation.component.valuePeriod.value', - 'Observation.component.valueQuantity.unit', - 'Observation.component.valueCodeableConcept.unit', - 'Observation.component.valueString.unit', - 'Observation.component.valueBoolean.unit', - 'Observation.component.valueInteger.unit', - 'Observation.component.valueRange.unit', - 'Observation.component.valueRatio.unit', - 'Observation.component.valueSampledData.unit', - 'Observation.component.valueTime.unit', - 'Observation.component.valueDateTime.unit', - 'Observation.component.valuePeriod.unit', - 'Observation.component.valueQuantity.system', - 'Observation.component.valueCodeableConcept.system', - 'Observation.component.valueString.system', - 'Observation.component.valueBoolean.system', - 'Observation.component.valueInteger.system', - 'Observation.component.valueRange.system', - 'Observation.component.valueRatio.system', - 'Observation.component.valueSampledData.system', - 'Observation.component.valueTime.system', - 'Observation.component.valueDateTime.system', - 'Observation.component.valuePeriod.system', - 'Observation.component.valueQuantity.code', - 'Observation.component.valueCodeableConcept.code', - 'Observation.component.valueString.code', - 'Observation.component.valueBoolean.code', - 'Observation.component.valueInteger.code', - 'Observation.component.valueRange.code', - 'Observation.component.valueRatio.code', - 'Observation.component.valueSampledData.code', - 'Observation.component.valueTime.code', - 'Observation.component.valueDateTime.code', - 'Observation.component.valuePeriod.code', - 'Observation.component.dataAbsentReason' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb deleted file mode 100644 index 68865ebec..000000000 --- a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ /dev/null @@ -1,314 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301SmokingstatusSequence < SequenceBase - title 'Smoking Status Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCSSO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - - ) - - @resources_found = false - - test 'Server rejects Observation search without authorization' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, code: '72166-2' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '72166-2' } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, code: '72166-2' } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.code', - 'Observation.subject', - 'Observation.issued', - 'Observation.valueCodeableConcept' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/app/modules/uscore_v3.0.1_module.yml b/lib/app/modules/uscore_v3.0.1_module.yml deleted file mode 100644 index 12d2b3821..000000000 --- a/lib/app/modules/uscore_v3.0.1_module.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: uscore_v3.0.1 -title: US Core v3.0.1 -description : US Core v3.0.1 -fhir_version: r4 -default_test_set: ad_hoc_testing -test_sets: - ad_hoc_testing: - view: default - tests: - - name: Discovery - sequences: - - UsCoreR4CapabilityStatementSequence - - SMARTDiscoverySequence - run_all: true - - name: Authorization and Authentication - sequences: - - DynamicRegistrationSequence - - ManualRegistrationSequence - - StandaloneLaunchSequence - - EHRLaunchSequence - - name: US Core R4 Patient Based Profiles - run_all: true - sequences: - - USCore301AllergyintoleranceSequence - - USCore301CareplanSequence - - USCore301CareteamSequence - - USCore301ConditionSequence - - USCore301ImplantableDeviceSequence - - USCore301DiagnosticreportNoteSequence - - USCore301DiagnosticreportLabSequence - - USCore301DocumentreferenceSequence - - USCore301EncounterSequence - - USCore301GoalSequence - - USCore301ImmunizationSequence - - USCore301MedicationrequestSequence - - USCore301SmokingstatusSequence - - USCore301PediatricWeightForHeightSequence - - USCore301ObservationLabSequence - - USCore301PediatricBmiForAgeSequence - - USCore301PulseOximetrySequence - - USCore301PatientSequence - - USCore301ProcedureSequence - - R4ProvenanceSequence - - USCoreR4ClinicalNotesSequence - - USCore301LocationSequence - - USCore301MedicationSequence - - USCore301OrganizationSequence - - USCore301PractitionerSequence - - USCore301PractitionerroleSequence - - USCore301ProvenanceSequence diff --git a/test/sequence/us_core_r4/clinicalnotes_sequence_test.rb b/test/sequence/us_core_r4/clinicalnotes_sequence_test.rb index 00fd999ee..e03252f04 100644 --- a/test/sequence/us_core_r4/clinicalnotes_sequence_test.rb +++ b/test/sequence/us_core_r4/clinicalnotes_sequence_test.rb @@ -14,7 +14,7 @@ def setup base_url: 'http://localhost:4567', client_endpoint_key: Inferno::SecureRandomBase62.generate(32), client_id: SecureRandom.uuid, - selected_module: 'uscore_v3.0.1', + selected_module: 'uscore_v3.1.0', oauth_authorize_endpoint: 'http://oauth_reg.example.com/authorize', oauth_token_endpoint: 'http://oauth_reg.example.com/token', scopes: 'launch openid patient/*.* profile', diff --git a/test/unit/test_instance_test.rb b/test/unit/test_instance_test.rb index 04a08f2f8..68d51042c 100644 --- a/test/unit/test_instance_test.rb +++ b/test/unit/test_instance_test.rb @@ -4,7 +4,7 @@ describe Inferno::Models::TestingInstance do before do - @instance = Inferno::Models::TestingInstance.create(selected_module: 'uscore_v3.0.0') + @instance = Inferno::Models::TestingInstance.create(selected_module: 'uscore_v3.1.0') end describe '#conformance_supported?' do From 71a62b9eddb440a448d4929804e643454dcd5452 Mon Sep 17 00:00:00 2001 From: Chase Date: Wed, 13 Nov 2019 10:57:22 -0500 Subject: [PATCH 061/173] address github issues --- generator/uscore/metadata_extractor.rb | 51 +++++++++++++++++--------- 1 file changed, 34 insertions(+), 17 deletions(-) diff --git a/generator/uscore/metadata_extractor.rb b/generator/uscore/metadata_extractor.rb index 7162fe63f..d90ec33ad 100644 --- a/generator/uscore/metadata_extractor.rb +++ b/generator/uscore/metadata_extractor.rb @@ -230,26 +230,43 @@ def add_search_param_descriptions(profile_definition, sequence) def add_valid_codes(profile_definition, profile_element, fhir_metadata, param_metadata, path) if param_metadata[:contains_multiple] - # look for values in slices if param is an array - slices = profile_definition['snapshot']['element'].select { |el| el['path'] == path && el['sliceName'] } - slices.each do |slice| - param_metadata[:values] << slice['patternCodeableConcept']['coding'].first['code'] if slice['patternCodeableConcept'] - end + add_values_from_slices(param_metadata, profile_definition, path) elsif param_metadata[:type] == 'CodeableConcept' - # look for fixed codes if codeable concept - fixed_code_els = profile_definition['snapshot']['element'].select { |el| el['path'] == "#{profile_element['path']}.coding.code" && el['fixedCode'].present? } - param_metadata[:values] += fixed_code_els.map { |el| el['fixedCode'] } + add_values_from_fixed_codes(param_metadata, profile_definition, profile_element) + add_values_from_patterncodeableconcept(param_metadata, profile_element) end - param_metadata[:values] << profile_element['patternCodeableConcept']['coding'].first['code'] if profile_element['patternCodeableConcept'] - # look for values in the valueset the element is bound to - valueset_binding = profile_element['binding'] - if valueset_binding - value_set = resources_by_type['ValueSet'].find { |res| res['url'] == valueset_binding['valueSet'] } - codes = value_set['compose']['include'].reject { |code| code['concept'].nil? } if value_set.present? - param_metadata[:values] += codes.map { |code| code['concept'].first['code'] } if codes.present? + add_values_from_valueset_binding(param_metadata, profile_element) + add_values_from_resource_metadata(param_metadata, fhir_metadata) + end + + def add_values_from_slices(param_metadata, profile_definition, path) + slices = profile_definition['snapshot']['element'].select { |el| el['path'] == path && el['sliceName'] } + slices.each do |slice| + param_metadata[:values] << slice['patternCodeableConcept']['coding'].first['code'] if slice['patternCodeableConcept'] end - # if none found so far, add all the valid codes from metadata (less strict) - param_metadata[:values] = fhir_metadata['valid_codes'].values.flatten unless param_metadata[:values].any? || fhir_metadata.nil? || fhir_metadata['valid_codes'].nil? + end + + def add_values_from_fixed_codes(param_metadata, profile_definition, profile_element) + fixed_code_els = profile_definition['snapshot']['element'].select { |el| el['path'] == "#{profile_element['path']}.coding.code" && el['fixedCode'].present? } + param_metadata[:values] += fixed_code_els.map { |el| el['fixedCode'] } + end + + def add_values_from_valueset_binding(param_metadata, profile_element) + valueset_binding = profile_element['binding'] + return unless valueset_binding + + value_set = resources_by_type['ValueSet'].find { |res| res['url'] == valueset_binding['valueSet'] } + codes = value_set['compose']['include'].reject { |code| code['concept'].nil? } if value_set.present? + param_metadata[:values] += codes.map { |code| code['concept'].first['code'] } if codes.present? + end + + def add_values_from_patterncodeableconcept(param_metadata, profile_element) + param_metadata[:values] << profile_element['patternCodeableConcept']['coding'].first['code'] if profile_element['patternCodeableConcept'] + end + + def add_values_from_resource_metadata(param_metadata, fhir_metadata) + use_valid_codes = param_metadata[:values].blank? && fhir_metadata.present? && fhir_metadata['valid_codes'].present? + param_metadata[:values] = fhir_metadata['valid_codes'].values.flatten if use_valid_codes end def add_element_definitions(profile_definition, sequence) From 5f4dc088dc0c31d0ee7f89594c8e33e1078c7dda Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 30 Oct 2019 13:40:13 -0400 Subject: [PATCH 062/173] move modules --- .../argonaut_allergy_intolerance_sequence.rb | 0 .../argonaut/argonaut_careplan_sequence.rb | 0 .../argonaut/argonaut_careteam_sequence.rb | 0 .../argonaut/argonaut_condition_sequence.rb | 0 .../argonaut/argonaut_conformance_sequence.rb | 0 .../argonaut/argonaut_device_sequence.rb | 0 .../argonaut_diagnostic_report_sequence.rb | 0 .../argonaut/argonaut_goal_sequence.rb | 0 .../argonaut_immunization_sequence.rb | 0 .../argonaut_medication_order_sequence.rb | 0 .../argonaut/argonaut_medication_sequence.rb | 0 .../argonaut_medication_statement_sequence.rb | 0 .../argonaut/argonaut_observation_sequence.rb | 0 .../argonaut_patient_read_only_sequence.rb | 0 .../argonaut_patient_search_sequence.rb | 0 .../argonaut/argonaut_procedure_sequence.rb | 0 .../argonaut_smoking_status_sequence.rb | 0 ...gonaut_vital_signs_observation_sequence.rb | 0 lib/{app => }/modules/argonaut_module.yml | 0 ...luebutton_explanationofbenefit_sequence.rb | 0 .../bluebutton_patient_sequence.rb | 0 .../modules/bluebutton_demo_module.yml | 0 ...bulk_data_capability_statement_sequence.rb | 0 .../bulk_data/bulk_data_export_sequence.rb | 0 .../bulk_data_group_export_sequence.rb | 0 .../bulk_data_patient_export_sequence.rb | 0 lib/{app => }/modules/bulk_data_module.yml | 0 .../core/capability_statement_sequence.rb | 0 .../document_reference_sequence.rb | 0 .../onc_program/onc_ehr_launch_sequence.rb | 0 .../onc_smart_discovery_sequence.rb | 0 .../onc_standalone_launch_sequence.rb | 0 .../onc_program/provenance_sequence.rb | 0 lib/{app => }/modules/onc_program_module.yml | 0 .../modules/onc_program_r4_module.yml | 0 .../smart/dynamic_registration_sequence.rb | 0 .../modules/smart/ehr_launch_sequence.rb | 0 .../smart/manual_registration_sequence.rb | 0 .../modules/smart/openid_connect_sequence.rb | 0 .../modules/smart/smart_discovery_sequence.rb | 0 .../smart/standalone_launch_sequence.rb | 0 .../smart/token_introspection_sequence.rb | 0 .../modules/smart/token_refresh_sequence.rb | 0 lib/{app => }/modules/smart_module.yml | 0 .../modules/us_core_guidance/README.md | 0 .../clinicalnotes_sequence.rb | 0 .../r4_provenance_sequence.rb | 0 .../us_core_patient_read_only_sequence.rb | 130 ++++++++++++++++++ ...s_core_r4_capability_statement_sequence.rb | 0 .../pediatric_bmi_for_age_sequence.rb | 0 .../pediatric_weight_for_height_sequence.rb | 0 .../us_core_allergyintolerance_sequence.rb | 0 .../us_core_careplan_sequence.rb | 0 .../us_core_careteam_sequence.rb | 0 .../us_core_condition_sequence.rb | 0 .../uscore_v3.0.0/us_core_device_sequence.rb | 0 .../us_core_diagnosticreport_lab_sequence.rb | 0 .../us_core_diagnosticreport_note_sequence.rb | 0 .../us_core_documentreference_sequence.rb | 0 .../us_core_encounter_sequence.rb | 0 .../uscore_v3.0.0/us_core_goal_sequence.rb | 0 .../us_core_immunization_sequence.rb | 0 .../us_core_location_sequence.rb | 0 .../us_core_medication_sequence.rb | 0 .../us_core_medicationrequest_sequence.rb | 0 .../us_core_medicationstatement_sequence.rb | 0 .../us_core_observation_lab_sequence.rb | 0 .../us_core_organization_sequence.rb | 0 .../uscore_v3.0.0/us_core_patient_sequence.rb | 0 .../us_core_practitioner_sequence.rb | 0 .../us_core_practitionerrole_sequence.rb | 0 .../us_core_procedure_sequence.rb | 0 .../us_core_smokingstatus_sequence.rb | 0 .../modules/uscore_v3.0.0_module.yml | 0 .../pediatric_bmi_for_age_sequence.rb | 0 .../pediatric_weight_for_height_sequence.rb | 0 .../us_core_allergyintolerance_sequence.rb | 0 .../us_core_careplan_sequence.rb | 0 .../us_core_careteam_sequence.rb | 0 .../us_core_condition_sequence.rb | 0 .../us_core_diagnosticreport_lab_sequence.rb | 0 .../us_core_diagnosticreport_note_sequence.rb | 0 .../us_core_documentreference_sequence.rb | 0 .../us_core_encounter_sequence.rb | 0 .../uscore_v3.0.1/us_core_goal_sequence.rb | 0 .../us_core_immunization_sequence.rb | 0 .../us_core_implantable_device_sequence.rb | 0 .../us_core_location_sequence.rb | 0 .../us_core_medication_sequence.rb | 0 .../us_core_medicationrequest_sequence.rb | 0 .../us_core_observation_lab_sequence.rb | 0 .../us_core_organization_sequence.rb | 0 .../uscore_v3.0.1/us_core_patient_sequence.rb | 0 .../us_core_practitioner_sequence.rb | 0 .../us_core_practitionerrole_sequence.rb | 0 .../us_core_procedure_sequence.rb | 0 .../us_core_provenance_sequence.rb | 0 .../us_core_pulse_oximetry_sequence.rb | 0 .../us_core_smokingstatus_sequence.rb | 0 .../modules/uscore_v3.0.1_module.yml | 0 100 files changed, 130 insertions(+) rename lib/{app => }/modules/argonaut/argonaut_allergy_intolerance_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_careplan_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_careteam_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_condition_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_conformance_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_device_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_diagnostic_report_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_goal_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_immunization_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_medication_order_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_medication_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_medication_statement_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_observation_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_patient_read_only_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_patient_search_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_procedure_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_smoking_status_sequence.rb (100%) rename lib/{app => }/modules/argonaut/argonaut_vital_signs_observation_sequence.rb (100%) rename lib/{app => }/modules/argonaut_module.yml (100%) rename lib/{app => }/modules/bluebutton_demo/bluebutton_explanationofbenefit_sequence.rb (100%) rename lib/{app => }/modules/bluebutton_demo/bluebutton_patient_sequence.rb (100%) rename lib/{app => }/modules/bluebutton_demo_module.yml (100%) rename lib/{app => }/modules/bulk_data/bulk_data_capability_statement_sequence.rb (100%) rename lib/{app => }/modules/bulk_data/bulk_data_export_sequence.rb (100%) rename lib/{app => }/modules/bulk_data/bulk_data_group_export_sequence.rb (100%) rename lib/{app => }/modules/bulk_data/bulk_data_patient_export_sequence.rb (100%) rename lib/{app => }/modules/bulk_data_module.yml (100%) rename lib/{app => }/modules/core/capability_statement_sequence.rb (100%) rename lib/{app => }/modules/onc_program/document_reference_sequence.rb (100%) rename lib/{app => }/modules/onc_program/onc_ehr_launch_sequence.rb (100%) rename lib/{app => }/modules/onc_program/onc_smart_discovery_sequence.rb (100%) rename lib/{app => }/modules/onc_program/onc_standalone_launch_sequence.rb (100%) rename lib/{app => }/modules/onc_program/provenance_sequence.rb (100%) rename lib/{app => }/modules/onc_program_module.yml (100%) rename lib/{app => }/modules/onc_program_r4_module.yml (100%) rename lib/{app => }/modules/smart/dynamic_registration_sequence.rb (100%) rename lib/{app => }/modules/smart/ehr_launch_sequence.rb (100%) rename lib/{app => }/modules/smart/manual_registration_sequence.rb (100%) rename lib/{app => }/modules/smart/openid_connect_sequence.rb (100%) rename lib/{app => }/modules/smart/smart_discovery_sequence.rb (100%) rename lib/{app => }/modules/smart/standalone_launch_sequence.rb (100%) rename lib/{app => }/modules/smart/token_introspection_sequence.rb (100%) rename lib/{app => }/modules/smart/token_refresh_sequence.rb (100%) rename lib/{app => }/modules/smart_module.yml (100%) rename lib/{app => }/modules/us_core_guidance/README.md (100%) rename lib/{app => }/modules/us_core_guidance/clinicalnotes_sequence.rb (100%) rename lib/{app => }/modules/us_core_guidance/r4_provenance_sequence.rb (100%) create mode 100644 lib/modules/us_core_guidance/us_core_patient_read_only_sequence.rb rename lib/{app => }/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_careplan_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_careteam_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_condition_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_device_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_encounter_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_goal_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_immunization_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_location_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_medication_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_organization_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_patient_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_procedure_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.0_module.yml (100%) rename lib/{app => }/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_careplan_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_careteam_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_condition_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_encounter_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_goal_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_immunization_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_location_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_medication_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_organization_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_patient_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_procedure_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_provenance_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb (100%) rename lib/{app => }/modules/uscore_v3.0.1_module.yml (100%) diff --git a/lib/app/modules/argonaut/argonaut_allergy_intolerance_sequence.rb b/lib/modules/argonaut/argonaut_allergy_intolerance_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_allergy_intolerance_sequence.rb rename to lib/modules/argonaut/argonaut_allergy_intolerance_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_careplan_sequence.rb b/lib/modules/argonaut/argonaut_careplan_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_careplan_sequence.rb rename to lib/modules/argonaut/argonaut_careplan_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_careteam_sequence.rb b/lib/modules/argonaut/argonaut_careteam_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_careteam_sequence.rb rename to lib/modules/argonaut/argonaut_careteam_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_condition_sequence.rb b/lib/modules/argonaut/argonaut_condition_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_condition_sequence.rb rename to lib/modules/argonaut/argonaut_condition_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_conformance_sequence.rb b/lib/modules/argonaut/argonaut_conformance_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_conformance_sequence.rb rename to lib/modules/argonaut/argonaut_conformance_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_device_sequence.rb b/lib/modules/argonaut/argonaut_device_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_device_sequence.rb rename to lib/modules/argonaut/argonaut_device_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_diagnostic_report_sequence.rb b/lib/modules/argonaut/argonaut_diagnostic_report_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_diagnostic_report_sequence.rb rename to lib/modules/argonaut/argonaut_diagnostic_report_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_goal_sequence.rb b/lib/modules/argonaut/argonaut_goal_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_goal_sequence.rb rename to lib/modules/argonaut/argonaut_goal_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_immunization_sequence.rb b/lib/modules/argonaut/argonaut_immunization_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_immunization_sequence.rb rename to lib/modules/argonaut/argonaut_immunization_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_medication_order_sequence.rb b/lib/modules/argonaut/argonaut_medication_order_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_medication_order_sequence.rb rename to lib/modules/argonaut/argonaut_medication_order_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_medication_sequence.rb b/lib/modules/argonaut/argonaut_medication_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_medication_sequence.rb rename to lib/modules/argonaut/argonaut_medication_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_medication_statement_sequence.rb b/lib/modules/argonaut/argonaut_medication_statement_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_medication_statement_sequence.rb rename to lib/modules/argonaut/argonaut_medication_statement_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_observation_sequence.rb b/lib/modules/argonaut/argonaut_observation_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_observation_sequence.rb rename to lib/modules/argonaut/argonaut_observation_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_patient_read_only_sequence.rb b/lib/modules/argonaut/argonaut_patient_read_only_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_patient_read_only_sequence.rb rename to lib/modules/argonaut/argonaut_patient_read_only_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_patient_search_sequence.rb b/lib/modules/argonaut/argonaut_patient_search_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_patient_search_sequence.rb rename to lib/modules/argonaut/argonaut_patient_search_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_procedure_sequence.rb b/lib/modules/argonaut/argonaut_procedure_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_procedure_sequence.rb rename to lib/modules/argonaut/argonaut_procedure_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_smoking_status_sequence.rb b/lib/modules/argonaut/argonaut_smoking_status_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_smoking_status_sequence.rb rename to lib/modules/argonaut/argonaut_smoking_status_sequence.rb diff --git a/lib/app/modules/argonaut/argonaut_vital_signs_observation_sequence.rb b/lib/modules/argonaut/argonaut_vital_signs_observation_sequence.rb similarity index 100% rename from lib/app/modules/argonaut/argonaut_vital_signs_observation_sequence.rb rename to lib/modules/argonaut/argonaut_vital_signs_observation_sequence.rb diff --git a/lib/app/modules/argonaut_module.yml b/lib/modules/argonaut_module.yml similarity index 100% rename from lib/app/modules/argonaut_module.yml rename to lib/modules/argonaut_module.yml diff --git a/lib/app/modules/bluebutton_demo/bluebutton_explanationofbenefit_sequence.rb b/lib/modules/bluebutton_demo/bluebutton_explanationofbenefit_sequence.rb similarity index 100% rename from lib/app/modules/bluebutton_demo/bluebutton_explanationofbenefit_sequence.rb rename to lib/modules/bluebutton_demo/bluebutton_explanationofbenefit_sequence.rb diff --git a/lib/app/modules/bluebutton_demo/bluebutton_patient_sequence.rb b/lib/modules/bluebutton_demo/bluebutton_patient_sequence.rb similarity index 100% rename from lib/app/modules/bluebutton_demo/bluebutton_patient_sequence.rb rename to lib/modules/bluebutton_demo/bluebutton_patient_sequence.rb diff --git a/lib/app/modules/bluebutton_demo_module.yml b/lib/modules/bluebutton_demo_module.yml similarity index 100% rename from lib/app/modules/bluebutton_demo_module.yml rename to lib/modules/bluebutton_demo_module.yml diff --git a/lib/app/modules/bulk_data/bulk_data_capability_statement_sequence.rb b/lib/modules/bulk_data/bulk_data_capability_statement_sequence.rb similarity index 100% rename from lib/app/modules/bulk_data/bulk_data_capability_statement_sequence.rb rename to lib/modules/bulk_data/bulk_data_capability_statement_sequence.rb diff --git a/lib/app/modules/bulk_data/bulk_data_export_sequence.rb b/lib/modules/bulk_data/bulk_data_export_sequence.rb similarity index 100% rename from lib/app/modules/bulk_data/bulk_data_export_sequence.rb rename to lib/modules/bulk_data/bulk_data_export_sequence.rb diff --git a/lib/app/modules/bulk_data/bulk_data_group_export_sequence.rb b/lib/modules/bulk_data/bulk_data_group_export_sequence.rb similarity index 100% rename from lib/app/modules/bulk_data/bulk_data_group_export_sequence.rb rename to lib/modules/bulk_data/bulk_data_group_export_sequence.rb diff --git a/lib/app/modules/bulk_data/bulk_data_patient_export_sequence.rb b/lib/modules/bulk_data/bulk_data_patient_export_sequence.rb similarity index 100% rename from lib/app/modules/bulk_data/bulk_data_patient_export_sequence.rb rename to lib/modules/bulk_data/bulk_data_patient_export_sequence.rb diff --git a/lib/app/modules/bulk_data_module.yml b/lib/modules/bulk_data_module.yml similarity index 100% rename from lib/app/modules/bulk_data_module.yml rename to lib/modules/bulk_data_module.yml diff --git a/lib/app/modules/core/capability_statement_sequence.rb b/lib/modules/core/capability_statement_sequence.rb similarity index 100% rename from lib/app/modules/core/capability_statement_sequence.rb rename to lib/modules/core/capability_statement_sequence.rb diff --git a/lib/app/modules/onc_program/document_reference_sequence.rb b/lib/modules/onc_program/document_reference_sequence.rb similarity index 100% rename from lib/app/modules/onc_program/document_reference_sequence.rb rename to lib/modules/onc_program/document_reference_sequence.rb diff --git a/lib/app/modules/onc_program/onc_ehr_launch_sequence.rb b/lib/modules/onc_program/onc_ehr_launch_sequence.rb similarity index 100% rename from lib/app/modules/onc_program/onc_ehr_launch_sequence.rb rename to lib/modules/onc_program/onc_ehr_launch_sequence.rb diff --git a/lib/app/modules/onc_program/onc_smart_discovery_sequence.rb b/lib/modules/onc_program/onc_smart_discovery_sequence.rb similarity index 100% rename from lib/app/modules/onc_program/onc_smart_discovery_sequence.rb rename to lib/modules/onc_program/onc_smart_discovery_sequence.rb diff --git a/lib/app/modules/onc_program/onc_standalone_launch_sequence.rb b/lib/modules/onc_program/onc_standalone_launch_sequence.rb similarity index 100% rename from lib/app/modules/onc_program/onc_standalone_launch_sequence.rb rename to lib/modules/onc_program/onc_standalone_launch_sequence.rb diff --git a/lib/app/modules/onc_program/provenance_sequence.rb b/lib/modules/onc_program/provenance_sequence.rb similarity index 100% rename from lib/app/modules/onc_program/provenance_sequence.rb rename to lib/modules/onc_program/provenance_sequence.rb diff --git a/lib/app/modules/onc_program_module.yml b/lib/modules/onc_program_module.yml similarity index 100% rename from lib/app/modules/onc_program_module.yml rename to lib/modules/onc_program_module.yml diff --git a/lib/app/modules/onc_program_r4_module.yml b/lib/modules/onc_program_r4_module.yml similarity index 100% rename from lib/app/modules/onc_program_r4_module.yml rename to lib/modules/onc_program_r4_module.yml diff --git a/lib/app/modules/smart/dynamic_registration_sequence.rb b/lib/modules/smart/dynamic_registration_sequence.rb similarity index 100% rename from lib/app/modules/smart/dynamic_registration_sequence.rb rename to lib/modules/smart/dynamic_registration_sequence.rb diff --git a/lib/app/modules/smart/ehr_launch_sequence.rb b/lib/modules/smart/ehr_launch_sequence.rb similarity index 100% rename from lib/app/modules/smart/ehr_launch_sequence.rb rename to lib/modules/smart/ehr_launch_sequence.rb diff --git a/lib/app/modules/smart/manual_registration_sequence.rb b/lib/modules/smart/manual_registration_sequence.rb similarity index 100% rename from lib/app/modules/smart/manual_registration_sequence.rb rename to lib/modules/smart/manual_registration_sequence.rb diff --git a/lib/app/modules/smart/openid_connect_sequence.rb b/lib/modules/smart/openid_connect_sequence.rb similarity index 100% rename from lib/app/modules/smart/openid_connect_sequence.rb rename to lib/modules/smart/openid_connect_sequence.rb diff --git a/lib/app/modules/smart/smart_discovery_sequence.rb b/lib/modules/smart/smart_discovery_sequence.rb similarity index 100% rename from lib/app/modules/smart/smart_discovery_sequence.rb rename to lib/modules/smart/smart_discovery_sequence.rb diff --git a/lib/app/modules/smart/standalone_launch_sequence.rb b/lib/modules/smart/standalone_launch_sequence.rb similarity index 100% rename from lib/app/modules/smart/standalone_launch_sequence.rb rename to lib/modules/smart/standalone_launch_sequence.rb diff --git a/lib/app/modules/smart/token_introspection_sequence.rb b/lib/modules/smart/token_introspection_sequence.rb similarity index 100% rename from lib/app/modules/smart/token_introspection_sequence.rb rename to lib/modules/smart/token_introspection_sequence.rb diff --git a/lib/app/modules/smart/token_refresh_sequence.rb b/lib/modules/smart/token_refresh_sequence.rb similarity index 100% rename from lib/app/modules/smart/token_refresh_sequence.rb rename to lib/modules/smart/token_refresh_sequence.rb diff --git a/lib/app/modules/smart_module.yml b/lib/modules/smart_module.yml similarity index 100% rename from lib/app/modules/smart_module.yml rename to lib/modules/smart_module.yml diff --git a/lib/app/modules/us_core_guidance/README.md b/lib/modules/us_core_guidance/README.md similarity index 100% rename from lib/app/modules/us_core_guidance/README.md rename to lib/modules/us_core_guidance/README.md diff --git a/lib/app/modules/us_core_guidance/clinicalnotes_sequence.rb b/lib/modules/us_core_guidance/clinicalnotes_sequence.rb similarity index 100% rename from lib/app/modules/us_core_guidance/clinicalnotes_sequence.rb rename to lib/modules/us_core_guidance/clinicalnotes_sequence.rb diff --git a/lib/app/modules/us_core_guidance/r4_provenance_sequence.rb b/lib/modules/us_core_guidance/r4_provenance_sequence.rb similarity index 100% rename from lib/app/modules/us_core_guidance/r4_provenance_sequence.rb rename to lib/modules/us_core_guidance/r4_provenance_sequence.rb diff --git a/lib/modules/us_core_guidance/us_core_patient_read_only_sequence.rb b/lib/modules/us_core_guidance/us_core_patient_read_only_sequence.rb new file mode 100644 index 000000000..f5bddfafc --- /dev/null +++ b/lib/modules/us_core_guidance/us_core_patient_read_only_sequence.rb @@ -0,0 +1,130 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCoreR4PatientReadOnlySequence < SequenceBase + title 'Patient' + + description 'Verify that Patient resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'ARPA' + + requires :token, :patient_id + conformance_supports :Patient + + test 'Server rejects patient read without proper authorization' do + metadata do + id '01' + link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + description %( + A patient read does not work without authorization. + ) + versions :r4 + end + + @client.set_no_auth + skip 'Could not verify this functionality when bearer token is not set' if @instance.token.blank? + + reply = @client.read(versioned_resource_class('Patient'), @instance.patient_id) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Patient read resource' do + metadata do + id '02' + link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + description %( + All servers SHALL make available the read interactions for the Argonaut Profiles the server chooses to support. + ) + versions :r4 + end + + patient_read_response = @client.read(versioned_resource_class('Patient'), @instance.patient_id) + assert_response_ok patient_read_response + @patient = patient_read_response.resource + assert !@patient.nil?, 'Expected valid Patient resource to be present' + assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' + end + + test 'Patient validates against Argonaut Profile' do + metadata do + id '03' + link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' + description %( + A server returns valid FHIR Patient resources according to the [Data Access Framework (DAF) Patient Profile](http://www.fhir.org/guides/argonaut/r2/StructureDefinition-argo-patient.html). + ) + versions :r4 + end + + assert !@patient.nil?, 'Expected valid Patient resource to be present' + assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' + profile = Inferno::ValidationUtil.guess_profile(@patient, @instance.fhir_version.to_sym) + errors = profile.validate_resource(@patient) + assert errors.empty?, "Patient did not validate against profile: #{errors.join(', ')}" + end + + test 'Patient has address' do + metadata do + id '04' + description %( + Additional Patient resource requirement + ) + versions :r4 + end + + assert !@patient.nil?, 'Expected valid Patient resource to be present' + assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' + address = @patient.try(:address).try(:first) + assert !address.nil?, 'Patient address not returned' + end + + test 'Patient has telecom' do + metadata do + id '05' + description %( + Additional Patient resource requirement + ) + versions :r4 + end + + assert !@patient.nil?, 'Expected valid Patient resource to be present' + assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' + telecom = @patient.try(:telecom).try(:first) + assert !telecom.nil?, 'Patient telecom not returned' + end + + # test 'Patient supports $everything operation' do + + # metadata { + # id '00' + # optional + # description %( + # Additional Patient resource requirement + # ) + # } + # test 'Patient supports $everything operation', '', 'DISCUSSION REQUIRED', :optional do + # everything_response = @client.fetch_patient_record(@instance.patient_id) + # skip_unless [200, 201].include?(everything_response.code) + # @everything = everything_response.resource + # assert !@everything.nil?, 'Expected valid Bundle resource on $everything request' + # assert @everything.is_a?(versioned_resource_class('Bundle')), 'Expected resource to be valid Bundle' + # end + + test 'All references can be resolved' do + metadata do + id '06' + link 'https://www.hl7.org/fhir/r4references.html' + description %( + All references in the Patient resource should be resolveable. + ) + versions :r4 + end + + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + validate_reference_resolutions(@patient) + end + end + end +end diff --git a/lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb b/lib/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb similarity index 100% rename from lib/app/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb rename to lib/modules/us_core_guidance/us_core_r4_capability_statement_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb rename to lib/modules/uscore_v3.0.0/pediatric_bmi_for_age_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb rename to lib/modules/uscore_v3.0.0/pediatric_weight_for_height_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_careplan_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_careplan_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_careplan_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_careteam_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_careteam_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_careteam_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_condition_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_condition_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_condition_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_device_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_device_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_device_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_diagnosticreport_lab_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_diagnosticreport_note_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_encounter_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_encounter_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_encounter_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_goal_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_goal_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_goal_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_immunization_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_immunization_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_immunization_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_location_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_location_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_location_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medication_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_medication_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_medication_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_medication_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_observation_lab_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_organization_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_organization_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_organization_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_patient_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_patient_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_patient_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_procedure_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_procedure_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_procedure_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb rename to lib/modules/uscore_v3.0.0/us_core_smokingstatus_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.0_module.yml b/lib/modules/uscore_v3.0.0_module.yml similarity index 100% rename from lib/app/modules/uscore_v3.0.0_module.yml rename to lib/modules/uscore_v3.0.0_module.yml diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb rename to lib/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb rename to lib/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_allergyintolerance_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_careplan_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_careplan_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_careplan_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_careteam_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_careteam_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_careteam_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_condition_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_condition_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_condition_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_documentreference_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_encounter_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_encounter_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_encounter_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_goal_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_goal_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_goal_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_immunization_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_immunization_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_immunization_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_implantable_device_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_location_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_location_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_location_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_medication_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_medication_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_medication_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_medicationrequest_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_organization_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_organization_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_organization_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_patient_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_patient_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_patient_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_practitioner_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_practitionerrole_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_procedure_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_procedure_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_procedure_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_provenance_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_provenance_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_provenance_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_provenance_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_pulse_oximetry_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb similarity index 100% rename from lib/app/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb rename to lib/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb diff --git a/lib/app/modules/uscore_v3.0.1_module.yml b/lib/modules/uscore_v3.0.1_module.yml similarity index 100% rename from lib/app/modules/uscore_v3.0.1_module.yml rename to lib/modules/uscore_v3.0.1_module.yml From 5687c772d181bf5faa28dc8e82fb5d279e20b9db Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 30 Oct 2019 14:04:55 -0400 Subject: [PATCH 063/173] update module paths --- generator/generator_base.rb | 2 +- lib/app/models/module.rb | 2 +- lib/app/sequence_base.rb | 2 +- test/support/sequence_coverage_reporting.rb | 8 ++++---- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/generator/generator_base.rb b/generator/generator_base.rb index c4c223bf1..ef1ec9e52 100644 --- a/generator/generator_base.rb +++ b/generator/generator_base.rb @@ -72,7 +72,7 @@ def sequence_prefix end def module_yml_out_path - File.expand_path('./lib/app/modules/') + File.expand_path('./lib/modules/') end def sequence_out_path diff --git a/lib/app/models/module.rb b/lib/app/models/module.rb index 36eec30c6..ed64e204a 100644 --- a/lib/app/models/module.rb +++ b/lib/app/models/module.rb @@ -72,7 +72,7 @@ def self.available_modules @modules end - Dir.glob(File.join(__dir__, '..', 'modules', '*_module.yml')).each do |file| + Dir.glob(File.join(__dir__, '..', '..', 'modules', '*_module.yml')).each do |file| this_module = YAML.load_file(file).deep_symbolize_keys new(this_module) end diff --git a/lib/app/sequence_base.rb b/lib/app/sequence_base.rb index fe9d8d7c1..f86fbef30 100644 --- a/lib/app/sequence_base.rb +++ b/lib/app/sequence_base.rb @@ -785,6 +785,6 @@ def fetch_all_bundled_resources(bundle) end end - Dir.glob(File.join(__dir__, 'modules', '**', '*_sequence.rb')).each { |file| require file } + Dir.glob(File.join(__dir__, '..', 'modules', '**', '*_sequence.rb')).each { |file| require file } end end diff --git a/test/support/sequence_coverage_reporting.rb b/test/support/sequence_coverage_reporting.rb index 79530969e..64b1c5ec6 100644 --- a/test/support/sequence_coverage_reporting.rb +++ b/test/support/sequence_coverage_reporting.rb @@ -34,7 +34,7 @@ def location(node) end def stripped_file_name - @stripped_file_name ||= file_name.split('lib/app/').last + @stripped_file_name ||= file_name.split('lib/').last end end @@ -75,8 +75,8 @@ def add_assertion_call(result) end class AssertionCallLocationFormatter - SEQUENCE_LINE_REGEX = %r{inferno/lib/app/(modules/\w+/\w+\.rb:\d+)}.freeze - LINE_REGEX = %r{inferno/lib/app/((?:\w+/?)+\.rb:\d+)}.freeze + SEQUENCE_LINE_REGEX = %r{inferno/lib/(modules/\w+/\w+\.rb:\d+)}.freeze + LINE_REGEX = %r{inferno/lib/((?:\w+/?)+\.rb:\d+)}.freeze ASSERTION_CALL_REGEX = %r{inferno/lib/app/utils/assertions.rb:\d+}.freeze CALL_SEPARATOR = ' => ' @@ -205,7 +205,7 @@ def indirect_fail_count(location) end end -sequence_paths = File.join(__dir__, '..', '..', 'lib', 'app', 'modules', '*', '*.rb') +sequence_paths = File.join(__dir__, '..', '..', 'lib', 'modules', '*', '*.rb') Dir.glob(sequence_paths).sort.each do |sequence_file_name| file_contents = File.read(sequence_file_name) From 88b0508f4f1bbd343bdd2caff8731b2bbd36b638 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 30 Oct 2019 14:55:32 -0400 Subject: [PATCH 064/173] move argonaut tests --- ...onaut_allergy_intolerance_sequence_test.rb | 2 +- .../test}/argonaut_careplan_sequence_test.rb | 2 +- .../test}/argonaut_careteam_sequence_test.rb | 2 +- .../test}/argonaut_condition_sequence_test.rb | 2 +- .../test}/argonaut_device_sequence_test.rb | 2 +- ...rgonaut_diagnostic_report_sequence_test.rb | 2 +- .../test}/argonaut_goal_sequence_test.rb | 2 +- .../argonaut_immunization_sequence_test.rb | 2 +- ...argonaut_medication_order_sequence_test.rb | 2 +- ...naut_medication_statement_sequence_test.rb | 2 +- .../argonaut_observation_sequence_test.rb | 2 +- ...rgonaut_patient_read_only_sequence_test.rb | 2 +- .../argonaut_patient_search_sequence_test.rb | 2 +- .../test}/argonaut_procedure_sequence_test.rb | 2 +- .../argonaut_smoking_status_sequence_test.rb | 2 +- ...t_vital_signs_observation_sequence_test.rb | 2 +- .../test/fixtures/allergy_intolerance.json | 46 +++++ .../argonaut/test/fixtures/care_plan.json | 32 +++ .../argonaut/test/fixtures/care_team.json | 60 ++++++ .../argonaut/test/fixtures/condition.json | 76 +++++++ .../argonaut/test/fixtures/device.json | 28 +++ .../test/fixtures/diagnostic_report.json | 34 ++++ lib/modules/argonaut/test/fixtures/goal.json | 20 ++ .../argonaut/test/fixtures/immunization.json | 72 +++++++ .../test/fixtures/medication_order.json | 110 +++++++++++ .../test/fixtures/medication_reference.json | 17 ++ .../test/fixtures/medication_statement.json | 69 +++++++ .../argonaut/test/fixtures/observation.json | 46 +++++ .../argonaut/test/fixtures/patient.json | 186 ++++++++++++++++++ .../argonaut/test/fixtures/procedure.json | 22 +++ .../test/fixtures/smoking_status.json | 42 ++++ .../fixtures/vital_signs_observation.json | 39 ++++ 32 files changed, 915 insertions(+), 16 deletions(-) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_allergy_intolerance_sequence_test.rb (98%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_careplan_sequence_test.rb (98%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_careteam_sequence_test.rb (99%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_condition_sequence_test.rb (99%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_device_sequence_test.rb (98%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_diagnostic_report_sequence_test.rb (99%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_goal_sequence_test.rb (98%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_immunization_sequence_test.rb (98%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_medication_order_sequence_test.rb (99%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_medication_statement_sequence_test.rb (99%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_observation_sequence_test.rb (98%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_patient_read_only_sequence_test.rb (98%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_patient_search_sequence_test.rb (98%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_procedure_sequence_test.rb (98%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_smoking_status_sequence_test.rb (98%) rename {test/sequence/argonaut => lib/modules/argonaut/test}/argonaut_vital_signs_observation_sequence_test.rb (98%) create mode 100644 lib/modules/argonaut/test/fixtures/allergy_intolerance.json create mode 100644 lib/modules/argonaut/test/fixtures/care_plan.json create mode 100644 lib/modules/argonaut/test/fixtures/care_team.json create mode 100644 lib/modules/argonaut/test/fixtures/condition.json create mode 100644 lib/modules/argonaut/test/fixtures/device.json create mode 100644 lib/modules/argonaut/test/fixtures/diagnostic_report.json create mode 100644 lib/modules/argonaut/test/fixtures/goal.json create mode 100644 lib/modules/argonaut/test/fixtures/immunization.json create mode 100644 lib/modules/argonaut/test/fixtures/medication_order.json create mode 100644 lib/modules/argonaut/test/fixtures/medication_reference.json create mode 100644 lib/modules/argonaut/test/fixtures/medication_statement.json create mode 100644 lib/modules/argonaut/test/fixtures/observation.json create mode 100644 lib/modules/argonaut/test/fixtures/patient.json create mode 100644 lib/modules/argonaut/test/fixtures/procedure.json create mode 100644 lib/modules/argonaut/test/fixtures/smoking_status.json create mode 100644 lib/modules/argonaut/test/fixtures/vital_signs_observation.json diff --git a/test/sequence/argonaut/argonaut_allergy_intolerance_sequence_test.rb b/lib/modules/argonaut/test/argonaut_allergy_intolerance_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_allergy_intolerance_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_allergy_intolerance_sequence_test.rb index 006178c0f..ea1fc9648 100644 --- a/test/sequence/argonaut/argonaut_allergy_intolerance_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_allergy_intolerance_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautAllergyIntoleranceSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_careplan_sequence_test.rb b/lib/modules/argonaut/test/argonaut_careplan_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_careplan_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_careplan_sequence_test.rb index 73863f2be..6cfbbc833 100644 --- a/test/sequence/argonaut/argonaut_careplan_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_careplan_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class CarePlanSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_careteam_sequence_test.rb b/lib/modules/argonaut/test/argonaut_careteam_sequence_test.rb similarity index 99% rename from test/sequence/argonaut/argonaut_careteam_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_careteam_sequence_test.rb index c384ada80..61ec87b70 100644 --- a/test/sequence/argonaut/argonaut_careteam_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_careteam_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class CareTeamSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_condition_sequence_test.rb b/lib/modules/argonaut/test/argonaut_condition_sequence_test.rb similarity index 99% rename from test/sequence/argonaut/argonaut_condition_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_condition_sequence_test.rb index c3620de1f..2f9142aca 100644 --- a/test/sequence/argonaut/argonaut_condition_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_condition_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautConditionSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_device_sequence_test.rb b/lib/modules/argonaut/test/argonaut_device_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_device_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_device_sequence_test.rb index 9692ea6bb..886a1b101 100644 --- a/test/sequence/argonaut/argonaut_device_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_device_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class DeviceSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_diagnostic_report_sequence_test.rb b/lib/modules/argonaut/test/argonaut_diagnostic_report_sequence_test.rb similarity index 99% rename from test/sequence/argonaut/argonaut_diagnostic_report_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_diagnostic_report_sequence_test.rb index 27987adce..70bb7173f 100644 --- a/test/sequence/argonaut/argonaut_diagnostic_report_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_diagnostic_report_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class DiagnosticReportTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_goal_sequence_test.rb b/lib/modules/argonaut/test/argonaut_goal_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_goal_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_goal_sequence_test.rb index a1f7ce347..a6f17602e 100644 --- a/test/sequence/argonaut/argonaut_goal_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_goal_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautGoalSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_immunization_sequence_test.rb b/lib/modules/argonaut/test/argonaut_immunization_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_immunization_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_immunization_sequence_test.rb index 342bd82fc..e81ac9734 100644 --- a/test/sequence/argonaut/argonaut_immunization_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_immunization_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautImmunizationTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_medication_order_sequence_test.rb b/lib/modules/argonaut/test/argonaut_medication_order_sequence_test.rb similarity index 99% rename from test/sequence/argonaut/argonaut_medication_order_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_medication_order_sequence_test.rb index 5682408e3..3bb30f470 100644 --- a/test/sequence/argonaut/argonaut_medication_order_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_medication_order_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautMedicationOrderSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_medication_statement_sequence_test.rb b/lib/modules/argonaut/test/argonaut_medication_statement_sequence_test.rb similarity index 99% rename from test/sequence/argonaut/argonaut_medication_statement_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_medication_statement_sequence_test.rb index 8595ba83c..0ab52965a 100644 --- a/test/sequence/argonaut/argonaut_medication_statement_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_medication_statement_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautMedicationStatementSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_observation_sequence_test.rb b/lib/modules/argonaut/test/argonaut_observation_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_observation_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_observation_sequence_test.rb index 460f90076..9bbf84570 100644 --- a/test/sequence/argonaut/argonaut_observation_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_observation_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautObservationSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_patient_read_only_sequence_test.rb b/lib/modules/argonaut/test/argonaut_patient_read_only_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_patient_read_only_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_patient_read_only_sequence_test.rb index 83be9a6e5..dd3b84599 100644 --- a/test/sequence/argonaut/argonaut_patient_read_only_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_patient_read_only_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautPatientReadOnlySequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_patient_search_sequence_test.rb b/lib/modules/argonaut/test/argonaut_patient_search_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_patient_search_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_patient_search_sequence_test.rb index e661bd2f0..bc04201d3 100644 --- a/test/sequence/argonaut/argonaut_patient_search_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_patient_search_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautPatientSearchSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_procedure_sequence_test.rb b/lib/modules/argonaut/test/argonaut_procedure_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_procedure_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_procedure_sequence_test.rb index b4d6df6fb..e57e7b054 100644 --- a/test/sequence/argonaut/argonaut_procedure_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_procedure_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautProcedureSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_smoking_status_sequence_test.rb b/lib/modules/argonaut/test/argonaut_smoking_status_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_smoking_status_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_smoking_status_sequence_test.rb index d9bb361ec..d6793c505 100644 --- a/test/sequence/argonaut/argonaut_smoking_status_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_smoking_status_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautSmokingStatusSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/argonaut/argonaut_vital_signs_observation_sequence_test.rb b/lib/modules/argonaut/test/argonaut_vital_signs_observation_sequence_test.rb similarity index 98% rename from test/sequence/argonaut/argonaut_vital_signs_observation_sequence_test.rb rename to lib/modules/argonaut/test/argonaut_vital_signs_observation_sequence_test.rb index 152dd07fa..a5393d1b8 100644 --- a/test/sequence/argonaut/argonaut_vital_signs_observation_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_vital_signs_observation_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ArgonautVitalSignsObservationSequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/lib/modules/argonaut/test/fixtures/allergy_intolerance.json b/lib/modules/argonaut/test/fixtures/allergy_intolerance.json new file mode 100644 index 000000000..c0a4c614a --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/allergy_intolerance.json @@ -0,0 +1,46 @@ + { + "resourceType": "AllergyIntolerance", + "id": "SMART-AllergyIntolerance-28", + "meta": { + "versionId": "3", + "lastUpdated": "2018-01-31T22:43:25.000+00:00" + }, + "text": { + "status": "generated", + "div": "
    Sensitivity to sulfonamide antibacterial
    " + }, + "recordedDate": "2000", + "patient": { + "reference": "Patient/SMART-1288992" + }, + "substance": { + "coding": [ + { + "system": "http://rxnav.nlm.nih.gov/REST/Ndfrt", + "code": "N0000175503", + "display": "sulfonamide antibacterial" + } + ], + "text": "sulfonamide antibacterial" + }, + "status": "confirmed", + "criticality": "CRITL", + "category": "medication", + "reaction": [ + { + "manifestation": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "271807003", + "display": "skin rash" + } + ], + "text": "skin rash" + } + ], + "severity": "mild" + } + ] +} \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/care_plan.json b/lib/modules/argonaut/test/fixtures/care_plan.json new file mode 100644 index 000000000..b0ac76b17 --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/care_plan.json @@ -0,0 +1,32 @@ +{ + "id": "85e027e0-103b-0136-6943-60f81dc2d82a", + "meta": { + "profile": [ + "http://fhir.org/guides/argonaut/StructureDefinition/argo-careplan" + ] + }, + "text": { + "status": "additional", + "div": "This example is modified from the Official Argonaut Implementation Guide at http://www.fhir.org/guides/argonaut/r2/CarePlan-colonoscopy.html" + }, + "subject": { + "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df", + "display": "Mrs. Rhea34 Ernser583" + }, + "status": "active", + "period": { + "start": "2018-03-05", + "end": "2018-03-05" + }, + "category": [ + { + "coding": [ + { + "system": "http://argonaut.hl7.org", + "code": "assess-plan" + } + ] + } + ], + "resourceType": "CarePlan" +} \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/care_team.json b/lib/modules/argonaut/test/fixtures/care_team.json new file mode 100644 index 000000000..dba371582 --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/care_team.json @@ -0,0 +1,60 @@ +{ + "id": "85e027e0-103b-0136-6943-60f81dc2d82a", + "meta": { + "profile": [ + "http://fhir.org/guides/argonaut/StructureDefinition/argo-careteam" + ] + }, + "text": { + "status": "additional", + "div": "This example is modified from the Official Argonaut Implementation Guide at http://www.fhir.org/guides/argonaut/r2/CarePlan-colonoscopy.html" + }, + "subject": { + "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df", + "display": "Mrs. Rhea34 Ernser583" + }, + "status": "active", + "category": [ + { + "coding": [ + { + "system": "http://argonaut.hl7.org/ValueSet/extension-codes", + "code": "careteam" + } + ] + } + ], + "participant": [ + { + "role": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "116154003", + "display": "Patient (person)" + } + ] + }, + "member": { + "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df", + "display": "Mrs. Rhea34 Ernser583" + } + }, + { + "role": { + "coding": [ + { + "system": "http://www.nucc.org", + "code": "207RC0000X", + "display": "Allopathic and Osteopathic Physicians:Internal Medicine:Cardiovascular Disease" + } + ] + }, + "member": { + "reference": "Practitioner/1", + "display": "Dr. Cayr (BMC PCP)" + } + } + ], + "resourceType": "CarePlan" +} \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/condition.json b/lib/modules/argonaut/test/fixtures/condition.json new file mode 100644 index 000000000..8f9e0bddb --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/condition.json @@ -0,0 +1,76 @@ +{ + "resourceType": "Condition", + "id": "f202", + "text": { + "status": "generated", + "div": "

    Generated Narrative with Details

    id: f202

    patient: Roel

    dateRecorded: 01/12/2012

    code: Malignant neoplastic disease (Details : {SNOMED CT code '363346000' = '363346000', given as 'Malignant neoplastic disease'})

    category: Diagnosis (Details : {http://hl7.org/fhir/condition-category code 'diagnosis' = 'Diagnosis)

    clinicalStatus: active

    verificationStatus: confirmed

    severity: Severe (Details : {SNOMED CT code '24484000' = '24484000', given as 'Severe'})

    onset: 52 years (Details: SNOMED CT code 258707000 = '258707000')

    Evidences

    -Detail
    *Erasmus' diagnostic report of Roel's tumor

    bodySite: Entire head and neck (Details : {SNOMED CT code '361355005' = '361355005', given as 'Entire head and neck'})

    " + }, + "patient": { + "reference": "Patient/f201", + "display": "Roel" + }, + "dateRecorded": "2012-12-01", + "_dateRecorded": { + "fhir_comments": [ + " It was not established during an encounter, but through a diagnostic report of december 2012 " + ] + }, + "code": { + "fhir_comments": [ + " The problem was asserted at December first " + ], + "coding": [ + { + "fhir_comments": [ + " The problem is a malignant tumor " + ], + "system": "http://snomed.info/sct", + "code": "363346000", + "display": "Malignant neoplastic disease" + } + ] + }, + "category": { + "coding": [ + { + "system": "http://hl7.org/fhir/condition-category", + "code": "problem" + }, + { + "system": "http://hl7.org/fhir/condition-category", + "code": "health-concern" + } + ] + }, + "clinicalStatus": "active", + "verificationStatus": "confirmed", + "severity": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "24484000", + "display": "Severe" + } + ] + }, + "onsetQuantity": { + "value": 52, + "unit": "years", + "system": "http://snomed.info/sct", + "code": "258707000" + }, + "bodySite": [ + { + "coding": [ + { + "fhir_comments": [ + " Head and neck malignancy " + ], + "system": "http://snomed.info/sct", + "code": "361355005", + "display": "Entire head and neck" + } + ] + } + ] + } \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/device.json b/lib/modules/argonaut/test/fixtures/device.json new file mode 100644 index 000000000..91f68976e --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/device.json @@ -0,0 +1,28 @@ +{ + "id": "8eb18b30-103b-0136-6943-60f81dc2d82a", + "meta": { + "profile": [ + "http://fhir.org/guides/argonaut/StructureDefinition/argo-device" + ] + }, + "text": { + "status": "generated", + "div": "This example is modified from the Official Argonaut Implementation Guide at http://www.fhir.org/guides/argonaut/r2/Device-udi-1.html" + }, + "type": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "468063009", + "display": "Coated femoral stem prosthesis, modular" + } + ] + }, + "status": "available", + "udi": "{01}09504000059118{17}141120{10}7654321D{21}10987654d321", + "patient": { + "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df", + "display": "Mrs. Rhea34 Ernser583" + }, + "resourceType": "Device" +} \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/diagnostic_report.json b/lib/modules/argonaut/test/fixtures/diagnostic_report.json new file mode 100644 index 000000000..c725f910b --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/diagnostic_report.json @@ -0,0 +1,34 @@ +{ + "id": "00cc87e0-77e9-449b-b713-43c22502cf1f", + "status": "final", + "category": { + "coding": [ + { + "system": "http://hl7.org/fhir/ValueSet/diagnostic-service-sections", + "code": "LAB" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "57698-3", + "display": "Lipid Panel" + } + ], + "text": "Lipid Panel" + }, + "subject": { + "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df" + }, + "encounter": { + "reference": "Encounter/593685e0-ba12-4b0d-9233-7b7772c8cc7e" + }, + "effectiveDateTime": "2010-03-01T15:15:00-05:00", + "issued": "2010-03-01T15:15:00.091-05:00", + "performer": { + "reference": "Practitioner/c82c182f-c49e-4f66-9809-8dc66cb8ffb4" + }, + "resourceType": "DiagnosticReport" +} \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/goal.json b/lib/modules/argonaut/test/fixtures/goal.json new file mode 100644 index 000000000..f080fecbc --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/goal.json @@ -0,0 +1,20 @@ +{ + "id": "2ec42e20-1046-0136-6944-60f81dc2d82a", + "meta": { + "profile": [ + "http://fhir.org/guides/argonaut/StructureDefinition/argo-goal" + ] + }, + "text": { + "status": "generated", + "div": "This example is modified from the Official Argonaut Implementation Guide at http://www.fhir.org/guides/argonaut/r2/Goal-goal-1.html" + }, + "subject": { + "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df", + "display": "Mrs. Rhea34 Ernser583" + }, + "description": "Patient is targeting a pulse oximetry of 92% and a weight of 195 lbs", + "status": "in-progress", + "statusDate": "2018-03-05", + "resourceType": "Goal" +} diff --git a/lib/modules/argonaut/test/fixtures/immunization.json b/lib/modules/argonaut/test/fixtures/immunization.json new file mode 100644 index 000000000..0c7075283 --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/immunization.json @@ -0,0 +1,72 @@ +{ + "resourceType": "Immunization", + "id": "example", + "text": { + "status": "generated", + "div": "

    Generated Narrative with Details

    id: example

    identifier: urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234

    status: completed

    date: 10/01/2013

    vaccineCode: Fluvax (Influenza) (Details : {urn:oid:1.2.36.1.2001.1005.17 code 'FLUVAX' = '??)

    patient: Patient/example

    wasNotGiven: false

    reported: false

    performer: Practitioner/example

    requester: Practitioner/example

    encounter: Encounter/example

    manufacturer: Organization/hl7

    location: Location/1

    lotNumber: AAJN11K

    expirationDate: 15/02/2015

    site: left arm (Details : {http://hl7.org/fhir/v3/ActSite code 'LA' = 'left arm', given as 'left arm'})

    route: Injection, intramuscular (Details : {http://hl7.org/fhir/v3/RouteOfAdministration code 'IM' = 'Injection, intramuscular', given as 'Injection, intramuscular'})

    doseQuantity: 5 mg (Details: http://unitsofmeasure.org code mg = '??')

    note: Notes on adminstration of vaccine

    Explanations

    -Reason
    *429060002 (Details : {SNOMED CT code '429060002' = '429060002)

    Reactions

    -DateDetailReported
    *10/01/2013Observation/exampletrue

    VaccinationProtocols

    -DoseSequenceDescriptionAuthoritySeriesSeriesDosesTargetDiseaseDoseStatusDoseStatusReason
    *1Vaccination Protocol Sequence 1Organization/hl7Vaccination Series 121857005 (Details : {SNOMED CT code '1857005' = '1857005)Counts (Details : {http://hl7.org/fhir/vaccination-protocol-dose-status code 'count' = 'Counts', given as 'Counts'})Cold chain break (Details : {http://hl7.org/fhir/vaccination-protocol-dose-status-reason code 'coldchbrk' = 'Cold chain break', given as 'Cold chain break'})
    " + }, + "identifier": [ + { + "system": "urn:ietf:rfc:3986", + "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" + } + ], + "status": "completed", + "date": "2013-01-10", + "vaccineCode": { + "coding": [ + { + "system": "urn:oid:1.2.36.1.2001.1005.17", + "code": "FLUVAX" + } + ], + "text": "Fluvax (Influenza)" + }, + "patient": { + "reference": "Patient/example" + }, + "wasNotGiven": false, + "reported": false, + "lotNumber": "AAJN11K", + "expirationDate": "2015-02-15", + "site": { + "coding": [ + { + "system": "http://hl7.org/fhir/v3/ActSite", + "code": "LA", + "display": "left arm" + } + ] + }, + "route": { + "coding": [ + { + "system": "http://hl7.org/fhir/v3/RouteOfAdministration", + "code": "IM", + "display": "Injection, intramuscular" + } + ] + }, + "doseQuantity": { + "value": 5, + "system": "http://unitsofmeasure.org", + "code": "mg" + }, + "note": [ + { + "text": "Notes on adminstration of vaccine" + } + ], + "explanation": { + "reason": [ + { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "429060002" + } + ] + } + ] + } + } \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/medication_order.json b/lib/modules/argonaut/test/fixtures/medication_order.json new file mode 100644 index 000000000..e0a7b7a45 --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/medication_order.json @@ -0,0 +1,110 @@ +{ + "resourceType": "MedicationOrder", + "id": "f001", + "text": { + "status": "generated", + "div": "

    Generated Narrative with Details

    id: f001

    identifier: order9837293 (OFFICIAL)

    dateWritten: 25/05/2013 7:32:52 PM

    status: active

    patient: P. van den Heuvel

    prescriber: R.A. van den Berk

    encounter: visit who leads to this priscription

    reason: Chronic obstructive pulmonary disease (Details : {SNOMED CT code '13645005' = '13645005', given as 'Chronic obstructive pulmonary disease'})

    medication: prescribed medication

    DosageInstructions

    -TextAdditionalInstructionsTimingSite[x]RouteDose[x]
    *3 tot 4 maal daags 1 flaconfor use during pregnancy, contact physician (Details )Starting 04/08/2013, Do 3 per 1 days, Until 05/11/2013Entire oral cavity (Details : {SNOMED CT code '181220002' = '181220002', given as 'Entire oral cavity'})oral administration of treatment (Details : {SNOMED CT code '394899003' = '394899003', given as 'oral administration of treatment'})10 ml (Details: http://unitsofmeasure.org code ml = '??')

    DispenseRequests

    -ValidityPeriodNumberOfRepeatsAllowedQuantityExpectedSupplyDuration
    *08/04/2013 --> 30/05/201320100 mcg (Details: urn:oid:2.16.840.1.113883.6.8 code ug = '??')40 days (Details: urn:oid:2.16.840.1.113883.6.8 code d = '??')
    " + }, + "identifier": [ + { + "use": "official", + "system": "http://www.bmc/portal/prescriptions", + "value": "order9837293" + } + ], + "dateWritten": "2013-05-25T19:32:52+01:00", + "status": "active", + "patient": { + "reference": "Patient/f001", + "display": "P. van den Heuvel" + }, + "prescriber": { + "reference": "Practitioner/f006", + "display": "R.A. van den Berk" + }, + "reasonCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "13645005", + "display": "Chronic obstructive pulmonary disease" + } + ] + }, + "medicationReference": { + "reference": "Medication/f001", + "display": "prescribed medication" + }, + "dosageInstruction": [ + { + "text": "3 tot 4 maal daags 1 flacon", + "additionalInstructions": { + "text": "for use during pregnancy, contact physician" + }, + "timing": { + "repeat": { + "boundsPeriod": { + "start": "2013-08-04", + "end": "2013-11-05" + }, + "frequency": 3, + "period": 1, + "periodUnits": "d" + } + }, + "siteCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "181220002", + "display": "Entire oral cavity" + } + ] + }, + "route": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "394899003", + "display": "oral administration of treatment" + } + ] + }, + "doseQuantity": { + "value": 10, + "unit": "ml", + "system": "http://unitsofmeasure.org", + "code": "ml" + } + } + ], + "dispenseRequest": { + "validityPeriod": { + "start": "2013-04-08", + "end": "2013-05-30" + }, + "numberOfRepeatsAllowed": 20, + "quantity": { + "value": 100, + "unit": "mcg", + "system": "urn:oid:2.16.840.1.113883.6.8", + "code": "ug", + "_code": { + "fhir_comments": [ + " http://unitsofmeasure.org (UCUM code system) " + ] + } + }, + "expectedSupplyDuration": { + "value": 40, + "unit": "days", + "system": "urn:oid:2.16.840.1.113883.6.8", + "code": "d", + "_code": { + "fhir_comments": [ + " http://unitsofmeasure.org (UCUM code system) " + ] + } + } + } + } \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/medication_reference.json b/lib/modules/argonaut/test/fixtures/medication_reference.json new file mode 100644 index 000000000..635b411d8 --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/medication_reference.json @@ -0,0 +1,17 @@ +{ + "resourceType": "Medication", + "id": "Medication15", + "text": { + "status": "generated", + "div": "

    Generated Narrative with Details

    id: medexample015

    contained: ,

    code: Capecitabine 500mg oral tablet (Xeloda) (Details : {RxNorm code '213293' = '213293', given as 'Capecitabine 500mg oral tablet (Xeloda)'})

    isBrand: true

    manufacturer: id: org2; name: Gene Inc

    form: Tablet dose form (qualifier value) (Details : {SNOMED CT code '385055001' = 'Tablet', given as 'Tablet dose form (qualifier value)'})

    Ingredients

    -Item[x]Amount
    *id: sub04; Capecitabine (substance) (Details : {SNOMED CT code '386906001' = 'Capecitabine', given as 'Capecitabine (substance)'})500 mg (Details: UCUM code mg = 'mg')/1 TAB (Details: http://hl7.org/fhir/v3/orderableDrugForm code TAB = 'Tablet')

    package

    container: Bottle - unit of produce usage (qualifier value) (Details : {SNOMED CT code '419672006' = 'Bottle', given as 'Bottle - unit of produce usage (qualifier value)'})

    Contents

    -Item[x]
    *Capecitabine 500mg tablets (product) (Details : {SNOMED CT code '134622004' = 'Capecitabine 500mg tablet', given as 'Capecitabine 500mg tablets (product)'})

    Batches

    -LotNumberExpirationDate
    *949478822/05/2017
    " + }, + "code": { + "coding": [ + { + "system": "http://www.nlm.nih.gov/research/umls/rxnorm", + "code": "213293", + "display": "Capecitabine 500mg oral tablet (Xeloda)" + } + ] + } +} \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/medication_statement.json b/lib/modules/argonaut/test/fixtures/medication_statement.json new file mode 100644 index 000000000..0f769dbd3 --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/medication_statement.json @@ -0,0 +1,69 @@ +{ + "resourceType": "MedicationStatement", + "id": "example001", + "text": { + "status": "generated", + "div": "
    \n

    Tylenol No 1 tablet - Taking 1 tablet four times daily as needed for pain

    \n
    " + }, + "patient": { + "reference": "Patient/pat1" + }, + "informationSource": { + "reference": "Patient/pat2" + }, + "dateAsserted": "2015-02-22", + "status": "completed", + "wasNotTaken": false, + "reasonForUseCodeableConcept": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "22253000", + "display": "Pain" + } + ] + }, + "effectiveDateTime": "2015-01-23", + "note": "Patient indicates they miss the occasional dose", + "medicationReference": { + "reference": "Medication/MedicationExample7" + }, + "dosage": [ + { + "text": "one tablet four times daily as needed for pain", + "timing": { + "repeat": { + "frequency": 4, + "period": 1, + "periodUnits": "d" + } + }, + "asNeededBoolean": true, + "route": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "260548002", + "display": "Oral" + } + ] + }, + "quantityQuantity": { + "value": 1 + }, + "maxDosePerPeriod": { + "numerator": { + "value": 4, + "unit": "tablets", + "system": "http://snomed.info/sct", + "code": "385055001" + }, + "denominator": { + "value": 1, + "system": "http://unitsofmeasure.org", + "code": "d" + } + } + } + ] +} \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/observation.json b/lib/modules/argonaut/test/fixtures/observation.json new file mode 100644 index 000000000..7871c1fe9 --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/observation.json @@ -0,0 +1,46 @@ +{ + "id": "a421b98b-5fd7-4595-9a12-486a1aa41e67", + "meta": { + "profile": [ + "http://fhir.org/guides/argonaut/StructureDefinition/argo-observationresults" + ] + }, + "status": "final", + "category": { + "coding": [ + { + "system": "http://hl7.org/fhir/observation-category", + "code": "vital-signs", + "display": "vital-signs" + }, + { + "system": "http://hl7.org/fhir/observation-category", + "code": "laboratory", + "display": "vital-signs" + } + ], + "text": "vital-signs" + }, + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Smoking Status" + } + ], + "text": "Smoking Status" + }, + "subject": { + "reference": "Patient/example" + }, + "effectiveDateTime": "2010-03-01", + "issued": "2010-03-01T15:30:10+01:00", + "valueQuantity": { + "value": 150.43678997612926, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + }, + "resourceType": "Observation" +} \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/patient.json b/lib/modules/argonaut/test/fixtures/patient.json new file mode 100644 index 000000000..61855e512 --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/patient.json @@ -0,0 +1,186 @@ +{ + "id": "7ec866ca-4130-4a40-82a9-b67f2626a5df", + "text": { + "status": "generated", + "div": "
    Generated by Synthea.Version identifier: v1.3.1-462-ga4e4ad9\n . Person seed: -6604010938320047939 Population seed: 1521224923924
    " + }, + "extension": [ + { + "url": "http://hl7.org/fhir/StructureDefinition/us-core-race", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://hl7.org/fhir/v3/Race", + "code": "2106-3", + "display": "White" + } + ], + "text": "White" + } + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/us-core-ethnicity", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://hl7.org/fhir/v3/Ethnicity", + "code": "2186-5", + "display": "Not Hispanic or Latino" + } + ], + "text": "Not Hispanic or Latino" + } + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName", + "valueString": "Kimi714 Hermiston71" + }, + { + "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", + "valueCode": "F" + }, + { + "url": "http://hl7.org/fhir/StructureDefinition/birthPlace", + "valueAddress": { + "city": "Mansfield", + "state": "Massachusetts", + "country": "US" + } + }, + { + "url": "http://synthetichealth.github.io/synthea/disability-adjusted-life-years", + "valueDecimal": 1.9189183066996247 + }, + { + "url": "http://synthetichealth.github.io/synthea/quality-adjusted-life-years", + "valueDecimal": 51.081081693300376 + } + ], + "identifier": [ + { + "system": "https://github.com/synthetichealth/synthea", + "value": "10a389cd-3422-4a98-9481-7eceec6118a9" + }, + { + "type": { + "coding": [ + { + "system": "http://hl7.org/fhir/v2/0203", + "code": "MR" + } + ] + }, + "system": "http://hospital.smarthealthit.org", + "value": "10a389cd-3422-4a98-9481-7eceec6118a9" + }, + { + "type": { + "coding": [ + { + "system": "http://hl7.org/fhir/identifier-type", + "code": "SB" + } + ] + }, + "system": "http://hl7.org/fhir/sid/us-ssn", + "value": "999-40-6899" + }, + { + "type": { + "coding": [ + { + "system": "http://hl7.org/fhir/v2/0203", + "code": "DL" + } + ] + }, + "system": "urn:oid:2.16.840.1.113883.4.3.25", + "value": "S99980352" + } + ], + "name": [ + { + "use": "official", + "family": [ + "Ernser583" + ], + "given": [ + "Rhea34" + ], + "prefix": [ + "Mrs." + ] + }, + { + "use": "maiden", + "family": [ + "Marks830" + ], + "given": [ + "Rhea34" + ], + "prefix": [ + "Mrs." + ] + } + ], + "telecom": [ + { + "system": "phone", + "value": "555-317-4311", + "use": "home" + } + ], + "gender": "female", + "birthDate": "1964-02-10", + "address": [ + { + "extension": [ + { + "extension": [ + { + "url": "latitude", + "valueDecimal": -71.281889 + }, + { + "url": "longitude", + "valueDecimal": 42.499295000000004 + } + ], + "url": "http://hl7.org/fhir/StructureDefinition/geolocation" + } + ], + "line": [ + "554 Cummings Lane Suite 22" + ], + "city": "Bedford", + "state": "Massachusetts", + "postalCode": "01730", + "country": "US" + } + ], + "maritalStatus": { + "coding": [ + { + "system": "http://hl7.org/fhir/v3/MaritalStatus", + "code": "M" + } + ] + }, + "multipleBirthBoolean": false, + "communication": [ + { + "language": { + "coding": [ + { + "system": "urn:ietf:bcp:47", + "code": "en-US", + "display": "English" + } + ], + "text": "English" + } + } + ], + "resourceType": "Patient" +} \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/procedure.json b/lib/modules/argonaut/test/fixtures/procedure.json new file mode 100644 index 000000000..82a6a74ce --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/procedure.json @@ -0,0 +1,22 @@ +{ + "id": "92134275-3ce9-4867-a2e9-49d712f91a1e", + "subject": { + "reference": "Patient/example" + }, + "status": "completed", + "code": { + "coding": [ + { + "system": "http://snomed.info/sct", + "code": "755621000000101", + "display": "Replacement of subcutaneous contraceptive" + } + ], + "text": "Replacement of subcutaneous contraceptive" + }, + "performedPeriod": { + "start": "2010-08-09", + "end": "2010-08-09" + }, + "resourceType": "Procedure" + } \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/smoking_status.json b/lib/modules/argonaut/test/fixtures/smoking_status.json new file mode 100644 index 000000000..8ede49168 --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/smoking_status.json @@ -0,0 +1,42 @@ +{ + "id": "1ce7d12f-09eb-49b0-b4c4-7870ce3236b5", + "status": "final", + "category": { + "coding": [ + { + "system": "http://hl7.org/fhir/observation-category", + "code": "72166-2", + "display": "vital-signs" + } + ], + "text": "vital-signs" + }, + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "72166-2", + "display": "Vital Signs" + } + ], + "text": "Vital Signs" + }, + "subject": { + "reference": "7ec866ca-4130-4a40-82a9-b67f2626a5df" + }, + "encounter": { + "reference": "593685e0-ba12-4b0d-9233-7b7772c8cc7e" + }, + "effectiveDateTime": "2010-03-01T15:15:00-05:00", + "issued": "2010-03-01T15:15:00.091-05:00", + "valueCodeableConcept": { + "coding": [ + { + "system": "http://loinc.org", + "code": "29463-7", + "display": "Body weight" + } + ] + }, + "resourceType": "Observation" +} \ No newline at end of file diff --git a/lib/modules/argonaut/test/fixtures/vital_signs_observation.json b/lib/modules/argonaut/test/fixtures/vital_signs_observation.json new file mode 100644 index 000000000..0166aa8b9 --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/vital_signs_observation.json @@ -0,0 +1,39 @@ +{ + "id": "a421b98b-5fd7-4595-9a12-486a1aa41e67", + "status": "final", + "category": { + "coding": [ + { + "system": "http://hl7.org/fhir/observation-category", + "code": "vital-signs", + "display": "vital-signs" + } + ], + "text": "vital-signs" + }, + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "8302-2", + "display": "Body Height" + } + ], + "text": "Body Height" + }, + "subject": { + "reference": "Patient/example" + }, + "encounter": { + "reference": "593685e0-ba12-4b0d-9233-7b7772c8cc7e" + }, + "effectiveDateTime": "2010-03-01", + "issued": "2010-03-01T15:30:10+01:00", + "valueQuantity": { + "value": 150.43678997612926, + "unit": "cm", + "system": "http://unitsofmeasure.org", + "code": "cm" + }, + "resourceType": "Observation" +} \ No newline at end of file From 5d5d698e60fe559c9ddb2b9e4bfecd0cc56a08f0 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 31 Oct 2019 12:24:20 -0400 Subject: [PATCH 065/173] update Rakefile to run tests from lib/module --- Rakefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Rakefile b/Rakefile index d91d3e860..1a178660d 100644 --- a/Rakefile +++ b/Rakefile @@ -15,6 +15,7 @@ end Rake::TestTask.new(:test) do |t| t.libs << 'test' t.pattern = 'test/**/*_test.rb' + t.test_files = Dir.glob('lib/modules/*/test/*_test.rb') t.verbose = true t.warning = false end From 0ddf036debf8ca681caa1117cf6185d61bbdccb6 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 31 Oct 2019 12:24:34 -0400 Subject: [PATCH 066/173] update test_helper to dynamically determine fixture location --- test/test_helper.rb | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/test/test_helper.rb b/test/test_helper.rb index f3149704a..93df95b94 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -26,23 +26,36 @@ def create_assertion_report? require_relative '../lib/app' +def find_fixture_directory(test_directory = nil) + test_directory ||= + caller_locations + .find { |trace| !trace.path.include? 'test_helper.rb' } + .path + .match(/(\/.*\/)\w+\.rb/) + .captures + .first + + fixture_directory = File.join(test_directory, 'fixtures') + return fixture_directory if Dir.exist? fixture_directory + + test_directory = File.expand_path(File.join(test_directory, '..')) + raise 'Unable to find fixture directory' if test_directory == '/' + + find_fixture_directory(test_directory) +end + def load_json_fixture(file) JSON.parse(load_fixture(file)) end def load_fixture(file) - root = File.dirname(File.absolute_path(__FILE__)) - File.read(File.join(root, 'fixtures', "#{file}.json")) + fixture_path = find_fixture_directory + File.read(File.join(fixture_path, "#{file}.json")) end def load_fixture_with_extension(file_name) - root = File.dirname(File.absolute_path(__FILE__)) - File.read(File.join(root, 'fixtures', file_name)) -end - -def save_fixture(_file_name, content) - root = File.dirname(File.absolute_path(__FILE__)) - File.write(File.join(root, 'fixtures', file.to_s), content) + fixture_path = find_fixture_directory + File.read(File.join(fixture_path, file_name)) end def valid_uri?(uri) From 79e484eedceb06c526aaa00bfd97fa8a1356971d Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 31 Oct 2019 12:33:24 -0400 Subject: [PATCH 067/173] move onc_program tests --- .../test/fixtures/document_reference.json | 51 ++++++++++++++++ .../onc_program/test/fixtures/provenance.json | 21 +++++++ .../test/fixtures/smart_configuration.json | 32 ++++++++++ .../test/fixtures/smart_metadata.json | 61 +++++++++++++++++++ .../onc_program_document_reference_test.rb | 2 +- .../test}/onc_program_provenance_test.rb | 2 +- .../onc_smart_discovery_sequence_test.rb | 2 +- 7 files changed, 168 insertions(+), 3 deletions(-) create mode 100644 lib/modules/onc_program/test/fixtures/document_reference.json create mode 100644 lib/modules/onc_program/test/fixtures/provenance.json create mode 100644 lib/modules/onc_program/test/fixtures/smart_configuration.json create mode 100644 lib/modules/onc_program/test/fixtures/smart_metadata.json rename {test/sequence/onc_program => lib/modules/onc_program/test}/onc_program_document_reference_test.rb (98%) rename {test/sequence/onc_program => lib/modules/onc_program/test}/onc_program_provenance_test.rb (98%) rename {test/sequence/onc_program => lib/modules/onc_program/test}/onc_smart_discovery_sequence_test.rb (96%) diff --git a/lib/modules/onc_program/test/fixtures/document_reference.json b/lib/modules/onc_program/test/fixtures/document_reference.json new file mode 100644 index 000000000..d23d24fd3 --- /dev/null +++ b/lib/modules/onc_program/test/fixtures/document_reference.json @@ -0,0 +1,51 @@ +{ + "resourceType": "DocumentReference", + "id": "1234", + "subject": { + "reference": "Patient/1234" + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://loinc.org", + "code": "34108-1", + "display": "Outpatient Note" + } + ] + }, + "class": { + "coding": [ + { + "system": "http://ihe.net/xds/connectathon/classCodes", + "code": "History and Physical", + "display": "History and Physical" + } + ] + }, + "author": [ + { + "reference": "Practitioner/abcd" + } + ], + "created": "2005-12-24T09:35:00+11:00", + "indexed": "2005-12-24T09:43:41+11:00", + "content": [ + { + "attachment": { + "contentType": "application/hl7-v3+xml", + "language": "en-US", + "url": "http://example.org/xds/mhd/Binary/07a6483f-732b-461e-86b6-edb665c45510", + "size": 3654, + "hash": "2jmj7l5rSw0yVb/vlWAYkK/YBwk=" + }, + "format": [ + { + "system": "urn:oid:1.3.6.1.4.1.19376.1.2.3", + "code": "urn:ihe:pcc:handp:2008", + "display": "History and Physical Specification" + } + ] + } + ] +} \ No newline at end of file diff --git a/lib/modules/onc_program/test/fixtures/provenance.json b/lib/modules/onc_program/test/fixtures/provenance.json new file mode 100644 index 000000000..2222f3cb3 --- /dev/null +++ b/lib/modules/onc_program/test/fixtures/provenance.json @@ -0,0 +1,21 @@ +{ + "resourceType": "Provenance", + "id": "1", + "target": [ + { + "reference": "Patient/1234" + } + ], + "recorded": "2009-10-10T12:00:00-05:00", + "agent": [ + { + "role": { + "system": "http://hl7.org/fhir/provenance-participant-role", + "code": "enterer" + }, + "actor": { + "reference": "Practitioner/abc" + } + } + ] +} diff --git a/lib/modules/onc_program/test/fixtures/smart_configuration.json b/lib/modules/onc_program/test/fixtures/smart_configuration.json new file mode 100644 index 000000000..e03e434c3 --- /dev/null +++ b/lib/modules/onc_program/test/fixtures/smart_configuration.json @@ -0,0 +1,32 @@ +{ + "authorization_endpoint": "https://www.example.com/authorize", + "token_endpoint": "https://www.example.com/token", + "token_endpoint_auth_methods_supported": ["client_secret_basic"], + "registration_endpoint": "https://www.example.com/register", + "scopes_supported": [ + "openid", + "profile", + "launch", + "launch/patient", + "patient/*.*", + "user/*.*", + "offline_access" + ], + "response_types_supported": ["code", "code id_token", "id_token", "refresh_token"], + "management_endpoint": "https://www.example.com/manage", + "introspection_endpoint": "https://www.example.com/introspect", + "revocation_endpoint": "https://www.example.com/revoke", + "capabilities": [ + "launch-ehr", + "launch-standalone", + "client-public", + "client-confidential-symmetric", + "sso-openid-connect", + "context-ehr-patient", + "context-standalone-patient", + "context-standalone-encounter", + "permission-offline", + "permission-patient", + "permission-user" + ] +} diff --git a/lib/modules/onc_program/test/fixtures/smart_metadata.json b/lib/modules/onc_program/test/fixtures/smart_metadata.json new file mode 100644 index 000000000..3f4a28912 --- /dev/null +++ b/lib/modules/onc_program/test/fixtures/smart_metadata.json @@ -0,0 +1,61 @@ +{ + "resourceType": "CapabilityStatement", + "publisher": "Not provided", + "date": "2018-02-10T04:02:11+00:00", + "kind": "instance", + "fhirVersion": "4.0.0", + "acceptUnknown": "extensions", + "format": [ + "application/xml+fhir", + "application/json+fhir" + ], + "rest": [ + { + "mode": "server", + "security": { + "extension": [ + { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris", + "extension": [ + { + "url": "authorize", + "valueUri": "https://www.example.com/authorize" + }, + { + "url": "token", + "valueUri": "https://www.example.com/token" + }, + { + "url": "register", + "valueUri": "https://www.example.com/register" + }, + { + "url": "manage", + "valueUri": "https://www.example.com/manage" + }, + { + "url": "introspect", + "valueUri": "https://www.example.com/introspect" + }, + { + "url": "revoke", + "valueUri": "https://www.example.com/revoke" + } + ] + } + ], + "service": [ + { + "coding": [ + { + "system": "http://hl7.org/fhir/restful-security-service", + "code": "SMART-on-FHIR" + } + ], + "text": "OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)" + } + ] + } + } + ] +} diff --git a/test/sequence/onc_program/onc_program_document_reference_test.rb b/lib/modules/onc_program/test/onc_program_document_reference_test.rb similarity index 98% rename from test/sequence/onc_program/onc_program_document_reference_test.rb rename to lib/modules/onc_program/test/onc_program_document_reference_test.rb index 0a1a86efc..195cebb6c 100644 --- a/test/sequence/onc_program/onc_program_document_reference_test.rb +++ b/lib/modules/onc_program/test/onc_program_document_reference_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ONCProgramDocumentReferenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/onc_program/onc_program_provenance_test.rb b/lib/modules/onc_program/test/onc_program_provenance_test.rb similarity index 98% rename from test/sequence/onc_program/onc_program_provenance_test.rb rename to lib/modules/onc_program/test/onc_program_provenance_test.rb index 8bf7b522a..87ab2e6f3 100644 --- a/test/sequence/onc_program/onc_program_provenance_test.rb +++ b/lib/modules/onc_program/test/onc_program_provenance_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ONCProgramProvenanceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/test/sequence/onc_program/onc_smart_discovery_sequence_test.rb b/lib/modules/onc_program/test/onc_smart_discovery_sequence_test.rb similarity index 96% rename from test/sequence/onc_program/onc_smart_discovery_sequence_test.rb rename to lib/modules/onc_program/test/onc_smart_discovery_sequence_test.rb index 06d5629e6..ce027b096 100644 --- a/test/sequence/onc_program/onc_smart_discovery_sequence_test.rb +++ b/lib/modules/onc_program/test/onc_smart_discovery_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class ONCSMARTDiscoveryTest < MiniTest::Test def setup instance = get_test_instance From 9e0b7f4146254c76def3ac1448cfdbac6aa9b731 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 31 Oct 2019 12:39:56 -0400 Subject: [PATCH 068/173] move smart tests --- .../smart/test}/dynamic_registration_test.rb | 2 +- .../modules/smart/test}/ehr_launch_test.rb | 2 +- .../test/fixtures/dynamic_registration.json | 1 + .../test/fixtures/openid_configuration.json | 14 ++ .../fixtures/standalone_token_exchange.json | 8 + .../smart/test}/openid_connect_test.rb | 2 +- .../smart/test}/standalone_launch_test.rb | 2 +- .../smart/test}/token_introspection_test.rb | 2 +- .../test}/token_refresh_sequence_test.rb | 200 ++++++++++++++++- test/sequence/token_refresh_sequence_test.rb | 203 ------------------ 10 files changed, 227 insertions(+), 209 deletions(-) rename {test/sequence => lib/modules/smart/test}/dynamic_registration_test.rb (98%) rename {test/sequence => lib/modules/smart/test}/ehr_launch_test.rb (99%) create mode 100644 lib/modules/smart/test/fixtures/dynamic_registration.json create mode 100644 lib/modules/smart/test/fixtures/openid_configuration.json create mode 100644 lib/modules/smart/test/fixtures/standalone_token_exchange.json rename {test/sequence => lib/modules/smart/test}/openid_connect_test.rb (99%) rename {test/sequence => lib/modules/smart/test}/standalone_launch_test.rb (98%) rename {test/sequence => lib/modules/smart/test}/token_introspection_test.rb (99%) rename {test/sequence/smart => lib/modules/smart/test}/token_refresh_sequence_test.rb (55%) delete mode 100644 test/sequence/token_refresh_sequence_test.rb diff --git a/test/sequence/dynamic_registration_test.rb b/lib/modules/smart/test/dynamic_registration_test.rb similarity index 98% rename from test/sequence/dynamic_registration_test.rb rename to lib/modules/smart/test/dynamic_registration_test.rb index 404dcfdd7..7a026e14c 100644 --- a/test/sequence/dynamic_registration_test.rb +++ b/lib/modules/smart/test/dynamic_registration_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../test_helper' +require_relative '../../../../test/test_helper' # Tests for the DynamicRegistrationSequence # Note: This test currently only considers dstu2 diff --git a/test/sequence/ehr_launch_test.rb b/lib/modules/smart/test/ehr_launch_test.rb similarity index 99% rename from test/sequence/ehr_launch_test.rb rename to lib/modules/smart/test/ehr_launch_test.rb index 43617f080..a7011f0c8 100644 --- a/test/sequence/ehr_launch_test.rb +++ b/lib/modules/smart/test/ehr_launch_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../test_helper' +require_relative '../../../../test/test_helper' # Tests for the EHRLaunchSequence # Note: This test currently only considers dstu2 diff --git a/lib/modules/smart/test/fixtures/dynamic_registration.json b/lib/modules/smart/test/fixtures/dynamic_registration.json new file mode 100644 index 000000000..d50e50b79 --- /dev/null +++ b/lib/modules/smart/test/fixtures/dynamic_registration.json @@ -0,0 +1 @@ +{"client_id":"72e731c6-648c-4947-af23-4518a312c845","client_id_issued_at":1518316591,"registration_access_token":"eyJraWQiOiJyc2ExIiwiYWxnIjoiUlMyNTYifQ.eyJhdWQiOiI3MmU3MzFjNi02NDhjLTQ5NDctYWYyMy00NTE4YTMxMmM4NDUiLCJpc3MiOiJodHRwczpcL1wvc2ItYXV0aC5zbWFydGhlYWx0aGl0Lm9yZ1wvIiwiaWF0IjoxNTE4MzE2NTkxLCJqdGkiOiI3M2E3MmYyMS1lN2EzLTQyYWYtODc2Ni0yYTM4NWE5NGU2MGUifQ.E3rAYVXltDOkRyLJjUxHct_8AM7O-paxKpLZ3hEkUCXkHfec6zCrnfYYbUfAguJ645Ahl2_avMbI9YxP7oqfYSO_hgxHEoE5MXA_mnp7wjJvwQp_DKlh4OrOvFV8gxyusXTVoP3IBu7VN_kqZKmoV-4QzxaKN9_GqU0YN8SPbgZRgLoawmgLXlwmhjblEufUFjt5mPcQoFsx-hQ15HX3kzb2egPMGNAlv_DMpuHxxIUjRC5NY1_Hz9xI7JlVD4PHetq35m3pc-hleunb45mPH5Bk7gjwShXIPcHHDslWZawKFU3Ho3EGJpB9eGZgvhQ4gSntLvMsJUFJAVbPqxrkgw","registration_client_uri":"https://sb-auth.smarthealthit.org/register/72e731c6-648c-4947-af23-4518a312c845","redirect_uris":["http://localhost:4567/smart/4ffksQ/3mWi7k/redirect"],"client_name":"Inferno","token_endpoint_auth_method":"none","scope":"launch/patient online_access openid profile launch user/*.* patient/*.*","grant_types":["authorization_code"],"response_types":["code"],"initiate_login_uri":"http://localhost:4567/smart/4ffksQ /3mWi7k/launch"} \ No newline at end of file diff --git a/lib/modules/smart/test/fixtures/openid_configuration.json b/lib/modules/smart/test/fixtures/openid_configuration.json new file mode 100644 index 000000000..79344b127 --- /dev/null +++ b/lib/modules/smart/test/fixtures/openid_configuration.json @@ -0,0 +1,14 @@ +{ + "registration_endpoint": "https://www.example.com/register", + "token_endpoint": "https://www.example.com/token", + "token_endpoint_auth_methods_supported": ["client_secret_post", "client_secret_basic", "none"], + "jwks_uri": "https://www.example.com/jwk", + "id_token_signing_alg_values_supported": ["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "none"], + "authorization_endpoint": "https://www.example.com/authorize", + "introspection_endpoint": "https://www.example.com/introspect", + "response_types_supported": ["code"], + "grant_types_supported": ["authorization_code"], + "scopes_supported": ["launch", "openid", "patient/*.*", "profile"], + "userinfo_endpoint": "https://www.example.com/userinfo", + "issuer": "https://www.example.com/" +} diff --git a/lib/modules/smart/test/fixtures/standalone_token_exchange.json b/lib/modules/smart/test/fixtures/standalone_token_exchange.json new file mode 100644 index 000000000..f3428af0d --- /dev/null +++ b/lib/modules/smart/test/fixtures/standalone_token_exchange.json @@ -0,0 +1,8 @@ +{ + "access_token":"eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIwYWYwNmU5My0zMTJhLTQwZGEtOTlkYS00ZDVjYjUyYzYwZTQiLCJpc3MiOiJodHRwczpcL1wvc2ItYXV0aC5zbWFydGhlYWx0aGl0Lm9yZ1wvIiwiZXhwIjoxNTE4Mzc5MjgzLCJpYXQiOjE1MTgzNzU2ODMsImp0aSI6IjNmMWUwYmJmLWQ2MDMtNGE1Ni04MDEzLTZkYjYxYzVkMWVhNyJ9.iVnDGZD3WgFZu7BMTwNUoZ--xHedHfoeE9EfisGDNsn5qmh8AJfcyyM55v8BgqfQ7szMqdZctOPl4xfJoi5OxQT3SpMfYQ8vPQg1T530YZt5ik6OUP86QpvE0VEEM4cEq1YDHyDl3FsU4oKyb6uJR7PwULiG6Qpij0ydzQdhLrQZpV_hP7_2pyLDnNVT9R7xtCDoo0pxsh4MmCFjrbmgaXohLCl1aqIgCx58LSZnARH_WXYF9345aS63irc_DmyMXlBQbPq31HxHjH80HHajoPs-3oMWZSLuNfDwUZo2GHasLvZYzdWA7gkaolRRLbZDPx9TYXwzfEJ1YwYYulkYFw", + "token_type":"Bearer", + "expires_in":3599, + "scope":"launch/patient online_access openid profile launch user/*.* patient/*.*", + "patient":"783a1f02-5bf9-41c9-90d0-c2c4d35d3ec3", + "id_token":"eyJraWQiOiJyc2ExIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJyc2NhbmxvbkBtaXRyZS5vcmciLCJhdWQiOiIwYWYwNmU5My0zMTJhLTQwZGEtOTlkYS00ZDVjYjUyYzYwZTQiLCJvcmdhbml6YXRpb25OYW1lIjoiOVJ0bzRxd1IwbXNSbEpXbjBpOGxsQll1TEg0ZnZvdE0iLCJkaXNwbGF5TmFtZSI6IlJvYmVydCBTY2FubG9uIiwicHJvZmlsZSI6InN5NjF5dlJnemtxMDZPNUQxbmYwIiwia2lkIjoicnNhMSIsImlzcyI6Imh0dHBzOlwvXC9zYi1hdXRoLnNtYXJ0aGVhbHRoaXQub3JnXC8iLCJleHAiOjE1MTgzNzYyODMsImlhdCI6MTUxODM3NTY4M30.WZxm11AXLguFX8IUPLC_mozfad0s0i_1um09cOfPQ4-GpUSMIFFMx7xt5_qFX5b-lCZKcHC7BBdHdp5Qnbf_azSCjBh9BHG08FcI9Q8OorftP2O5RefTXY1WVHaEbYJcRokBUfwOQYk3PqXmfyVdruxxqMZwF0cCP-EsOSpxGEcPgGqV2zr266vsS2iDUXDVmS1kLZqEPaHqT_v2OkOwZKUy8Gpz1LxY_g48m5RKGblYZjYUIQUBaLov3aDIQQRy6gdtGAyhMbWehe5q8FNsdZvUMOP2761SIieq39Lv0H-54uJnEDWXJJkyWJ17dw3USCqe2X0yRRxflnpLTNXARQ" +} diff --git a/test/sequence/openid_connect_test.rb b/lib/modules/smart/test/openid_connect_test.rb similarity index 99% rename from test/sequence/openid_connect_test.rb rename to lib/modules/smart/test/openid_connect_test.rb index dbc145e18..360a46122 100644 --- a/test/sequence/openid_connect_test.rb +++ b/lib/modules/smart/test/openid_connect_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../test_helper' +require_relative '../../../../test/test_helper' # Tests for the OpenIDConnectSequence # Note: This test currently only considers dstu2 diff --git a/test/sequence/standalone_launch_test.rb b/lib/modules/smart/test/standalone_launch_test.rb similarity index 98% rename from test/sequence/standalone_launch_test.rb rename to lib/modules/smart/test/standalone_launch_test.rb index c8bda4f7c..77cd37e9f 100644 --- a/test/sequence/standalone_launch_test.rb +++ b/lib/modules/smart/test/standalone_launch_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../test_helper' +require_relative '../../../../test/test_helper' class StandaloneLaunchSequenceTest < MiniTest::Test def setup diff --git a/test/sequence/token_introspection_test.rb b/lib/modules/smart/test/token_introspection_test.rb similarity index 99% rename from test/sequence/token_introspection_test.rb rename to lib/modules/smart/test/token_introspection_test.rb index a280a2221..d49e9bad4 100644 --- a/test/sequence/token_introspection_test.rb +++ b/lib/modules/smart/test/token_introspection_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../test_helper' +require_relative '../../../../test/test_helper' class TokenIntrospectionSequenceTest < MiniTest::Test REQUEST_HEADERS = { 'Accept' => 'application/json', 'Content-type' => 'application/x-www-form-urlencoded' }.freeze diff --git a/test/sequence/smart/token_refresh_sequence_test.rb b/lib/modules/smart/test/token_refresh_sequence_test.rb similarity index 55% rename from test/sequence/smart/token_refresh_sequence_test.rb rename to lib/modules/smart/test/token_refresh_sequence_test.rb index cc973f92b..5ad39c486 100644 --- a/test/sequence/smart/token_refresh_sequence_test.rb +++ b/lib/modules/smart/test/token_refresh_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' describe Inferno::Sequence::TokenRefreshSequence do let(:full_body) do @@ -206,3 +206,201 @@ end end end + +class TokenRefreshSequenceTest < MiniTest::Test + def setup + refresh_token = JSON::JWT.new(iss: 'foo_refresh') + @instance = Inferno::Models::TestingInstance.new( + url: 'http://www.example.com', + client_name: 'Inferno', + base_url: 'http://localhost:4567', + client_endpoint_key: Inferno::SecureRandomBase62.generate(32), + client_id: SecureRandom.uuid, + selected_module: 'argonaut', + oauth_authorize_endpoint: 'http://oauth_reg.example.com/authorize', + oauth_token_endpoint: 'http://oauth_reg.example.com/token', + initiate_login_uri: 'http://localhost:4567/launch', + redirect_uris: 'http://localhost:4567/redirect', + scopes: 'launch/patient online_access openid profile launch user/*.* patient/*.*', + refresh_token: refresh_token + ) + + @instance.save! # this is for convenience. we could rewrite to ensure nothing gets saved within tests. + client = FHIR::Client.new(@instance.url) + client.use_dstu2 + client.default_json + @sequence = Inferno::Sequence::TokenRefreshSequence.new(@instance, client, true) + @standalone_token_exchange = load_json_fixture(:standalone_token_exchange) + @confidential_client_secret = SecureRandom.uuid + end + + def setup_mocks(failure_mode = nil) + WebMock.reset! + + headers = { + 'Content-Type' => 'application/x-www-form-urlencoded' + } + + body = { + 'grant_type' => 'refresh_token', + 'refresh_token' => @instance.refresh_token + } + + body_response_code = 200 + + body_with_scope = body.merge('scope' => @instance.scopes) + + body_with_scope_response_code = 200 + + exchange_response = @standalone_token_exchange.dup + + response_headers = { content_type: 'application/json; charset=UTF-8', + cache_control: 'no-store', + pragma: 'no-cache' } + + case failure_mode + when :bad_token_type + exchange_response['token_type'] = 'unknown' + when :no_scope + exchange_response.delete('scope') + when :no_access_token + exchange_response.delete('access_token') + when :no_expires_in + exchange_response.delete('expires_in') + when :cache_control_off + response_headers.delete(:cache_control) + when :pragma_off + response_headers.delete(:pragma) + when :requires_scope + body_response_code = 400 + when :disallows_scope + body_with_scope_response_code = 400 + end + + # can't do this above because we are altering the content of hash in other error modes + exchange_response_json = exchange_response.to_json + exchange_response_json = '' if failure_mode == :bad_json_response + + if @instance.client_secret.present? + headers['Authorization'] = "Basic #{Base64.strict_encode64(@instance.client_id + ':' + @instance.client_secret)}" + else + body['client_id'] = body_with_scope['client_id'] = @instance.client_id + end + + stub_request(:post, @instance.oauth_token_endpoint) + .with(headers: headers, + body: body) + .to_return(status: body_response_code, + body: exchange_response_json, + headers: response_headers) + + stub_request(:post, @instance.oauth_token_endpoint) + .with(headers: headers, + body: body_with_scope) + .to_return(status: body_with_scope_response_code, + body: exchange_response_json, + headers: response_headers) + + # To test rejection of invalid client_id for public client + stub_request(:post, @instance.oauth_token_endpoint) + .with(body: /INVALID/, + headers: { 'Content-Type' => 'application/x-www-form-urlencoded' }) + .to_return(status: 401) + + # To test rejection of invalid client_id for confidential client + auth_header = "Basic #{Base64.strict_encode64('INVALID_CLIENT_ID:' + @confidential_client_secret)}" + stub_request(:post, @instance.oauth_token_endpoint) + .with(headers: { 'Content-Type' => 'application/x-www-form-urlencoded', + 'Authorization' => auth_header }) + .to_return(status: 401) + end + + def all_pass + setup_mocks + sequence_result = @sequence.start + + assert sequence_result.pass? + assert(sequence_result.test_results.none? { |result| result.test_warnings.present? }) + end + + def test_pass_if_confidential_client + @instance.client_secret = @confidential_client_secret + @instance.confidential_client = true + all_pass + end + + def test_pass_if_public_client + @instance.client_secret = nil + @instance.confidential_client = false + all_pass + end + + # Initial token exchange requires cache control and pragma headers + # But token exchange does not according to the letter of the smart spec + # This may be updated in future versions of the spec + # See https://github.com/HL7/smart-app-launch/issues/293 + def test_warning_if_cache_control_off + setup_mocks(:cache_control_off) + + sequence_result = @sequence.start + assert sequence_result.pass? + assert(sequence_result.test_results.any? { |result| result.test_warnings.present? }) + end + + def test_warning_if_pragma_off + setup_mocks(:pragma_off) + + sequence_result = @sequence.start + assert sequence_result.pass? + assert(sequence_result.test_results.any? { |result| result.test_warnings.present? }) + end + + def test_fail_if_bad_token_type + setup_mocks(:bad_token_type) + + sequence_result = @sequence.start + assert sequence_result.fail? + end + + def test_fail_if_no_scope_returned + setup_mocks(:no_scope) + + sequence_result = @sequence.start + assert sequence_result.fail? + end + + def test_fail_if_no_access_token + setup_mocks(:no_access_token) + + sequence_result = @sequence.start + assert sequence_result.fail? + end + + def test_fail_if_no_expires_in + setup_mocks(:no_expires_in) + + sequence_result = @sequence.start + assert sequence_result.fail? + end + + def test_fail_if_bad_json_response + setup_mocks(:bad_json_response) + + sequence_result = @sequence.start + assert sequence_result.fail? + end + + def test_fail_if_scope_must_be_in_payload + setup_mocks(:requires_scope) + + sequence_result = @sequence.start + assert sequence_result.fail? + end + + def test_fail_if_scope_cannot_be_in_payload + setup_mocks(:disallows_scope) + + sequence_result = @sequence.start + assert sequence_result.fail? + end +end diff --git a/test/sequence/token_refresh_sequence_test.rb b/test/sequence/token_refresh_sequence_test.rb deleted file mode 100644 index 30183a1b8..000000000 --- a/test/sequence/token_refresh_sequence_test.rb +++ /dev/null @@ -1,203 +0,0 @@ -# frozen_string_literal: true - -require_relative '../test_helper' - -# Test for the Token Refresh Sequence -# See : https://tools.ietf.org/html/rfc6749#section-6 -class TokenRefreshSequenceTest < MiniTest::Test - def setup - refresh_token = JSON::JWT.new(iss: 'foo_refresh') - @instance = Inferno::Models::TestingInstance.new( - url: 'http://www.example.com', - client_name: 'Inferno', - base_url: 'http://localhost:4567', - client_endpoint_key: Inferno::SecureRandomBase62.generate(32), - client_id: SecureRandom.uuid, - selected_module: 'argonaut', - oauth_authorize_endpoint: 'http://oauth_reg.example.com/authorize', - oauth_token_endpoint: 'http://oauth_reg.example.com/token', - initiate_login_uri: 'http://localhost:4567/launch', - redirect_uris: 'http://localhost:4567/redirect', - scopes: 'launch/patient online_access openid profile launch user/*.* patient/*.*', - refresh_token: refresh_token - ) - - @instance.save! # this is for convenience. we could rewrite to ensure nothing gets saved within tests. - client = FHIR::Client.new(@instance.url) - client.use_dstu2 - client.default_json - @sequence = Inferno::Sequence::TokenRefreshSequence.new(@instance, client, true) - @standalone_token_exchange = load_json_fixture(:standalone_token_exchange) - @confidential_client_secret = SecureRandom.uuid - end - - def setup_mocks(failure_mode = nil) - WebMock.reset! - - headers = { - 'Content-Type' => 'application/x-www-form-urlencoded' - } - - body = { - 'grant_type' => 'refresh_token', - 'refresh_token' => @instance.refresh_token - } - - body_response_code = 200 - - body_with_scope = body.merge('scope' => @instance.scopes) - - body_with_scope_response_code = 200 - - exchange_response = @standalone_token_exchange.dup - - response_headers = { content_type: 'application/json; charset=UTF-8', - cache_control: 'no-store', - pragma: 'no-cache' } - - case failure_mode - when :bad_token_type - exchange_response['token_type'] = 'unknown' - when :no_scope - exchange_response.delete('scope') - when :no_access_token - exchange_response.delete('access_token') - when :no_expires_in - exchange_response.delete('expires_in') - when :cache_control_off - response_headers.delete(:cache_control) - when :pragma_off - response_headers.delete(:pragma) - when :requires_scope - body_response_code = 400 - when :disallows_scope - body_with_scope_response_code = 400 - end - - # can't do this above because we are altering the content of hash in other error modes - exchange_response_json = exchange_response.to_json - exchange_response_json = '' if failure_mode == :bad_json_response - - if @instance.client_secret.present? - headers['Authorization'] = "Basic #{Base64.strict_encode64(@instance.client_id + ':' + @instance.client_secret)}" - else - body['client_id'] = body_with_scope['client_id'] = @instance.client_id - end - - stub_request(:post, @instance.oauth_token_endpoint) - .with(headers: headers, - body: body) - .to_return(status: body_response_code, - body: exchange_response_json, - headers: response_headers) - - stub_request(:post, @instance.oauth_token_endpoint) - .with(headers: headers, - body: body_with_scope) - .to_return(status: body_with_scope_response_code, - body: exchange_response_json, - headers: response_headers) - - # To test rejection of invalid client_id for public client - stub_request(:post, @instance.oauth_token_endpoint) - .with(body: /INVALID/, - headers: { 'Content-Type' => 'application/x-www-form-urlencoded' }) - .to_return(status: 401) - - # To test rejection of invalid client_id for confidential client - auth_header = "Basic #{Base64.strict_encode64('INVALID_CLIENT_ID:' + @confidential_client_secret)}" - stub_request(:post, @instance.oauth_token_endpoint) - .with(headers: { 'Content-Type' => 'application/x-www-form-urlencoded', - 'Authorization' => auth_header }) - .to_return(status: 401) - end - - def all_pass - setup_mocks - sequence_result = @sequence.start - - assert sequence_result.pass? - assert(sequence_result.test_results.none? { |result| result.test_warnings.present? }) - end - - def test_pass_if_confidential_client - @instance.client_secret = @confidential_client_secret - @instance.confidential_client = true - all_pass - end - - def test_pass_if_public_client - @instance.client_secret = nil - @instance.confidential_client = false - all_pass - end - - # Initial token exchange requires cache control and pragma headers - # But token exchange does not according to the letter of the smart spec - # This may be updated in future versions of the spec - # See https://github.com/HL7/smart-app-launch/issues/293 - def test_warning_if_cache_control_off - setup_mocks(:cache_control_off) - - sequence_result = @sequence.start - assert sequence_result.pass? - assert(sequence_result.test_results.any? { |result| result.test_warnings.present? }) - end - - def test_warning_if_pragma_off - setup_mocks(:pragma_off) - - sequence_result = @sequence.start - assert sequence_result.pass? - assert(sequence_result.test_results.any? { |result| result.test_warnings.present? }) - end - - def test_fail_if_bad_token_type - setup_mocks(:bad_token_type) - - sequence_result = @sequence.start - assert sequence_result.fail? - end - - def test_fail_if_no_scope_returned - setup_mocks(:no_scope) - - sequence_result = @sequence.start - assert sequence_result.fail? - end - - def test_fail_if_no_access_token - setup_mocks(:no_access_token) - - sequence_result = @sequence.start - assert sequence_result.fail? - end - - def test_fail_if_no_expires_in - setup_mocks(:no_expires_in) - - sequence_result = @sequence.start - assert sequence_result.fail? - end - - def test_fail_if_bad_json_response - setup_mocks(:bad_json_response) - - sequence_result = @sequence.start - assert sequence_result.fail? - end - - def test_fail_if_scope_must_be_in_payload - setup_mocks(:requires_scope) - - sequence_result = @sequence.start - assert sequence_result.fail? - end - - def test_fail_if_scope_cannot_be_in_payload - setup_mocks(:disallows_scope) - - sequence_result = @sequence.start - assert sequence_result.fail? - end -end From 4b0116879159a8c56f37893ea591ea52cccf685f Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 31 Oct 2019 13:06:50 -0400 Subject: [PATCH 069/173] move us_core_guidance tests --- ..._core_r4_clinicalnotes_diagrpt_bundle.json | 177 ++++++++++++++++++ ...s_core_r4_clinicalnotes_docref_bundle.json | 162 ++++++++++++++++ ...e_r4_capability_statement_sequence_test.rb | 2 +- ...us_core_r4_clinical_notes_sequence_test.rb | 2 +- 4 files changed, 341 insertions(+), 2 deletions(-) create mode 100644 lib/modules/us_core_guidance/test/fixtures/us_core_r4_clinicalnotes_diagrpt_bundle.json create mode 100644 lib/modules/us_core_guidance/test/fixtures/us_core_r4_clinicalnotes_docref_bundle.json rename {test/sequence/us_core_guidance => lib/modules/us_core_guidance/test}/us_core_r4_capability_statement_sequence_test.rb (98%) rename test/sequence/us_core_r4/clinicalnotes_sequence_test.rb => lib/modules/us_core_guidance/test/us_core_r4_clinical_notes_sequence_test.rb (98%) diff --git a/lib/modules/us_core_guidance/test/fixtures/us_core_r4_clinicalnotes_diagrpt_bundle.json b/lib/modules/us_core_guidance/test/fixtures/us_core_r4_clinicalnotes_diagrpt_bundle.json new file mode 100644 index 000000000..96962992e --- /dev/null +++ b/lib/modules/us_core_guidance/test/fixtures/us_core_r4_clinicalnotes_diagrpt_bundle.json @@ -0,0 +1,177 @@ +{ + "resourceType": "Bundle", + "id": "9d89bb92-1bac-498e-99ac-d2dbaa75caed", + "type": "searchset", + "entry": [ + { + "resource": { + "resourceType": "DiagnosticReport", + "id": "SMART-DiagnosticReport-1-note", + "status": "final", + "category": { + "coding": [ + { + "system": "http://loinc.org", + "code": "LP29708-2", + "display": "Cardiology" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "57698-3", + "display": "Lipid Panel" + } + ] + }, + "subject": { + "reference": "Patient/1234" + }, + "presentedForm": [ + { + "contentType": "text/plain", + "url": "/Binary/SMART-Binary-1-note" + } + ] + } + }, + { + "resource": { + "resourceType": "DiagnosticReport", + "id": "SMART-DiagnosticReport-2-note", + "status": "final", + "category": { + "coding": [ + { + "system": "http://loinc.org", + "code": "LP7839-6", + "display": "Pathology" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "57698-3", + "display": "Lipid Panel" + } + ] + }, + "subject": { + "reference": "Patient/1234" + }, + "presentedForm": [ + { + "contentType": "text/plain", + "url": "/Binary/SMART-Binary-2-note" + } + ] + } + }, + { + "resource": { + "resourceType": "DiagnosticReport", + "id": "SMART-DiagnosticReport-3-note", + "status": "final", + "category": { + "coding": [ + { + "system": "http://loinc.org", + "code": "LP29684-5", + "display": "Radiology" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "57698-3", + "display": "Lipid Panel" + } + ] + }, + "subject": { + "reference": "Patient/1234" + }, + "presentedForm": [ + { + "contentType": "text/plain", + "url": "/Binary/SMART-Binary-3-note" + } + ] + } + }, + { + "resource": { + "resourceType": "DiagnosticReport", + "id": "SMART-DiagnosticReport-4-note", + "status": "final", + "category": { + "coding": [ + { + "system": "http://loinc.org", + "code": "LP29708-2", + "display": "Cardiology" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "57698-3", + "display": "Lipid Panel" + } + ] + }, + "subject": { + "reference": "Patient/1234" + }, + "presentedForm": [ + { + "contentType": "text/plain", + "url": "/Binary/SMART-Binary-4-note" + } + ] + } + }, + { + "resource": { + "resourceType": "DiagnosticReport", + "id": "SMART-DiagnosticReport-5-note", + "status": "final", + "category": { + "coding": [ + { + "system": "http://loinc.org", + "code": "LP29708-2", + "display": "Cardiology" + } + ] + }, + "code": { + "coding": [ + { + "system": "http://loinc.org", + "code": "57698-3", + "display": "Lipid Panel" + } + ] + }, + "subject": { + "reference": "Patient/1234" + }, + "presentedForm": [ + { + "contentType": "text/plain", + "url": "/Binary/SMART-Binary-5-note" + } + ] + } + } + ] + } \ No newline at end of file diff --git a/lib/modules/us_core_guidance/test/fixtures/us_core_r4_clinicalnotes_docref_bundle.json b/lib/modules/us_core_guidance/test/fixtures/us_core_r4_clinicalnotes_docref_bundle.json new file mode 100644 index 000000000..4c3889c0c --- /dev/null +++ b/lib/modules/us_core_guidance/test/fixtures/us_core_r4_clinicalnotes_docref_bundle.json @@ -0,0 +1,162 @@ +{ + "resourceType": "Bundle", + "id": "9d89bb92-1bac-498e-99ac-d2dbaa75caed", + "type": "searchset", + "entry": [ + { + "resource": { + "resourceType": "DocumentReference", + "id": "SMART-DocumentReference-1-note", + "status": "current", + "type": { + "coding": [ + { + "system": "http://loinc.org", + "code": "11488-4", + "display": "Consultation Note" + } + ] + }, + "subject": { + "reference": "Patient/1234" + }, + "content": [ + { + "attachment": { + "contentType": "text/plain", + "url": "/Binary/SMART-Binary-1-note" + } + } + ] + } + }, + { + "resource": { + "resourceType": "DocumentReference", + "id": "SMART-DocumentReference-2-note", + "status": "current", + "type": { + "coding": [ + { + "system": "http://loinc.org", + "code": "18842-5", + "display": "Discharge Summary" + } + ] + }, + "subject": { + "reference": "Patient/1234" + }, + "content": [ + { + "attachment": { + "contentType": "text/plain", + "url": "/Binary/SMART-Binary-2-note" + } + } + ] + } + }, + { + "fullUrl": "https://api.logicahealth.org/InfernoR4yw/open/DocumentReference/SMART-DocumentReference-3-note", + "resource": { + "resourceType": "DocumentReference", + "id": "SMART-DocumentReference-3-note", + "meta": { + "versionId": "1", + "lastUpdated": "2019-03-07T08:52:17.000+00:00" + }, + "text": { + "status": "generated", + "div": "
    Emergency Department Note
    " + }, + "status": "current", + "type": { + "coding": [ + { + "system": "http://loinc.org", + "code": "34117-2", + "display": "History & Physical Note" + } + ], + "text": "Note" + }, + "subject": { + "reference": "Patient/SMART-2169591" + }, + "date": "2006-08-30T00:00:00.000-06:00", + "description": "Emergency Department Note", + "content": [ + { + "attachment": { + "contentType": "text/plain", + "url": "/Binary/SMART-Binary-3-note", + "size": 0 + } + } + ] + }, + "search": { + "mode": "match" + }, + "response": { + "status": "201 Created", + "etag": "W/\"1\"" + } + }, + { + "resource": { + "resourceType": "DocumentReference", + "id": "SMART-DocumentReference-4-note", + "status": "current", + "type": { + "coding": [ + { + "system": "http://loinc.org", + "code": "28570-0", + "display": "Procedures Note" + } + ] + }, + "subject": { + "reference": "Patient/1234" + }, + "content": [ + { + "attachment": { + "contentType": "text/plain", + "url": "/Binary/SMART-Binary-4-note" + } + } + ] + } + }, + { + "resource": { + "resourceType": "DocumentReference", + "id": "SMART-DocumentReference-5-document", + "status": "current", + "type": { + "coding": [ + { + "system": "http://loinc.org", + "code": "11506-3", + "display": "Progress Note" + } + ] + }, + "subject": { + "reference": "Patient/1234" + }, + "content": [ + { + "attachment": { + "contentType": "application/pdf", + "url": "/Binary/SMART-Binary-5-note" + } + } + ] + } + } + ] + } \ No newline at end of file diff --git a/test/sequence/us_core_guidance/us_core_r4_capability_statement_sequence_test.rb b/lib/modules/us_core_guidance/test/us_core_r4_capability_statement_sequence_test.rb similarity index 98% rename from test/sequence/us_core_guidance/us_core_r4_capability_statement_sequence_test.rb rename to lib/modules/us_core_guidance/test/us_core_r4_capability_statement_sequence_test.rb index 69a7747da..4b0866da2 100644 --- a/test/sequence/us_core_guidance/us_core_r4_capability_statement_sequence_test.rb +++ b/lib/modules/us_core_guidance/test/us_core_r4_capability_statement_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' describe Inferno::Sequence::UsCoreR4CapabilityStatementSequence do before do diff --git a/test/sequence/us_core_r4/clinicalnotes_sequence_test.rb b/lib/modules/us_core_guidance/test/us_core_r4_clinical_notes_sequence_test.rb similarity index 98% rename from test/sequence/us_core_r4/clinicalnotes_sequence_test.rb rename to lib/modules/us_core_guidance/test/us_core_r4_clinical_notes_sequence_test.rb index 583ccb9a8..65bd4b284 100644 --- a/test/sequence/us_core_r4/clinicalnotes_sequence_test.rb +++ b/lib/modules/us_core_guidance/test/us_core_r4_clinical_notes_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class USCoreR4ClinicalNotesSequenceTest < MiniTest::Test def setup From 8a1edd575746f68fbc949faaa38c850a197398ed Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 31 Oct 2019 13:11:17 -0400 Subject: [PATCH 070/173] move bulk_data tests --- .../test}/conformance_sequence_test.rb | 2 +- .../test/fixtures/bulk_data_conformance.json | 102 ++++++++++++++++++ .../test/fixtures/bulk_data_patient.ndjson | 3 + .../test}/patient_export_sequence_test.rb | 2 +- 4 files changed, 107 insertions(+), 2 deletions(-) rename {test/sequence/bulk_data => lib/modules/bulk_data/test}/conformance_sequence_test.rb (95%) create mode 100644 lib/modules/bulk_data/test/fixtures/bulk_data_conformance.json create mode 100644 lib/modules/bulk_data/test/fixtures/bulk_data_patient.ndjson rename {test/sequence/bulk_data => lib/modules/bulk_data/test}/patient_export_sequence_test.rb (99%) diff --git a/test/sequence/bulk_data/conformance_sequence_test.rb b/lib/modules/bulk_data/test/conformance_sequence_test.rb similarity index 95% rename from test/sequence/bulk_data/conformance_sequence_test.rb rename to lib/modules/bulk_data/test/conformance_sequence_test.rb index 751df6a39..2e80dfb0a 100644 --- a/test/sequence/bulk_data/conformance_sequence_test.rb +++ b/lib/modules/bulk_data/test/conformance_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class BulkDataCapabilityStatementSequenceTest < MiniTest::Test def setup diff --git a/lib/modules/bulk_data/test/fixtures/bulk_data_conformance.json b/lib/modules/bulk_data/test/fixtures/bulk_data_conformance.json new file mode 100644 index 000000000..61aa44700 --- /dev/null +++ b/lib/modules/bulk_data/test/fixtures/bulk_data_conformance.json @@ -0,0 +1,102 @@ +{ + "resourceType": "CapabilityStatement", + "status": "active", + "date": "2019-08-29 01:06:12", + "publisher": "Not provided", + "kind": "instance", + "software": { + "name": "SMART Sample Bulk FHIR Server", + "version": "1.0" + }, + "implementation": { + "description": "SMART Sample Bulk FHIR Server" + }, + "instantiates": [ + "http://hl7.org/fhir/uv/bulkdata/CapabilityStatement/bulk-data" + ], + "fhirVersion": "3.0.1", + "acceptUnknown": "extensions", + "format": [ + "application/fhir+json" + ], + "rest": [ + { + "mode": "server", + "security": { + "extension": [ + { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris", + "extension": [ + { + "url": "token", + "valueUri": "https://bulk-data.smarthealthit.org/auth/token" + }, + { + "url": "register", + "valueUri": "https://bulk-data.smarthealthit.org/auth/register" + } + ] + } + ], + "service": [ + { + "coding": [ + { + "system": "http://hl7.org/fhir/restful-security-service", + "code": "SMART-on-FHIR", + "display": "SMART-on-FHIR" + } + ], + "text": "OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)" + } + ] + }, + "resource": [ + { + "type": "Group", + "profile": { + "reference": "http://hl7.org/fhir/Profile/Group" + }, + "interaction": [ + { + "code": "read" + } + ], + "searchParam": [] + }, + { + "type": "OperationDefinition", + "profile": { + "reference": "http://hl7.org/fhir/Profile/OperationDefinition" + }, + "interaction": [ + { + "code": "read" + } + ], + "searchParam": [] + } + ], + "operation": [ + { + "name": "export", + "definition": { + "reference": "OperationDefinition/BulkDataExport" + } + }, + { + "name": "patient-export", + "definition": { + "reference": "OperationDefinition/PatientLevelExport" + } + }, + { + "name": "group-export", + "definition": { + "reference": "OperationDefinition/GroupLevelExport" + } + } + ] + } + ] +} diff --git a/lib/modules/bulk_data/test/fixtures/bulk_data_patient.ndjson b/lib/modules/bulk_data/test/fixtures/bulk_data_patient.ndjson new file mode 100644 index 000000000..588f7ce63 --- /dev/null +++ b/lib/modules/bulk_data/test/fixtures/bulk_data_patient.ndjson @@ -0,0 +1,3 @@ +{"id":"5c41cecf-cf81-434f-9da7-e24e5a99dbc2","name":[{"given":["Brenda"],"family":"Jackson"}],"gender":"female","birthDate":"1956-10-14T00:00:00.000Z","resourceType":"Patient"} +{"id":"3fabcb98-0995-447d-a03f-314d202b32f4","name":[{"given":["Bram"],"family":"Sandeep"}],"gender":"male","birthDate":"1994-11-01T00:00:00.000Z","resourceType":"Patient"} +{"id":"945e5c7f-504b-43bd-9562-a2ef82c244b2","name":[{"given":["Sandy"],"family":"Hamlin"}],"gender":"female","birthDate":"1988-01-24T00:00:00.000Z","resourceType":"Patient"} \ No newline at end of file diff --git a/test/sequence/bulk_data/patient_export_sequence_test.rb b/lib/modules/bulk_data/test/patient_export_sequence_test.rb similarity index 99% rename from test/sequence/bulk_data/patient_export_sequence_test.rb rename to lib/modules/bulk_data/test/patient_export_sequence_test.rb index bff643e3a..ab36080eb 100644 --- a/test/sequence/bulk_data/patient_export_sequence_test.rb +++ b/lib/modules/bulk_data/test/patient_export_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' class BulkDataPatientExportSequenceTest < MiniTest::Test def setup From 406cd03c93fadeeb6050b769daca3c727e809908 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 31 Oct 2019 13:13:49 -0400 Subject: [PATCH 071/173] remove outdated argonaut query test --- test/sequence/argonaut_query_test.rb | 230 --------------------------- 1 file changed, 230 deletions(-) delete mode 100644 test/sequence/argonaut_query_test.rb diff --git a/test/sequence/argonaut_query_test.rb b/test/sequence/argonaut_query_test.rb deleted file mode 100644 index 39c4e6f1d..000000000 --- a/test/sequence/argonaut_query_test.rb +++ /dev/null @@ -1,230 +0,0 @@ -# frozen_string_literal: true - -require File.expand_path '../test_helper.rb', __dir__ - -class ArgonautQueryTest < MiniTest::Test - REQUEST_HEADERS = { 'Accept' => 'application/json+fhir', - 'Accept-Charset' => 'UTF-8', - 'Content-Type' => 'application/json+fhir;charset=UTF-8' }.freeze - RESPONSE_HEADERS = { 'content-type' => 'application/json+fhir' }.freeze - - def setup - skip 'This test must be updated now that argo tests are broken out' # FIXME - @conformance = FHIR::DSTU2.from_contents(load_fixture(:conformance_statement)) - @bundle = FHIR::DSTU2.from_contents(load_fixture(:sample_record)) - @bundle.entry.each do |entry| - entry.resource.meta = FHIR::DSTU2::Meta.new unless entry.resource.meta - entry.resource.meta.versionId = '1' - end - @patient_id = get_resources_from_bundle(@bundle, 'Patient').first.id - - @instance = Inferno::Models::TestingInstance.new(url: 'http://www.example.com', - client_name: 'Inferno', - base_url: 'http://localhost:4567', - client_endpoint_key: Inferno::SecureRandomBase62.generate(32), - client_id: SecureRandom.uuid, - oauth_authorize_endpoint: 'http://oauth_reg.example.com/authorize', - oauth_token_endpoint: 'http://oauth_reg.example.com/token', - scopes: 'launch openid patient/*.* profile') - Inferno::Models::ServerCapabilities.create( - testing_instance_id: @instance.id, - capabilities: @conformance.as_json - ) - @instance.resource_references << Inferno::Models::ResourceReference.new( - resource_type: 'Patient', - resource_id: @patient_id - ) - @instance.save! # this is for convenience. we could rewrite to ensure nothing gets saved within tests. - client = FHIR::Client.new(@instance.url) - client.use_dstu2 - client.default_json - @sequence = Inferno::Sequence::ArgonautDataQuerySequence.new(@instance, client) - @standalone_token_exchange = load_json_fixture(:standalone_token_exchange) - end - - def test_all_pass - skip 'This test must be updated now that argo tests are broken out' # FIXME - WebMock.reset! - - patient = get_resources_from_bundle(@bundle, 'Patient').first - # Reject requests without authorization, then accept subsequent requests - stub_request(:get, "http://www.example.com/Patient/#{@patient_id}") - .with(headers: REQUEST_HEADERS) - .to_return( - { status: 406, body: nil, headers: RESPONSE_HEADERS }, - status: 200, body: patient.to_json, headers: RESPONSE_HEADERS - ) - - patient_bundle = wrap_resources_in_bundle([patient]) - # Search Patient - uri_template = Addressable::Template.new 'http://www.example.com/Patient{?identifier,family,gender,given,birthdate}' - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return( - { status: 406, body: nil, headers: RESPONSE_HEADERS }, - status: 200, body: patient_bundle.to_json, headers: RESPONSE_HEADERS - ) - - # Patient history - patient_history_bundle = wrap_resources_in_bundle([patient]) - patient_history_bundle.type = 'history' - uri_template = Addressable::Template.new "http://www.example.com/Patient/#{@patient_id}/_history" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: patient_history_bundle.to_json, headers: RESPONSE_HEADERS) - - uri_template = Addressable::Template.new "http://www.example.com/Patient/#{@patient_id}/_history/1" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: patient.to_json, headers: RESPONSE_HEADERS) - - # Search resources - resources = [ - 'AllergyIntolerance', 'CarePlan', 'Condition', 'Device', - 'DiagnosticReport', 'DocumentReference', 'Goal', 'Immunization', - 'MedicationStatement', 'MedicationOrder', 'Observation', 'Procedure' - ] - resources.each do |resource_type| - bundle = wrap_resources_in_bundle(get_resources_from_bundle(@bundle, resource_type)) - uri_template = Addressable::Template.new "http://www.example.com/#{resource_type}{?patient,category,status,clinicalstatus}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return( - { status: 406, body: nil, headers: RESPONSE_HEADERS }, - status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS - ) - uri_template = Addressable::Template.new "http://www.example.com/#{resource_type}/{id}" - stub_request(:get, uri_template).to_return do |request| - id = request.headers['Id'] - resource_type = request.headers['Resource'].split('::').last - result = get_resources_from_bundle(@bundle, resource_type).find { |r| r.id == id } - { status: 200, body: result.to_json, headers: RESPONSE_HEADERS } - end - # history should return a history bundle - uri_template = Addressable::Template.new "http://www.example.com/#{resource_type}/{id}/_history" - stub_request(:get, uri_template).to_return do |request| - id = request.headers['Id'] - resource_type = request.headers['Resource'].split('::').last - results = get_resources_from_bundle(@bundle, resource_type).find { |r| r.id == id } - results = wrap_resources_in_bundle([results]) - results.type = 'history' - { status: 200, body: results.to_json, headers: RESPONSE_HEADERS } - end - # vread should return an instance - uri_template = Addressable::Template.new "http://www.example.com/#{resource_type}/{id}/_history/1" - stub_request(:get, uri_template).to_return do |request| - id = request.headers['Id'] - resource_type = request.headers['Resource'].split('::').last - result = get_resources_from_bundle(@bundle, resource_type).find { |r| r.id == id } - { status: 200, body: result.to_json, headers: RESPONSE_HEADERS } - end - end - - # Special stub for comma-separated query params - bundle = wrap_resources_in_bundle(get_resources_from_bundle(@bundle, 'Condition')) - uri_template = Addressable::Template.new "http://www.example.com/Condition?clinicalstatus=active,recurrance,remission&patient=#{@patient_id}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - - # Special stub for queries with dates - date = '2010-03-01T15:15:00-05:00' - bundle = wrap_resources_in_bundle(get_resources_from_bundle(@bundle, 'DiagnosticReport')) - uri_template = Addressable::Template.new "http://www.example.com/DiagnosticReport?category=LAB&date=#{date}&patient=#{@patient_id}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - uri_template = Addressable::Template.new "http://www.example.com/DiagnosticReport?category=LAB&code=57698-3&date=#{date}&patient=#{@patient_id}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - - bundle = wrap_resources_in_bundle(get_resources_from_bundle(@bundle, 'Observation')) - uri_template = Addressable::Template.new "http://www.example.com/Observation?category=laboratory&date=#{date}&patient=#{@patient_id}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - uri_template = Addressable::Template.new "http://www.example.com/Observation?category=laboratory&code=8302-2&date=#{date}&patient=#{@patient_id}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - uri_template = Addressable::Template.new "http://www.example.com/Observation?category=vital-signs&date=#{date}&patient=#{@patient_id}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - uri_template = Addressable::Template.new "http://www.example.com/Observation?category=vital-signs&code=8302-2&date=#{date}&patient=#{@patient_id}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - uri_template = Addressable::Template.new "http://www.example.com/Observation?code=72166-2&patient=#{@patient_id}" - # TODO: filter to 72166-2 - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return( - { status: 406, body: nil, headers: RESPONSE_HEADERS }, - status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS - ) - uri_template = Addressable::Template.new "http://www.example.com/Observation?category=vital-signs&patient=#{@patient_id}" - # TODO: filter to `vital-signs` - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return( - { status: 406, body: nil, headers: RESPONSE_HEADERS }, - status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS - ) - - date = '2010-08-09T16:15:00-04:00' - bundle = wrap_resources_in_bundle(get_resources_from_bundle(@bundle, 'Procedure')) - uri_template = Addressable::Template.new "http://www.example.com/Procedure?date=#{date}&patient=#{@patient_id}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - - date = '2018-03-05T15:15:00-05:00' - bundle = wrap_resources_in_bundle(get_resources_from_bundle(@bundle, 'CarePlan')) - uri_template = Addressable::Template.new "http://www.example.com/CarePlan?category=assess-plan&date=#{date}&patient=#{@patient_id}&status=active" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - uri_template = Addressable::Template.new "http://www.example.com/CarePlan?category=assess-plan&date=#{date}&patient=#{@patient_id}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - - bundle = wrap_resources_in_bundle(get_resources_from_bundle(@bundle, 'DocumentReference')) - uri_template = Addressable::Template.new "http://www.example.com/DocumentReference?patient=#{@patient_id}&period=#{date}" - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - bundle = wrap_resources_in_bundle(get_resources_from_bundle(@bundle, 'DocumentReference')) - uri_template = Addressable::Template.new "http://www.example.com/DocumentReference?patient=#{@patient_id}&period=#{date}&type=34133-9" - # TODO: filter to 34133-9 - stub_request(:get, uri_template) - .with(headers: REQUEST_HEADERS) - .to_return(status: 200, body: bundle.to_json, headers: RESPONSE_HEADERS) - - sequence_result = @sequence.start - - assert sequence_result.pass?, 'Sequence did not pass all tests.' - assert sequence_result.error_count.zero? - assert sequence_result.todo_count.zero? - assert sequence_result.skip_count.zero? - end - - def get_resources_from_bundle(bundle, resource_type) - resources = [] - bundle.entry.each do |entry| - resources << entry.resource if entry.resource.resourceType == resource_type - end - resources - end - - def wrap_resources_in_bundle(resources) - bundle = FHIR::DSTU2::Bundle.new('id': 'foo', 'type': 'searchset') - resources.each do |resource| - bundle.entry << FHIR::DSTU2::Bundle::Entry.new - bundle.entry.last.resource = resource - end - bundle - end -end From 3dd875c3b4a684fc7d1110d0b8ab8dcbea0c284d Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 31 Oct 2019 13:23:04 -0400 Subject: [PATCH 072/173] move misc sequence tests --- .../argonaut_conformance_sequence_test.rb | 2 +- .../test/fixtures/conformance_statement.json | 17035 ++++++++++++++++ .../test/fixtures/r4_provenance.json | 17 + .../test}/r4_provenance_sequence_test.rb | 2 +- 4 files changed, 17054 insertions(+), 2 deletions(-) rename test/sequence/conformance_test.rb => lib/modules/argonaut/test/argonaut_conformance_sequence_test.rb (97%) create mode 100644 lib/modules/argonaut/test/fixtures/conformance_statement.json create mode 100644 lib/modules/us_core_guidance/test/fixtures/r4_provenance.json rename {test/sequence => lib/modules/us_core_guidance/test}/r4_provenance_sequence_test.rb (98%) diff --git a/test/sequence/conformance_test.rb b/lib/modules/argonaut/test/argonaut_conformance_sequence_test.rb similarity index 97% rename from test/sequence/conformance_test.rb rename to lib/modules/argonaut/test/argonaut_conformance_sequence_test.rb index 61103e965..2a2e70a0a 100644 --- a/test/sequence/conformance_test.rb +++ b/lib/modules/argonaut/test/argonaut_conformance_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require File.expand_path '../test_helper.rb', __dir__ +require_relative '../../../../test/test_helper.rb' # Tests for the ArgonautConformanceSequence # Note: This test currently only considers dstu2 diff --git a/lib/modules/argonaut/test/fixtures/conformance_statement.json b/lib/modules/argonaut/test/fixtures/conformance_statement.json new file mode 100644 index 000000000..9cc4389cb --- /dev/null +++ b/lib/modules/argonaut/test/fixtures/conformance_statement.json @@ -0,0 +1,17035 @@ +{ + "resourceType": "Conformance", + "publisher": "Not provided", + "date": "2018-02-10T04:02:11+00:00", + "kind": "instance", + "software": { + "name": "HAPI FHIR Server", + "version": "2.4" + }, + "implementation": { + "description": "HSPC Reference API Server" + }, + "fhirVersion": "1.0.2", + "acceptUnknown": "extensions", + "format": [ + "application/xml+fhir", + "application/json+fhir" + ], + "rest": [ + { + "mode": "server", + "security": { + "extension": [ + { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris", + "extension": [ + { + "url": "authorize", + "valueUri": "https://sb-auth.smarthealthit.org/authorize" + }, + { + "url": "token", + "valueUri": "https://sb-auth.smarthealthit.org/token" + }, + { + "url": "register", + "valueUri": "https://sb-auth.smarthealthit.org/register" + } + ] + } , { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "launch-ehr" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "launch-standalone" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "client-public" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "client-confidential-symmetric" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "sso-openid-connect" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "context-banner" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "context-style" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "context-ehr-patient" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "context-ehr-encounter" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "context-standalone-patient" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "context-standalone-encounter" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "permission-offline" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "permission-patient" + }, { + "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/capabilities", + "valueCode": "permission-user" + } + + ], + "service": [ + { + "coding": [ + { + "system": "http://hl7.org/fhir/restful-security-service", + "code": "SMART-on-FHIR" + } + ], + "text": "OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)" + } + ] + }, + "resource": [ + { + "type": "Account", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Account" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Account:owner", + "Account:patient", + "Account:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "balance", + "type": "quantity" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "owner", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "period", + "type": "date" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "type", + "type": "token" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 653 + } + ], + "type": "AllergyIntolerance", + "profile": { + "reference": "http://hl7.org/fhir/profiles/AllergyIntolerance" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "AllergyIntolerance:patient", + "AllergyIntolerance:recorder", + "AllergyIntolerance:reporter" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "category", + "type": "token" + }, + { + "name": "criticality", + "type": "token" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "last-date", + "type": "date" + }, + { + "name": "manifestation", + "type": "token" + }, + { + "name": "onset", + "type": "date" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "recorder", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "reporter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "route", + "type": "token" + }, + { + "name": "severity", + "type": "token" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "substance", + "type": "token" + }, + { + "name": "type", + "type": "token" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 4 + } + ], + "type": "Appointment", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Appointment" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Appointment:actor", + "Appointment:location", + "Appointment:patient", + "Appointment:practitioner" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "actor", + "type": "reference", + "documentation": "Any one of the individuals participating in the appointment", + "chain": [ + "*" + ] + }, + { + "name": "date", + "type": "date", + "documentation": "Appointment date/time." + }, + { + "name": "identifier", + "type": "token", + "documentation": "An Identifier of the Appointment" + }, + { + "name": "location", + "type": "reference", + "documentation": "This location is listed in the participants of the appointment", + "chain": [ + "*" + ] + }, + { + "name": "part-status", + "type": "token", + "documentation": "The Participation status of the subject, or other participant on the appointment. Can be used to locate participants that have not responded to meeting requests." + }, + { + "name": "patient", + "type": "reference", + "documentation": "One of the individuals of the appointment is this patient", + "chain": [ + "*" + ] + }, + { + "name": "practitioner", + "type": "reference", + "documentation": "One of the individuals of the appointment is this practitioner", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "The overall status of the appointment" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 4 + } + ], + "type": "AppointmentResponse", + "profile": { + "reference": "http://hl7.org/fhir/profiles/AppointmentResponse" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "AppointmentResponse:actor", + "AppointmentResponse:appointment", + "AppointmentResponse:location", + "AppointmentResponse:patient", + "AppointmentResponse:practitioner" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "actor", + "type": "reference", + "documentation": "The Person, Location/HealthcareService or Device that this appointment response replies for", + "chain": [ + "*" + ] + }, + { + "name": "appointment", + "type": "reference", + "documentation": "The appointment that the response is attached to", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "An Identifier in this appointment response" + }, + { + "name": "location", + "type": "reference", + "documentation": "This Response is for this Location", + "chain": [ + "*" + ] + }, + { + "name": "part-status", + "type": "token", + "documentation": "The participants acceptance status for this appointment" + }, + { + "name": "patient", + "type": "reference", + "documentation": "This Response is for this Patient", + "chain": [ + "*" + ] + }, + { + "name": "practitioner", + "type": "reference", + "documentation": "This Response is for this Practitioner", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "AuditEvent", + "profile": { + "reference": "http://hl7.org/fhir/profiles/AuditEvent" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "AuditEvent:participant", + "AuditEvent:patient", + "AuditEvent:reference" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "action", + "type": "token" + }, + { + "name": "address", + "type": "token" + }, + { + "name": "altid", + "type": "token" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "desc", + "type": "string" + }, + { + "name": "identity", + "type": "token" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "object-type", + "type": "token" + }, + { + "name": "participant", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "policy", + "type": "uri" + }, + { + "name": "reference", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "site", + "type": "token" + }, + { + "name": "source", + "type": "token" + }, + { + "name": "subtype", + "type": "token" + }, + { + "name": "type", + "type": "token" + }, + { + "name": "user", + "type": "token" + } + ] + }, + { + "type": "Basic", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Basic" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Basic:author", + "Basic:patient", + "Basic:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "author", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "code", + "type": "token" + }, + { + "name": "created", + "type": "date" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 18 + } + ], + "type": "Binary", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Binary" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "contenttype", + "type": "token" + } + ] + }, + { + "type": "BodySite", + "profile": { + "reference": "http://hl7.org/fhir/profiles/BodySite" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "BodySite:patient" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token", + "documentation": "Named anatomical location" + }, + { + "name": "identifier", + "type": "token", + "documentation": "Identifier for this instance of the anatomical location" + }, + { + "name": "patient", + "type": "reference", + "documentation": "Patient to whom bodysite belongs", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "Bundle", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Bundle" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Bundle:composition", + "Bundle:message" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "composition", + "type": "reference", + "documentation": "The first resource in the bundle, if the bundle type is \"document\" - this is a composition, and this parameter provides access to searches its contents", + "chain": [ + "*" + ] + }, + { + "name": "message", + "type": "reference", + "documentation": "The first resource in the bundle, if the bundle type is \"message\" - this is a message header, and this parameter provides access to search its contents", + "chain": [ + "*" + ] + }, + { + "name": "type", + "type": "token" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 3397 + } + ], + "type": "CarePlan", + "profile": { + "reference": "http://hl7.org/fhir/profiles/CarePlan" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "CarePlan:activityreference", + "CarePlan:condition", + "CarePlan:goal", + "CarePlan:participant", + "CarePlan:patient", + "CarePlan:performer", + "CarePlan:relatedplan", + "CarePlan:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "activitycode", + "type": "token" + }, + { + "name": "activitydate", + "type": "date", + "documentation": "Specified date occurs within period specified by CarePlan.activity.timingSchedule" + }, + { + "name": "activityreference", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "condition", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "date", + "type": "date" + }, + { + "name": "goal", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "participant", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "performer", + "type": "reference", + "documentation": "Matches if the practitioner is listed as a performer in any of the \"simple\" activities. (For performers of the detailed activities, chain through the activitydetail search parameter.)", + "chain": [ + "*" + ] + }, + { + "name": "relatedcode", + "type": "token" + }, + { + "name": "relatedcode-relatedplan", + "type": "composite", + "documentation": "A combination of the type of relationship and the related plan" + }, + { + "name": "relatedplan", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "Claim", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Claim" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Claim:patient", + "Claim:provider" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The primary identifier of the financial resource" + }, + { + "name": "patient", + "type": "reference", + "documentation": "Patient", + "chain": [ + "*" + ] + }, + { + "name": "priority", + "type": "token", + "documentation": "Processing priority requested" + }, + { + "name": "provider", + "type": "reference", + "documentation": "Provider responsible for the claim", + "chain": [ + "*" + ] + }, + { + "name": "use", + "type": "token", + "documentation": "The kind of financial resource" + } + ] + }, + { + "type": "ClaimResponse", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ClaimResponse" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The identity of the insurer" + } + ] + }, + { + "type": "ClinicalImpression", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ClinicalImpression" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "ClinicalImpression:action", + "ClinicalImpression:assessor", + "ClinicalImpression:investigation", + "ClinicalImpression:patient", + "ClinicalImpression:plan", + "ClinicalImpression:previous", + "ClinicalImpression:problem", + "ClinicalImpression:trigger" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "action", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "assessor", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "date", + "type": "date" + }, + { + "name": "finding", + "type": "token" + }, + { + "name": "investigation", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "plan", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "previous", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "problem", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "resolved", + "type": "token" + }, + { + "name": "ruledout", + "type": "token" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "trigger", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "trigger-code", + "type": "token" + } + ] + }, + { + "type": "Communication", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Communication" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Communication:encounter", + "Communication:patient", + "Communication:recipient", + "Communication:request", + "Communication:sender", + "Communication:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "category", + "type": "token" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "medium", + "type": "token" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "received", + "type": "date" + }, + { + "name": "recipient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "request", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "sender", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "sent", + "type": "date" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "CommunicationRequest", + "profile": { + "reference": "http://hl7.org/fhir/profiles/CommunicationRequest" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "CommunicationRequest:encounter", + "CommunicationRequest:patient", + "CommunicationRequest:recipient", + "CommunicationRequest:requester", + "CommunicationRequest:sender", + "CommunicationRequest:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "category", + "type": "token" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "medium", + "type": "token" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "priority", + "type": "token" + }, + { + "name": "recipient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "requested", + "type": "date" + }, + { + "name": "requester", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "sender", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token" + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "time", + "type": "date" + } + ] + }, + { + "type": "Composition", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Composition" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Composition:attester", + "Composition:author", + "Composition:encounter", + "Composition:entry", + "Composition:patient", + "Composition:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "attester", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "author", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "class", + "type": "token" + }, + { + "name": "confidentiality", + "type": "token" + }, + { + "name": "context", + "type": "token" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "entry", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "period", + "type": "date" + }, + { + "name": "section", + "type": "token" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "title", + "type": "string" + }, + { + "name": "type", + "type": "token" + } + ] + }, + { + "type": "ConceptMap", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ConceptMap" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "ConceptMap:source", + "ConceptMap:sourceuri", + "ConceptMap:target" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "context", + "type": "token", + "documentation": "A use context assigned to the concept map" + }, + { + "name": "date", + "type": "date", + "documentation": "The concept map publication date" + }, + { + "name": "dependson", + "type": "uri" + }, + { + "name": "description", + "type": "string", + "documentation": "Text search in the description of the concept map" + }, + { + "name": "identifier", + "type": "token", + "documentation": "Additional identifier for the concept map" + }, + { + "name": "name", + "type": "string", + "documentation": "Name of the concept map" + }, + { + "name": "product", + "type": "uri" + }, + { + "name": "publisher", + "type": "string", + "documentation": "Name of the publisher of the concept map" + }, + { + "name": "source", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "sourcecode", + "type": "token" + }, + { + "name": "sourcesystem", + "type": "uri" + }, + { + "name": "sourceuri", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "Status of the concept map" + }, + { + "name": "target", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "targetcode", + "type": "token" + }, + { + "name": "targetsystem", + "type": "uri" + }, + { + "name": "url", + "type": "uri", + "documentation": "The URL of the concept map" + }, + { + "name": "version", + "type": "token", + "documentation": "The version identifier of the concept map" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 7401 + } + ], + "type": "Condition", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Condition" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Condition:asserter", + "Condition:encounter", + "Condition:patient" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "asserter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "body-site", + "type": "token" + }, + { + "name": "category", + "type": "token", + "documentation": "The category of the condition" + }, + { + "name": "clinicalstatus", + "type": "token", + "documentation": "The clinical status of the condition" + }, + { + "name": "code", + "type": "token", + "documentation": "Code for the condition" + }, + { + "name": "date-recorded", + "type": "date", + "documentation": "A date, when the Condition statement was documented" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "evidence", + "type": "token" + }, + { + "name": "identifier", + "type": "token", + "documentation": "A unique identifier of the condition record" + }, + { + "name": "onset", + "type": "date", + "documentation": "Date related onsets (dateTime and Period)" + }, + { + "name": "onset-info", + "type": "string", + "documentation": "Other onsets (boolean, age, range, string)" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "severity", + "type": "token", + "documentation": "The severity of the condition" + }, + { + "name": "stage", + "type": "token" + } + ] + }, + { + "type": "Conformance", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Conformance" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Conformance:profile", + "Conformance:supported-profile" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "date", + "type": "date", + "documentation": "The conformance statement publication date" + }, + { + "name": "description", + "type": "string", + "documentation": "Text search in the description of the conformance statement" + }, + { + "name": "event", + "type": "token", + "documentation": "Event code in a conformance statement" + }, + { + "name": "fhirversion", + "type": "token", + "documentation": "The version of FHIR" + }, + { + "name": "format", + "type": "token" + }, + { + "name": "mode", + "type": "token", + "documentation": "Mode - restful (server/client) or messaging (sender/receiver)" + }, + { + "name": "name", + "type": "string", + "documentation": "Name of the conformance statement" + }, + { + "name": "profile", + "type": "reference", + "documentation": "A profile id invoked in a conformance statement", + "chain": [ + "*" + ] + }, + { + "name": "publisher", + "type": "string", + "documentation": "Name of the publisher of the conformance statement" + }, + { + "name": "resource", + "type": "token", + "documentation": "Name of a resource mentioned in a conformance statement" + }, + { + "name": "security", + "type": "token" + }, + { + "name": "software", + "type": "string", + "documentation": "Part of a the name of a software application" + }, + { + "name": "status", + "type": "token", + "documentation": "The current status of the conformance statement" + }, + { + "name": "supported-profile", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "url", + "type": "uri", + "documentation": "The uri that identifies the conformance statement" + }, + { + "name": "version", + "type": "token", + "documentation": "The version identifier of the conformance statement" + } + ] + }, + { + "type": "Contract", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Contract" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Contract:actor", + "Contract:patient", + "Contract:signer", + "Contract:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "actor", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "The identity of the contract" + }, + { + "name": "patient", + "type": "reference", + "documentation": "The identity of the target of the contract (if a patient)", + "chain": [ + "*" + ] + }, + { + "name": "signer", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "documentation": "The identity of the target of the contract", + "chain": [ + "*" + ] + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 1 + } + ], + "type": "Coverage", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Coverage" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Coverage:issuer" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "dependent", + "type": "token", + "documentation": "Dependent number" + }, + { + "name": "group", + "type": "token", + "documentation": "Group identifier" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The primary identifier of the insured" + }, + { + "name": "issuer", + "type": "reference", + "documentation": "The identity of the insurer", + "chain": [ + "*" + ] + }, + { + "name": "plan", + "type": "token", + "documentation": "A plan or policy identifier" + }, + { + "name": "sequence", + "type": "token", + "documentation": "Sequence number" + }, + { + "name": "subplan", + "type": "token", + "documentation": "Sub-plan identifier" + }, + { + "name": "type", + "type": "token", + "documentation": "The kind of coverage" + } + ] + }, + { + "type": "DataElement", + "profile": { + "reference": "http://hl7.org/fhir/profiles/DataElement" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token", + "documentation": "A code for the data element (server may choose to do subsumption)" + }, + { + "name": "context", + "type": "token", + "documentation": "A use context assigned to the data element" + }, + { + "name": "date", + "type": "date", + "documentation": "The data element publication date" + }, + { + "name": "description", + "type": "string", + "documentation": "Text search in the description of the data element. This corresponds to the definition of the first DataElement.element." + }, + { + "name": "identifier", + "type": "token", + "documentation": "The identifier of the data element" + }, + { + "name": "name", + "type": "string", + "documentation": "Name of the data element" + }, + { + "name": "publisher", + "type": "string", + "documentation": "Name of the publisher of the data element" + }, + { + "name": "status", + "type": "token", + "documentation": "The current status of the data element" + }, + { + "name": "stringency", + "type": "token", + "documentation": "The stringency of the data element definition" + }, + { + "name": "url", + "type": "uri", + "documentation": "The official URL for the data element" + }, + { + "name": "version", + "type": "string", + "documentation": "The version identifier of the data element" + } + ] + }, + { + "type": "DetectedIssue", + "profile": { + "reference": "http://hl7.org/fhir/profiles/DetectedIssue" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "DetectedIssue:author", + "DetectedIssue:implicated", + "DetectedIssue:patient" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "author", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "category", + "type": "token" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "implicated", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "Device", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Device" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Device:location", + "Device:organization", + "Device:patient" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "Instance id from manufacturer, owner, and others" + }, + { + "name": "location", + "type": "reference", + "documentation": "A location, where the resource is found", + "chain": [ + "*" + ] + }, + { + "name": "manufacturer", + "type": "string", + "documentation": "The manufacturer of the device" + }, + { + "name": "model", + "type": "string", + "documentation": "The model of the device" + }, + { + "name": "organization", + "type": "reference", + "documentation": "The organization responsible for the device", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "Patient information, if the resource is affixed to a person", + "chain": [ + "*" + ] + }, + { + "name": "type", + "type": "token", + "documentation": "The type of the device" + }, + { + "name": "udi", + "type": "string", + "documentation": "FDA mandated Unique Device Identifier" + }, + { + "name": "url", + "type": "uri", + "documentation": "Network address to contact device" + } + ] + }, + { + "type": "DeviceComponent", + "profile": { + "reference": "http://hl7.org/fhir/profiles/DeviceComponent" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "DeviceComponent:parent", + "DeviceComponent:source" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "parent", + "type": "reference", + "documentation": "The parent DeviceComponent resource", + "chain": [ + "*" + ] + }, + { + "name": "source", + "type": "reference", + "documentation": "The device source", + "chain": [ + "*" + ] + }, + { + "name": "type", + "type": "token", + "documentation": "The device component type" + } + ] + }, + { + "type": "DeviceMetric", + "profile": { + "reference": "http://hl7.org/fhir/profiles/DeviceMetric" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "DeviceMetric:parent", + "DeviceMetric:source" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "category", + "type": "token", + "documentation": "The category of the metric" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The identifier of the metric" + }, + { + "name": "parent", + "type": "reference", + "documentation": "The parent DeviceMetric resource", + "chain": [ + "*" + ] + }, + { + "name": "source", + "type": "reference", + "documentation": "The device resource", + "chain": [ + "*" + ] + }, + { + "name": "type", + "type": "token", + "documentation": "The component type" + } + ] + }, + { + "type": "DeviceUseRequest", + "profile": { + "reference": "http://hl7.org/fhir/profiles/DeviceUseRequest" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "DeviceUseRequest:device", + "DeviceUseRequest:patient", + "DeviceUseRequest:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "device", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "Search by subject - a patient", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "documentation": "Search by subject", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "DeviceUseStatement", + "profile": { + "reference": "http://hl7.org/fhir/profiles/DeviceUseStatement" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "DeviceUseStatement:device", + "DeviceUseStatement:patient", + "DeviceUseStatement:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "device", + "type": "reference", + "documentation": "Search by device", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "Search by subject - a patient", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "documentation": "Search by subject", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "DiagnosticOrder", + "profile": { + "reference": "http://hl7.org/fhir/profiles/DiagnosticOrder" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "DiagnosticOrder:actor", + "DiagnosticOrder:encounter", + "DiagnosticOrder:orderer", + "DiagnosticOrder:patient", + "DiagnosticOrder:specimen", + "DiagnosticOrder:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "actor", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "bodysite", + "type": "token" + }, + { + "name": "code", + "type": "token" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "event-date", + "type": "date" + }, + { + "name": "event-status", + "type": "token" + }, + { + "name": "event-status-event-date", + "type": "composite", + "documentation": "A combination of past-status and date" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "item-date", + "type": "date" + }, + { + "name": "item-past-status", + "type": "token" + }, + { + "name": "item-past-status-item-date", + "type": "composite", + "documentation": "A combination of item-past-status and item-date" + }, + { + "name": "item-status", + "type": "token" + }, + { + "name": "orderer", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "specimen", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token" + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 4296 + } + ], + "type": "DiagnosticReport", + "profile": { + "reference": "http://hl7.org/fhir/profiles/DiagnosticReport" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "DiagnosticReport:encounter", + "DiagnosticReport:image", + "DiagnosticReport:patient", + "DiagnosticReport:performer", + "DiagnosticReport:request", + "DiagnosticReport:result", + "DiagnosticReport:specimen", + "DiagnosticReport:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "category", + "type": "token", + "documentation": "Which diagnostic discipline/department created the report" + }, + { + "name": "code", + "type": "token", + "documentation": "The code for the report as a whole, as opposed to codes for the atomic results, which are the names on the observation resource referred to from the result" + }, + { + "name": "date", + "type": "date", + "documentation": "The clinically relevant time of the report" + }, + { + "name": "diagnosis", + "type": "token", + "documentation": "A coded diagnosis on the report" + }, + { + "name": "encounter", + "type": "reference", + "documentation": "The Encounter when the order was made", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "An identifier for the report" + }, + { + "name": "image", + "type": "reference", + "documentation": "A reference to the image source.", + "chain": [ + "*" + ] + }, + { + "name": "issued", + "type": "date", + "documentation": "When the report was issued" + }, + { + "name": "patient", + "type": "reference", + "documentation": "The subject of the report if a patient", + "chain": [ + "*" + ] + }, + { + "name": "performer", + "type": "reference", + "documentation": "Who was the source of the report (organization)", + "chain": [ + "*" + ] + }, + { + "name": "request", + "type": "reference", + "documentation": "Reference to the test or procedure request.", + "chain": [ + "*" + ] + }, + { + "name": "result", + "type": "reference", + "documentation": "Link to an atomic result (observation resource)", + "chain": [ + "*" + ] + }, + { + "name": "specimen", + "type": "reference", + "documentation": "The specimen details", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "The status of the report" + }, + { + "name": "subject", + "type": "reference", + "documentation": "The subject of the report", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "DocumentManifest", + "profile": { + "reference": "http://hl7.org/fhir/profiles/DocumentManifest" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "DocumentManifest:author", + "DocumentManifest:content-ref", + "DocumentManifest:patient", + "DocumentManifest:recipient", + "DocumentManifest:related-ref", + "DocumentManifest:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "author", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "content-ref", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "created", + "type": "date" + }, + { + "name": "description", + "type": "string" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "recipient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "related-id", + "type": "token" + }, + { + "name": "related-ref", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "source", + "type": "uri" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "type", + "type": "token" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 7 + } + ], + "type": "DocumentReference", + "profile": { + "reference": "http://hl7.org/fhir/profiles/DocumentReference" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "DocumentReference:authenticator", + "DocumentReference:author", + "DocumentReference:custodian", + "DocumentReference:encounter", + "DocumentReference:patient", + "DocumentReference:related-ref", + "DocumentReference:relatesto", + "DocumentReference:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "authenticator", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "author", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "class", + "type": "token" + }, + { + "name": "created", + "type": "date" + }, + { + "name": "custodian", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "description", + "type": "string" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "event", + "type": "token" + }, + { + "name": "facility", + "type": "token" + }, + { + "name": "format", + "type": "token" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "indexed", + "type": "date" + }, + { + "name": "language", + "type": "token" + }, + { + "name": "location", + "type": "uri" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "period", + "type": "date" + }, + { + "name": "related-id", + "type": "token" + }, + { + "name": "related-ref", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "relatesto", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "relatesto-relation", + "type": "composite", + "documentation": "Combination of relation and relatesTo" + }, + { + "name": "relation", + "type": "token" + }, + { + "name": "securitylabel", + "type": "token" + }, + { + "name": "setting", + "type": "token" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "type", + "type": "token" + } + ] + }, + { + "type": "EligibilityRequest", + "profile": { + "reference": "http://hl7.org/fhir/profiles/EligibilityRequest" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The business identifier of the Eligibility" + } + ] + }, + { + "type": "EligibilityResponse", + "profile": { + "reference": "http://hl7.org/fhir/profiles/EligibilityResponse" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The business identifier of the Explanation of Benefit" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 19524 + } + ], + "type": "Encounter", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Encounter" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Encounter:appointment", + "Encounter:condition", + "Encounter:episodeofcare", + "Encounter:incomingreferral", + "Encounter:indication", + "Encounter:location", + "Encounter:part-of", + "Encounter:participant", + "Encounter:patient", + "Encounter:practitioner", + "Encounter:procedure" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "appointment", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "condition", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "date", + "type": "date", + "documentation": "A date within the period the Encounter lasted" + }, + { + "name": "episodeofcare", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "incomingreferral", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "indication", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "length", + "type": "number", + "documentation": "Length of encounter in days" + }, + { + "name": "location", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "location-period", + "type": "date" + }, + { + "name": "part-of", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "participant", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "participant-type", + "type": "token" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "practitioner", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "procedure", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "reason", + "type": "token" + }, + { + "name": "special-arrangement", + "type": "token" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "type", + "type": "token" + } + ] + }, + { + "type": "EnrollmentRequest", + "profile": { + "reference": "http://hl7.org/fhir/profiles/EnrollmentRequest" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "EnrollmentRequest:patient", + "EnrollmentRequest:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The business identifier of the Enrollment" + }, + { + "name": "patient", + "type": "reference", + "documentation": "The party to be enrolled", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "documentation": "The party to be enrolled", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "EnrollmentResponse", + "profile": { + "reference": "http://hl7.org/fhir/profiles/EnrollmentResponse" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The business identifier of the Explanation of Benefit" + } + ] + }, + { + "type": "EpisodeOfCare", + "profile": { + "reference": "http://hl7.org/fhir/profiles/EpisodeOfCare" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "EpisodeOfCare:care-manager", + "EpisodeOfCare:condition", + "EpisodeOfCare:incomingreferral", + "EpisodeOfCare:organization", + "EpisodeOfCare:patient", + "EpisodeOfCare:team-member" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "care-manager", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "condition", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "date", + "type": "date", + "documentation": "The provided date search value falls within the episode of care's period" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "incomingreferral", + "type": "reference", + "documentation": "Incoming Referral Request", + "chain": [ + "*" + ] + }, + { + "name": "organization", + "type": "reference", + "documentation": "The organization that has assumed the specific responsibilities of this EpisodeOfCare", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "The current status of the Episode of Care as provided (does not check the status history collection)" + }, + { + "name": "team-member", + "type": "reference", + "documentation": "A Practitioner or Organization allocated to the care team for this EpisodeOfCare", + "chain": [ + "*" + ] + }, + { + "name": "type", + "type": "token" + } + ] + }, + { + "type": "ExplanationOfBenefit", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ExplanationOfBenefit" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The business identifier of the Explanation of Benefit" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 18 + } + ], + "type": "FamilyMemberHistory", + "profile": { + "reference": "http://hl7.org/fhir/profiles/FamilyMemberHistory" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "FamilyMemberHistory:patient" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token", + "documentation": "A search by a condition code" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "gender", + "type": "token", + "documentation": "A search by a gender code of a family member" + }, + { + "name": "identifier", + "type": "token", + "documentation": "A search by a record identifier" + }, + { + "name": "patient", + "type": "reference", + "documentation": "The identity of a subject to list family member history items for", + "chain": [ + "*" + ] + }, + { + "name": "relationship", + "type": "token", + "documentation": "A search by a relationship type" + } + ] + }, + { + "type": "Flag", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Flag" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Flag:author", + "Flag:encounter", + "Flag:patient", + "Flag:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "author", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "date", + "type": "date" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "The identity of a subject to list flags for", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "documentation": "The identity of a subject to list flags for", + "chain": [ + "*" + ] + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 2275 + } + ], + "type": "Goal", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Goal" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Goal:patient", + "Goal:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "category", + "type": "token" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token" + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "targetdate", + "type": "date" + } + ] + }, + { + "type": "Group", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Group" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Group:member" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "actual", + "type": "token" + }, + { + "name": "characteristic", + "type": "token" + }, + { + "name": "characteristic-value", + "type": "composite", + "documentation": "A composite of both characteristic and value" + }, + { + "name": "code", + "type": "token", + "documentation": "The kind of resources contained" + }, + { + "name": "exclude", + "type": "token" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "member", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "type", + "type": "token", + "documentation": "The type of resources the group contains" + }, + { + "name": "value", + "type": "token" + } + ] + }, + { + "type": "HealthcareService", + "profile": { + "reference": "http://hl7.org/fhir/profiles/HealthcareService" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "HealthcareService:location", + "HealthcareService:organization" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "characteristic", + "type": "token", + "documentation": "One of the HealthcareService's characteristics" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "location", + "type": "reference", + "documentation": "The location of the Healthcare Service", + "chain": [ + "*" + ] + }, + { + "name": "name", + "type": "string", + "documentation": "A portion of the Healthcare service name" + }, + { + "name": "organization", + "type": "reference", + "documentation": "The organization that provides this Healthcare Service", + "chain": [ + "*" + ] + }, + { + "name": "programname", + "type": "string", + "documentation": "One of the Program Names serviced by this HealthcareService" + }, + { + "name": "servicecategory", + "type": "token", + "documentation": "Service Category of the Healthcare Service" + }, + { + "name": "servicetype", + "type": "token", + "documentation": "The type of service provided by this healthcare service" + } + ] + }, + { + "type": "ImagingObjectSelection", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ImagingObjectSelection" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "ImagingObjectSelection:author", + "ImagingObjectSelection:patient" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "author", + "type": "reference", + "documentation": "Author of key DICOM object selection", + "chain": [ + "*" + ] + }, + { + "name": "authoring-time", + "type": "date", + "documentation": "Time of key DICOM object selection authoring" + }, + { + "name": "identifier", + "type": "uri", + "documentation": "UID of key DICOM object selection" + }, + { + "name": "patient", + "type": "reference", + "documentation": "Subject of key DICOM object selection", + "chain": [ + "*" + ] + }, + { + "name": "selected-study", + "type": "uri", + "documentation": "Study selected in key DICOM object selection" + }, + { + "name": "title", + "type": "token", + "documentation": "Title of key DICOM object selection" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 2 + } + ], + "type": "ImagingStudy", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ImagingStudy" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "ImagingStudy:order", + "ImagingStudy:patient" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "accession", + "type": "token", + "documentation": "The accession identifier for the study" + }, + { + "name": "bodysite", + "type": "token", + "documentation": "The body site studied" + }, + { + "name": "dicom-class", + "type": "uri", + "documentation": "The type of the instance" + }, + { + "name": "modality", + "type": "token", + "documentation": "The modality of the series" + }, + { + "name": "order", + "type": "reference", + "documentation": "The order for the image", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "Who the study is about", + "chain": [ + "*" + ] + }, + { + "name": "series", + "type": "uri", + "documentation": "The identifier of the series of images" + }, + { + "name": "started", + "type": "date", + "documentation": "When the study was started" + }, + { + "name": "study", + "type": "uri", + "documentation": "The study identifier for the image" + }, + { + "name": "uid", + "type": "uri", + "documentation": "The instance unique identifier" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 13191 + } + ], + "type": "Immunization", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Immunization" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Immunization:location", + "Immunization:manufacturer", + "Immunization:patient", + "Immunization:performer", + "Immunization:reaction", + "Immunization:requester" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "date", + "type": "date", + "documentation": "Vaccination (non)-Administration Date" + }, + { + "name": "dose-sequence", + "type": "number" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "location", + "type": "reference", + "documentation": "The service delivery location or facility in which the vaccine was / was to be administered", + "chain": [ + "*" + ] + }, + { + "name": "lot-number", + "type": "string", + "documentation": "Vaccine Lot Number" + }, + { + "name": "manufacturer", + "type": "reference", + "documentation": "Vaccine Manufacturer", + "chain": [ + "*" + ] + }, + { + "name": "notgiven", + "type": "token", + "documentation": "Administrations which were not given" + }, + { + "name": "patient", + "type": "reference", + "documentation": "The patient for the vaccination record", + "chain": [ + "*" + ] + }, + { + "name": "performer", + "type": "reference", + "documentation": "The practitioner who administered the vaccination", + "chain": [ + "*" + ] + }, + { + "name": "reaction", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "reaction-date", + "type": "date" + }, + { + "name": "reason", + "type": "token" + }, + { + "name": "reason-not-given", + "type": "token", + "documentation": "Explanation of reason vaccination was not administered" + }, + { + "name": "requester", + "type": "reference", + "documentation": "The practitioner who ordered the vaccination", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "Immunization event status" + }, + { + "name": "vaccine-code", + "type": "token", + "documentation": "Vaccine Product Administered" + } + ] + }, + { + "type": "ImmunizationRecommendation", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ImmunizationRecommendation" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "ImmunizationRecommendation:information", + "ImmunizationRecommendation:patient", + "ImmunizationRecommendation:support" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "dose-number", + "type": "number" + }, + { + "name": "dose-sequence", + "type": "number" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "information", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token" + }, + { + "name": "support", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "vaccine-type", + "type": "token" + } + ] + }, + { + "type": "ImplementationGuide", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ImplementationGuide" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "context", + "type": "token", + "documentation": "A use context assigned to the structure" + }, + { + "name": "date", + "type": "date", + "documentation": "The implementation guide publication date" + }, + { + "name": "dependency", + "type": "uri" + }, + { + "name": "description", + "type": "string", + "documentation": "Text search in the description of the implementation guide" + }, + { + "name": "experimental", + "type": "token" + }, + { + "name": "name", + "type": "string", + "documentation": "Name of the implementation guide" + }, + { + "name": "publisher", + "type": "string", + "documentation": "Name of the publisher of the implementation guide" + }, + { + "name": "status", + "type": "token", + "documentation": "The current status of the implementation guide" + }, + { + "name": "url", + "type": "uri" + }, + { + "name": "version", + "type": "token", + "documentation": "The version identifier of the implementation guide" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 45 + } + ], + "type": "List", + "profile": { + "reference": "http://hl7.org/fhir/profiles/List" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "List:encounter", + "List:item", + "List:patient", + "List:source", + "List:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "empty-reason", + "type": "token" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "item", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "notes", + "type": "string" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "source", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token" + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "title", + "type": "string" + } + ] + }, + { + "type": "Location", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Location" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Location:organization", + "Location:partof" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "address", + "type": "string", + "documentation": "A (part of the) address of the location" + }, + { + "name": "address-city", + "type": "string", + "documentation": "A city specified in an address" + }, + { + "name": "address-country", + "type": "string", + "documentation": "A country specified in an address" + }, + { + "name": "address-postalcode", + "type": "string", + "documentation": "A postal code specified in an address" + }, + { + "name": "address-state", + "type": "string", + "documentation": "A state specified in an address" + }, + { + "name": "address-use", + "type": "token", + "documentation": "A use code specified in an address" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "name", + "type": "string", + "documentation": "A (portion of the) name of the location" + }, + { + "name": "near", + "type": "token", + "documentation": "The coordinates expressed as [lat],[long] (using the WGS84 datum, see notes) to find locations near to (servers may search using a square rather than a circle for efficiency)" + }, + { + "name": "near-distance", + "type": "token", + "documentation": "A distance quantity to limit the near search to locations within a specific distance" + }, + { + "name": "organization", + "type": "reference", + "documentation": "Searches for locations that are managed by the provided organization", + "chain": [ + "*" + ] + }, + { + "name": "partof", + "type": "reference", + "documentation": "The location of which this location is a part", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "Searches for locations with a specific kind of status" + }, + { + "name": "type", + "type": "token", + "documentation": "A code for the type of location" + } + ] + }, + { + "type": "Media", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Media" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Media:operator", + "Media:patient", + "Media:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "created", + "type": "date" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "operator", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "subtype", + "type": "token" + }, + { + "name": "type", + "type": "token" + }, + { + "name": "view", + "type": "token" + } + ] + }, + { + "type": "Medication", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Medication" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Medication:content", + "Medication:ingredient", + "Medication:manufacturer" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token" + }, + { + "name": "container", + "type": "token" + }, + { + "name": "content", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "form", + "type": "token" + }, + { + "name": "ingredient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "manufacturer", + "type": "reference", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "MedicationAdministration", + "profile": { + "reference": "http://hl7.org/fhir/profiles/MedicationAdministration" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "MedicationAdministration:device", + "MedicationAdministration:encounter", + "MedicationAdministration:medication", + "MedicationAdministration:patient", + "MedicationAdministration:practitioner", + "MedicationAdministration:prescription" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token", + "documentation": "Return administrations of this medication code" + }, + { + "name": "device", + "type": "reference", + "documentation": "Return administrations with this administration device identity", + "chain": [ + "*" + ] + }, + { + "name": "effectivetime", + "type": "date", + "documentation": "Date administration happened (or did not happen)" + }, + { + "name": "encounter", + "type": "reference", + "documentation": "Return administrations that share this encounter", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "Return administrations with this external identifier" + }, + { + "name": "medication", + "type": "reference", + "documentation": "Return administrations of this medication resource", + "chain": [ + "*" + ] + }, + { + "name": "notgiven", + "type": "token", + "documentation": "Administrations that were not made" + }, + { + "name": "patient", + "type": "reference", + "documentation": "The identity of a patient to list administrations for", + "chain": [ + "*" + ] + }, + { + "name": "practitioner", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "prescription", + "type": "reference", + "documentation": "The identity of a prescription to list administrations from", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "MedicationAdministration event status (for example one of active/paused/completed/nullified)" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 1107 + } + ], + "type": "MedicationDispense", + "profile": { + "reference": "http://hl7.org/fhir/profiles/MedicationDispense" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "MedicationDispense:destination", + "MedicationDispense:dispenser", + "MedicationDispense:medication", + "MedicationDispense:patient", + "MedicationDispense:prescription", + "MedicationDispense:receiver", + "MedicationDispense:responsibleparty" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token", + "documentation": "Return dispenses of this medicine code" + }, + { + "name": "destination", + "type": "reference", + "documentation": "Return dispenses that should be sent to a specific destination", + "chain": [ + "*" + ] + }, + { + "name": "dispenser", + "type": "reference", + "documentation": "Return all dispenses performed by a specific individual", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "Return dispenses with this external identifier" + }, + { + "name": "medication", + "type": "reference", + "documentation": "Return dispenses of this medicine resource", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "The identity of a patient to list dispenses for", + "chain": [ + "*" + ] + }, + { + "name": "prescription", + "type": "reference", + "documentation": "The identity of a prescription to list dispenses from", + "chain": [ + "*" + ] + }, + { + "name": "receiver", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "responsibleparty", + "type": "reference", + "documentation": "Return all dispenses with the specified responsible party", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "Status of the dispense" + }, + { + "name": "type", + "type": "token", + "documentation": "Return all dispenses of a specific type" + }, + { + "name": "whenhandedover", + "type": "date", + "documentation": "Date when medication handed over to patient (outpatient setting), or supplied to ward or clinic (inpatient setting)" + }, + { + "name": "whenprepared", + "type": "date", + "documentation": "Date when medication prepared" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 5956 + } + ], + "type": "MedicationOrder", + "profile": { + "reference": "http://hl7.org/fhir/profiles/MedicationOrder" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "MedicationOrder:encounter", + "MedicationOrder:medication", + "MedicationOrder:patient", + "MedicationOrder:prescriber" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token", + "documentation": "Return administrations of this medication code" + }, + { + "name": "datewritten", + "type": "date", + "documentation": "Return prescriptions written on this date" + }, + { + "name": "encounter", + "type": "reference", + "documentation": "Return prescriptions with this encounter identifier", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "Return prescriptions with this external identifier" + }, + { + "name": "medication", + "type": "reference", + "documentation": "Return administrations of this medication reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "The identity of a patient to list orders for", + "chain": [ + "*" + ] + }, + { + "name": "prescriber", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "Status of the prescription" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 6 + } + ], + "type": "MedicationStatement", + "profile": { + "reference": "http://hl7.org/fhir/profiles/MedicationStatement" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "MedicationStatement:medication", + "MedicationStatement:patient", + "MedicationStatement:source" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token", + "documentation": "Return administrations of this medication code" + }, + { + "name": "effectivedate", + "type": "date", + "documentation": "Date when patient was taking (or not taking) the medication" + }, + { + "name": "identifier", + "type": "token", + "documentation": "Return statements with this external identifier" + }, + { + "name": "medication", + "type": "reference", + "documentation": "Return administrations of this medication reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "The identity of a patient to list statements for", + "chain": [ + "*" + ] + }, + { + "name": "source", + "type": "reference", + "documentation": "Who the information in the statement came from", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "Return statements that match the given status" + } + ] + }, + { + "type": "MessageHeader", + "profile": { + "reference": "http://hl7.org/fhir/profiles/MessageHeader" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "MessageHeader:author", + "MessageHeader:data", + "MessageHeader:enterer", + "MessageHeader:receiver", + "MessageHeader:responsible", + "MessageHeader:target" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "author", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "code", + "type": "token" + }, + { + "name": "data", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "destination", + "type": "string" + }, + { + "name": "destination-uri", + "type": "uri" + }, + { + "name": "enterer", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "event", + "type": "token" + }, + { + "name": "receiver", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "response-id", + "type": "token" + }, + { + "name": "responsible", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "source", + "type": "string" + }, + { + "name": "source-uri", + "type": "uri" + }, + { + "name": "target", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "timestamp", + "type": "date" + } + ] + }, + { + "type": "NamingSystem", + "profile": { + "reference": "http://hl7.org/fhir/profiles/NamingSystem" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "NamingSystem:replaced-by" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "contact", + "type": "string" + }, + { + "name": "context", + "type": "token" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "id-type", + "type": "token" + }, + { + "name": "kind", + "type": "token" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "period", + "type": "date" + }, + { + "name": "publisher", + "type": "string" + }, + { + "name": "replaced-by", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "responsible", + "type": "string" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "telecom", + "type": "token" + }, + { + "name": "type", + "type": "token" + }, + { + "name": "value", + "type": "string" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 1 + } + ], + "type": "NutritionOrder", + "profile": { + "reference": "http://hl7.org/fhir/profiles/NutritionOrder" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "NutritionOrder:encounter", + "NutritionOrder:patient", + "NutritionOrder:provider" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "additive", + "type": "token", + "documentation": "Type of module component to add to the feeding" + }, + { + "name": "datetime", + "type": "date", + "documentation": "Return nutrition orders requested on this date" + }, + { + "name": "encounter", + "type": "reference", + "documentation": "Return nutrition orders with this encounter identifier", + "chain": [ + "*" + ] + }, + { + "name": "formula", + "type": "token", + "documentation": "Type of enteral or infant formula" + }, + { + "name": "identifier", + "type": "token", + "documentation": "Return nutrition orders with this external identifier" + }, + { + "name": "oraldiet", + "type": "token", + "documentation": "Type of diet that can be consumed orally (i.e., take via the mouth)." + }, + { + "name": "patient", + "type": "reference", + "documentation": "The identity of the person who requires the diet, formula or nutritional supplement", + "chain": [ + "*" + ] + }, + { + "name": "provider", + "type": "reference", + "documentation": "The identify of the provider who placed the nutrition order", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "Status of the nutrition order." + }, + { + "name": "supplement", + "type": "token", + "documentation": "Type of supplement product requested" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 79735 + } + ], + "type": "Observation", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Observation" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Observation:device", + "Observation:encounter", + "Observation:patient", + "Observation:performer", + "Observation:related-target", + "Observation:specimen", + "Observation:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "category", + "type": "token", + "documentation": "The classification of the type of observation" + }, + { + "name": "code", + "type": "token", + "documentation": "The code of the observation type" + }, + { + "name": "code-value-concept", + "type": "composite", + "documentation": "Both code and one of the value parameters" + }, + { + "name": "code-value-date", + "type": "composite", + "documentation": "Both code and one of the value parameters" + }, + { + "name": "code-value-quantity", + "type": "composite", + "documentation": "Both code and one of the value parameters" + }, + { + "name": "code-value-string", + "type": "composite", + "documentation": "Both code and one of the value parameters" + }, + { + "name": "component-code", + "type": "token", + "documentation": "The component code of the observation type" + }, + { + "name": "component-code-component-value-concept", + "type": "composite", + "documentation": "Both component code and one of the component value parameters" + }, + { + "name": "component-code-component-value-quantity", + "type": "composite", + "documentation": "Both component code and one of the component value parameters" + }, + { + "name": "component-code-component-value-string", + "type": "composite", + "documentation": "Both component code and one of the component value parameters" + }, + { + "name": "component-data-absent-reason", + "type": "token", + "documentation": "The reason why the expected value in the element Observation.component.value[x] is missing." + }, + { + "name": "component-value-concept", + "type": "token", + "documentation": "The value of the component observation, if the value is a CodeableConcept" + }, + { + "name": "component-value-quantity", + "type": "quantity", + "documentation": "The value of the component observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)" + }, + { + "name": "component-value-string", + "type": "string", + "documentation": "The value of the component observation, if the value is a string, and also searches in CodeableConcept.text" + }, + { + "name": "data-absent-reason", + "type": "token", + "documentation": "The reason why the expected value in the element Observation.value[x] is missing." + }, + { + "name": "date", + "type": "date", + "documentation": "Obtained date/time. If the obtained element is a period, a date that falls in the period" + }, + { + "name": "device", + "type": "reference", + "documentation": "The Device that generated the observation data.", + "chain": [ + "*" + ] + }, + { + "name": "encounter", + "type": "reference", + "documentation": "Healthcare event related to the observation", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "The unique id for a particular observation" + }, + { + "name": "patient", + "type": "reference", + "documentation": "The subject that the observation is about (if patient)", + "chain": [ + "*" + ] + }, + { + "name": "performer", + "type": "reference", + "documentation": "Who performed the observation", + "chain": [ + "*" + ] + }, + { + "name": "related-target", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "related-target-related-type", + "type": "composite", + "documentation": "Related Observations - search on related-type and related-target together" + }, + { + "name": "related-type", + "type": "token" + }, + { + "name": "specimen", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "The status of the observation" + }, + { + "name": "subject", + "type": "reference", + "documentation": "The subject that the observation is about", + "chain": [ + "*" + ] + }, + { + "name": "value-concept", + "type": "token", + "documentation": "The value of the observation, if the value is a CodeableConcept" + }, + { + "name": "value-date", + "type": "date", + "documentation": "The value of the observation, if the value is a date or period of time" + }, + { + "name": "value-quantity", + "type": "quantity", + "documentation": "The value of the observation, if the value is a Quantity, or a SampledData (just search on the bounds of the values in sampled data)" + }, + { + "name": "value-string", + "type": "string", + "documentation": "The value of the observation, if the value is a string, and also searches in CodeableConcept.text" + } + ] + }, + { + "type": "OperationDefinition", + "profile": { + "reference": "http://hl7.org/fhir/profiles/OperationDefinition" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "OperationDefinition:base", + "OperationDefinition:profile" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "base", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "code", + "type": "token" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "instance", + "type": "token" + }, + { + "name": "kind", + "type": "token" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "profile", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "publisher", + "type": "string" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "system", + "type": "token" + }, + { + "name": "type", + "type": "token" + }, + { + "name": "url", + "type": "uri" + }, + { + "name": "version", + "type": "token" + } + ] + }, + { + "type": "OperationOutcome", + "profile": { + "reference": "http://hl7.org/fhir/profiles/OperationOutcome" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + } + ] + }, + { + "type": "Order", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Order" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Order:detail", + "Order:patient", + "Order:source", + "Order:subject", + "Order:target" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "detail", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "Instance id from source, target, and/or others" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "source", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "target", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "when", + "type": "date" + }, + { + "name": "when_code", + "type": "token" + } + ] + }, + { + "type": "OrderResponse", + "profile": { + "reference": "http://hl7.org/fhir/profiles/OrderResponse" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "OrderResponse:fulfillment", + "OrderResponse:request", + "OrderResponse:who" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "fulfillment", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "Identifiers assigned to this order by the orderer or by the receiver" + }, + { + "name": "request", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "who", + "type": "reference", + "chain": [ + "*" + ] + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 1460 + } + ], + "type": "Organization", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Organization" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Organization:partof" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "active", + "type": "token", + "documentation": "Whether the organization's record is active" + }, + { + "name": "address", + "type": "string", + "documentation": "A (part of the) address of the Organization" + }, + { + "name": "address-city", + "type": "string", + "documentation": "A city specified in an address" + }, + { + "name": "address-country", + "type": "string", + "documentation": "A country specified in an address" + }, + { + "name": "address-postalcode", + "type": "string", + "documentation": "A postal code specified in an address" + }, + { + "name": "address-state", + "type": "string", + "documentation": "A state specified in an address" + }, + { + "name": "address-use", + "type": "token", + "documentation": "A use code specified in an address" + }, + { + "name": "identifier", + "type": "token", + "documentation": "Any identifier for the organization (not the accreditation issuer's identifier)" + }, + { + "name": "name", + "type": "string", + "documentation": "A portion of the organization's name" + }, + { + "name": "partof", + "type": "reference", + "documentation": "Search all organizations that are part of the given organization", + "chain": [ + "*" + ] + }, + { + "name": "phonetic", + "type": "string", + "documentation": "A portion of the organization's name using some kind of phonetic matching algorithm" + }, + { + "name": "type", + "type": "token", + "documentation": "A code for the type of organization" + } + ] + }, + { + "type": "Parameters", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Parameters" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 1544 + } + ], + "type": "Patient", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Patient" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Patient:careprovider", + "Patient:link", + "Patient:organization" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "active", + "type": "token", + "documentation": "Whether the patient record is active" + }, + { + "name": "address", + "type": "string", + "documentation": "An address in any kind of address/part of the patient" + }, + { + "name": "address-city", + "type": "string", + "documentation": "A city specified in an address" + }, + { + "name": "address-country", + "type": "string", + "documentation": "A country specified in an address" + }, + { + "name": "address-postalcode", + "type": "string", + "documentation": "A postalCode specified in an address" + }, + { + "name": "address-state", + "type": "string", + "documentation": "A state specified in an address" + }, + { + "name": "address-use", + "type": "token", + "documentation": "A use code specified in an address" + }, + { + "name": "animal-breed", + "type": "token", + "documentation": "The breed for animal patients" + }, + { + "name": "animal-species", + "type": "token", + "documentation": "The species for animal patients" + }, + { + "name": "birthdate", + "type": "date", + "documentation": "The patient's date of birth" + }, + { + "name": "careprovider", + "type": "reference", + "documentation": "Patient's nominated care provider, could be a care manager, not the organization that manages the record", + "chain": [ + "*" + ] + }, + { + "name": "deathdate", + "type": "date", + "documentation": "The date of death has been provided and satisfies this search value" + }, + { + "name": "deceased", + "type": "token", + "documentation": "This patient has been marked as deceased, or as a death date entered" + }, + { + "name": "email", + "type": "token", + "documentation": "A value in an email contact" + }, + { + "name": "family", + "type": "string", + "documentation": "A portion of the family name of the patient" + }, + { + "name": "gender", + "type": "token", + "documentation": "Gender of the patient" + }, + { + "name": "given", + "type": "string", + "documentation": "A portion of the given name of the patient" + }, + { + "name": "identifier", + "type": "token", + "documentation": "A patient identifier" + }, + { + "name": "language", + "type": "token", + "documentation": "Language code (irrespective of use value)" + }, + { + "name": "link", + "type": "reference", + "documentation": "All patients linked to the given patient", + "chain": [ + "*" + ] + }, + { + "name": "name", + "type": "string", + "documentation": "A portion of either family or given name of the patient" + }, + { + "name": "organization", + "type": "reference", + "documentation": "The organization at which this person is a patient", + "chain": [ + "*" + ] + }, + { + "name": "phone", + "type": "token", + "documentation": "A value in a phone contact" + }, + { + "name": "phonetic", + "type": "string", + "documentation": "A portion of either family or given name using some kind of phonetic matching algorithm" + }, + { + "name": "telecom", + "type": "token", + "documentation": "The value in any kind of telecom details of the patient" + } + ] + }, + { + "type": "PaymentNotice", + "profile": { + "reference": "http://hl7.org/fhir/profiles/PaymentNotice" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The business identifier of the Eligibility" + } + ] + }, + { + "type": "PaymentReconciliation", + "profile": { + "reference": "http://hl7.org/fhir/profiles/PaymentReconciliation" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The business identifier of the Explanation of Benefit" + } + ] + }, + { + "type": "Person", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Person" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Person:link", + "Person:organization", + "Person:patient", + "Person:practitioner", + "Person:relatedperson" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "address", + "type": "string", + "documentation": "An address in any kind of address/part" + }, + { + "name": "address-city", + "type": "string", + "documentation": "A city specified in an address" + }, + { + "name": "address-country", + "type": "string", + "documentation": "A country specified in an address" + }, + { + "name": "address-postalcode", + "type": "string", + "documentation": "A postal code specified in an address" + }, + { + "name": "address-state", + "type": "string", + "documentation": "A state specified in an address" + }, + { + "name": "address-use", + "type": "token", + "documentation": "A use code specified in an address" + }, + { + "name": "birthdate", + "type": "date", + "documentation": "The person's date of birth" + }, + { + "name": "email", + "type": "token", + "documentation": "A value in an email contact" + }, + { + "name": "gender", + "type": "token", + "documentation": "The gender of the person" + }, + { + "name": "identifier", + "type": "token", + "documentation": "A person Identifier" + }, + { + "name": "link", + "type": "reference", + "documentation": "Any link has this Patient, Person, RelatedPerson or Practitioner reference", + "chain": [ + "*" + ] + }, + { + "name": "name", + "type": "string", + "documentation": "A portion of name in any name part" + }, + { + "name": "organization", + "type": "reference", + "documentation": "The organization at which this person record is being managed", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "The Person links to this Patient", + "chain": [ + "*" + ] + }, + { + "name": "phone", + "type": "token", + "documentation": "A value in a phone contact" + }, + { + "name": "phonetic", + "type": "string", + "documentation": "A portion of name using some kind of phonetic matching algorithm" + }, + { + "name": "practitioner", + "type": "reference", + "documentation": "The Person links to this Practitioner", + "chain": [ + "*" + ] + }, + { + "name": "relatedperson", + "type": "reference", + "documentation": "The Person links to this RelatedPerson", + "chain": [ + "*" + ] + }, + { + "name": "telecom", + "type": "token", + "documentation": "The value in any kind of contact" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 3 + } + ], + "type": "Practitioner", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Practitioner" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Practitioner:location", + "Practitioner:organization" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "address", + "type": "string", + "documentation": "An address in any kind of address/part" + }, + { + "name": "address-city", + "type": "string", + "documentation": "A city specified in an address" + }, + { + "name": "address-country", + "type": "string", + "documentation": "A country specified in an address" + }, + { + "name": "address-postalcode", + "type": "string", + "documentation": "A postalCode specified in an address" + }, + { + "name": "address-state", + "type": "string", + "documentation": "A state specified in an address" + }, + { + "name": "address-use", + "type": "token", + "documentation": "A use code specified in an address" + }, + { + "name": "communication", + "type": "token", + "documentation": "One of the languages that the practitioner can communicate with" + }, + { + "name": "email", + "type": "token", + "documentation": "A value in an email contact" + }, + { + "name": "family", + "type": "string", + "documentation": "A portion of the family name" + }, + { + "name": "gender", + "type": "token", + "documentation": "Gender of the practitioner" + }, + { + "name": "given", + "type": "string", + "documentation": "A portion of the given name" + }, + { + "name": "identifier", + "type": "token", + "documentation": "A practitioner's Identifier" + }, + { + "name": "location", + "type": "reference", + "documentation": "One of the locations at which this practitioner provides care", + "chain": [ + "*" + ] + }, + { + "name": "name", + "type": "string", + "documentation": "A portion of either family or given name" + }, + { + "name": "organization", + "type": "reference", + "documentation": "The identity of the organization the practitioner represents / acts on behalf of", + "chain": [ + "*" + ] + }, + { + "name": "phone", + "type": "token", + "documentation": "A value in a phone contact" + }, + { + "name": "phonetic", + "type": "string", + "documentation": "A portion of either family or given name using some kind of phonetic matching algorithm" + }, + { + "name": "role", + "type": "token", + "documentation": "The practitioner can perform this role at for the organization" + }, + { + "name": "specialty", + "type": "token", + "documentation": "The practitioner has this specialty at an organization" + }, + { + "name": "telecom", + "type": "token", + "documentation": "The value in any kind of contact" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 9029 + } + ], + "type": "Procedure", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Procedure" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Procedure:encounter", + "Procedure:location", + "Procedure:patient", + "Procedure:performer", + "Procedure:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token", + "documentation": "A code to identify a procedure" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "A unique identifier for a procedure" + }, + { + "name": "location", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "Search by subject - a patient", + "chain": [ + "*" + ] + }, + { + "name": "performer", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "documentation": "Search by subject", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "ProcedureRequest", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ProcedureRequest" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "ProcedureRequest:encounter", + "ProcedureRequest:orderer", + "ProcedureRequest:patient", + "ProcedureRequest:performer", + "ProcedureRequest:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "A unique identifier of the Procedure Request" + }, + { + "name": "orderer", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "Search by subject - a patient", + "chain": [ + "*" + ] + }, + { + "name": "performer", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "documentation": "Search by subject", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "ProcessRequest", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ProcessRequest" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "ProcessRequest:organization", + "ProcessRequest:provider" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "action", + "type": "token", + "documentation": "The action requested by this resource" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The business identifier of the ProcessRequest" + }, + { + "name": "organization", + "type": "reference", + "documentation": "The organization who generated this request", + "chain": [ + "*" + ] + }, + { + "name": "provider", + "type": "reference", + "documentation": "The provider who regenerated this request", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "ProcessResponse", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ProcessResponse" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "ProcessResponse:organization", + "ProcessResponse:request", + "ProcessResponse:requestorganization", + "ProcessResponse:requestprovider" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The business identifier of the Explanation of Benefit" + }, + { + "name": "organization", + "type": "reference", + "documentation": "The organization who generated this resource", + "chain": [ + "*" + ] + }, + { + "name": "request", + "type": "reference", + "documentation": "The reference to the claim", + "chain": [ + "*" + ] + }, + { + "name": "requestorganization", + "type": "reference", + "documentation": "The Organization who is responsible the request transaction", + "chain": [ + "*" + ] + }, + { + "name": "requestprovider", + "type": "reference", + "documentation": "The Provider who is responsible the request transaction", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "Provenance", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Provenance" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Provenance:agent", + "Provenance:location", + "Provenance:patient", + "Provenance:target" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "agent", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "end", + "type": "date" + }, + { + "name": "entity", + "type": "uri" + }, + { + "name": "entitytype", + "type": "token" + }, + { + "name": "location", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "sigtype", + "type": "token" + }, + { + "name": "start", + "type": "date" + }, + { + "name": "target", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "userid", + "type": "token" + } + ] + }, + { + "type": "Questionnaire", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Questionnaire" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token", + "documentation": "A code that corresponds to the questionnaire or one of its groups" + }, + { + "name": "date", + "type": "date", + "documentation": "When the questionnaire was last changed" + }, + { + "name": "identifier", + "type": "token", + "documentation": "An identifier for the questionnaire" + }, + { + "name": "publisher", + "type": "string", + "documentation": "The author of the questionnaire" + }, + { + "name": "status", + "type": "token", + "documentation": "The status of the questionnaire" + }, + { + "name": "title", + "type": "string", + "documentation": "All or part of the name of the questionnaire (title for the root group of the questionnaire)" + }, + { + "name": "version", + "type": "string", + "documentation": "The business version of the questionnaire" + } + ] + }, + { + "type": "QuestionnaireResponse", + "profile": { + "reference": "http://hl7.org/fhir/profiles/QuestionnaireResponse" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "QuestionnaireResponse:author", + "QuestionnaireResponse:encounter", + "QuestionnaireResponse:patient", + "QuestionnaireResponse:questionnaire", + "QuestionnaireResponse:source", + "QuestionnaireResponse:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "author", + "type": "reference", + "documentation": "The author of the questionnaire", + "chain": [ + "*" + ] + }, + { + "name": "authored", + "type": "date", + "documentation": "When the questionnaire was authored" + }, + { + "name": "encounter", + "type": "reference", + "documentation": "Encounter during which questionnaire was authored", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "The patient that is the subject of the questionnaire", + "chain": [ + "*" + ] + }, + { + "name": "questionnaire", + "type": "reference", + "documentation": "The questionnaire the answers are provided for", + "chain": [ + "*" + ] + }, + { + "name": "source", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token", + "documentation": "The status of the questionnaire response" + }, + { + "name": "subject", + "type": "reference", + "documentation": "The subject of the questionnaire", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "ReferralRequest", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ReferralRequest" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "ReferralRequest:patient", + "ReferralRequest:recipient", + "ReferralRequest:requester" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "date", + "type": "date", + "documentation": "Creation or activation date" + }, + { + "name": "patient", + "type": "reference", + "documentation": "Who the referral is about", + "chain": [ + "*" + ] + }, + { + "name": "priority", + "type": "token", + "documentation": "The priority assigned to the referral" + }, + { + "name": "recipient", + "type": "reference", + "documentation": "The person that the referral was sent to", + "chain": [ + "*" + ] + }, + { + "name": "requester", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "specialty", + "type": "token", + "documentation": "The specialty that the referral is for" + }, + { + "name": "status", + "type": "token", + "documentation": "The status of the referral" + }, + { + "name": "type", + "type": "token", + "documentation": "The type of the referral" + } + ] + }, + { + "type": "RelatedPerson", + "profile": { + "reference": "http://hl7.org/fhir/profiles/RelatedPerson" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "RelatedPerson:patient" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "address", + "type": "string", + "documentation": "An address in any kind of address/part" + }, + { + "name": "address-city", + "type": "string", + "documentation": "A city specified in an address" + }, + { + "name": "address-country", + "type": "string", + "documentation": "A country specified in an address" + }, + { + "name": "address-postalcode", + "type": "string", + "documentation": "A postal code specified in an address" + }, + { + "name": "address-state", + "type": "string", + "documentation": "A state specified in an address" + }, + { + "name": "address-use", + "type": "token", + "documentation": "A use code specified in an address" + }, + { + "name": "birthdate", + "type": "date", + "documentation": "The Related Person's date of birth" + }, + { + "name": "email", + "type": "token", + "documentation": "A value in an email contact" + }, + { + "name": "gender", + "type": "token", + "documentation": "Gender of the person" + }, + { + "name": "identifier", + "type": "token", + "documentation": "A patient Identifier" + }, + { + "name": "name", + "type": "string", + "documentation": "A portion of name in any name part" + }, + { + "name": "patient", + "type": "reference", + "documentation": "The patient this person is related to", + "chain": [ + "*" + ] + }, + { + "name": "phone", + "type": "token", + "documentation": "A value in a phone contact" + }, + { + "name": "phonetic", + "type": "string", + "documentation": "A portion of name using some kind of phonetic matching algorithm" + }, + { + "name": "telecom", + "type": "token", + "documentation": "The value in any kind of contact" + } + ] + }, + { + "type": "RiskAssessment", + "profile": { + "reference": "http://hl7.org/fhir/profiles/RiskAssessment" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "RiskAssessment:condition", + "RiskAssessment:encounter", + "RiskAssessment:patient", + "RiskAssessment:performer", + "RiskAssessment:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "condition", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "date", + "type": "date" + }, + { + "name": "encounter", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "method", + "type": "token" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "performer", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "chain": [ + "*" + ] + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 2 + } + ], + "type": "Schedule", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Schedule" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Schedule:actor" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "actor", + "type": "reference", + "documentation": "The individual(HealthcareService, Practitioner, Location, ...) to find a Schedule for", + "chain": [ + "*" + ] + }, + { + "name": "date", + "type": "date", + "documentation": "Search for Schedule resources that have a period that contains this date specified" + }, + { + "name": "identifier", + "type": "token", + "documentation": "A Schedule Identifier" + }, + { + "name": "type", + "type": "token", + "documentation": "The type of appointments that can be booked into associated slot(s)" + } + ] + }, + { + "type": "SearchParameter", + "profile": { + "reference": "http://hl7.org/fhir/profiles/SearchParameter" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "base", + "type": "token" + }, + { + "name": "code", + "type": "token" + }, + { + "name": "description", + "type": "string" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "target", + "type": "token" + }, + { + "name": "type", + "type": "token" + }, + { + "name": "url", + "type": "uri" + } + ] + }, + { + "extension": [ + { + "url": "http://hl7api.sourceforge.net/hapi-fhir/res/extdefs.html#resourceCount", + "valueDecimal": 4 + } + ], + "type": "Slot", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Slot" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Slot:schedule" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "fb-type", + "type": "token", + "documentation": "The free/busy status of the appointment" + }, + { + "name": "identifier", + "type": "token", + "documentation": "A Slot Identifier" + }, + { + "name": "schedule", + "type": "reference", + "documentation": "The Schedule Resource that we are seeking a slot within", + "chain": [ + "*" + ] + }, + { + "name": "slot-type", + "type": "token", + "documentation": "The type of appointments that can be booked into the slot" + }, + { + "name": "start", + "type": "date", + "documentation": "Appointment date/time." + } + ] + }, + { + "type": "Specimen", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Specimen" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Specimen:collector", + "Specimen:parent", + "Specimen:patient", + "Specimen:subject" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "accession", + "type": "token", + "documentation": "The accession number associated with the specimen" + }, + { + "name": "bodysite", + "type": "token", + "documentation": "The code for the body site from where the specimen originated" + }, + { + "name": "collected", + "type": "date", + "documentation": "The date the specimen was collected" + }, + { + "name": "collector", + "type": "reference", + "documentation": "Who collected the specimen", + "chain": [ + "*" + ] + }, + { + "name": "container", + "type": "token", + "documentation": "The kind of specimen container" + }, + { + "name": "container-id", + "type": "token", + "documentation": "The unique identifier associated with the specimen container" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The unique identifier associated with the specimen" + }, + { + "name": "parent", + "type": "reference", + "documentation": "The parent of the specimen", + "chain": [ + "*" + ] + }, + { + "name": "patient", + "type": "reference", + "documentation": "The patient the specimen comes from", + "chain": [ + "*" + ] + }, + { + "name": "subject", + "type": "reference", + "documentation": "The subject of the specimen", + "chain": [ + "*" + ] + }, + { + "name": "type", + "type": "token", + "documentation": "The specimen type" + } + ] + }, + { + "type": "StructureDefinition", + "profile": { + "reference": "http://hl7.org/fhir/profiles/StructureDefinition" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "StructureDefinition:valueset" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "abstract", + "type": "token" + }, + { + "name": "base", + "type": "uri" + }, + { + "name": "base-path", + "type": "token" + }, + { + "name": "code", + "type": "token", + "documentation": "A code for the profile" + }, + { + "name": "context", + "type": "token", + "documentation": "A use context assigned to the structure" + }, + { + "name": "context-type", + "type": "token" + }, + { + "name": "date", + "type": "date", + "documentation": "The profile publication date" + }, + { + "name": "description", + "type": "string", + "documentation": "Text search in the description of the profile" + }, + { + "name": "display", + "type": "string" + }, + { + "name": "experimental", + "type": "token" + }, + { + "name": "ext-context", + "type": "string" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The identifier of the profile" + }, + { + "name": "kind", + "type": "token" + }, + { + "name": "name", + "type": "string", + "documentation": "Name of the profile" + }, + { + "name": "path", + "type": "token", + "documentation": "A path that is constrained in the profile" + }, + { + "name": "publisher", + "type": "string", + "documentation": "Name of the publisher of the profile" + }, + { + "name": "status", + "type": "token", + "documentation": "The current status of the profile" + }, + { + "name": "type", + "type": "token" + }, + { + "name": "url", + "type": "uri" + }, + { + "name": "valueset", + "type": "reference", + "documentation": "A vocabulary binding reference", + "chain": [ + "*" + ] + }, + { + "name": "version", + "type": "token", + "documentation": "The version identifier of the profile" + } + ] + }, + { + "type": "Subscription", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Subscription" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "contact", + "type": "token" + }, + { + "name": "criteria", + "type": "string" + }, + { + "name": "payload", + "type": "string" + }, + { + "name": "status", + "type": "token" + }, + { + "name": "tag", + "type": "token" + }, + { + "name": "type", + "type": "token" + }, + { + "name": "url", + "type": "uri" + } + ] + }, + { + "type": "Substance", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Substance" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "Substance:substance" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "category", + "type": "token", + "documentation": "The category of the substance" + }, + { + "name": "code", + "type": "token", + "documentation": "The code of the substance" + }, + { + "name": "container-identifier", + "type": "token", + "documentation": "Identifier of the package/container" + }, + { + "name": "expiry", + "type": "date", + "documentation": "Expiry date of package or container of substance" + }, + { + "name": "identifier", + "type": "token", + "documentation": "Unique identifier for the substance" + }, + { + "name": "quantity", + "type": "quantity", + "documentation": "Amount of substance in the package" + }, + { + "name": "substance", + "type": "reference", + "documentation": "A component of the substance", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "SupplyDelivery", + "profile": { + "reference": "http://hl7.org/fhir/profiles/SupplyDelivery" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "SupplyDelivery:patient", + "SupplyDelivery:receiver", + "SupplyDelivery:supplier" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "receiver", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token" + }, + { + "name": "supplier", + "type": "reference", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "SupplyRequest", + "profile": { + "reference": "http://hl7.org/fhir/profiles/SupplyRequest" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "SupplyRequest:patient", + "SupplyRequest:source", + "SupplyRequest:supplier" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "date", + "type": "date" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "kind", + "type": "token" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "source", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "status", + "type": "token" + }, + { + "name": "supplier", + "type": "reference", + "chain": [ + "*" + ] + } + ] + }, + { + "type": "Test", + "profile": { + "reference": "http://hl7.org/fhir/profiles/Test" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + } + ] + }, + { + "type": "TestScript", + "profile": { + "reference": "http://hl7.org/fhir/profiles/TestScript" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "description", + "type": "string" + }, + { + "name": "identifier", + "type": "token" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "testscript-capability", + "type": "string", + "documentation": "TestScript required and validated capability" + }, + { + "name": "testscript-setup-capability", + "type": "string", + "documentation": "TestScript setup required and validated capability" + }, + { + "name": "testscript-test-capability", + "type": "string", + "documentation": "TestScript test required and validated capability" + }, + { + "name": "url", + "type": "uri" + } + ] + }, + { + "type": "User", + "profile": { + "reference": "http://hl7.org/fhir/profiles/User" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "User:patient" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "level", + "type": "token" + }, + { + "name": "login", + "type": "string" + }, + { + "name": "name", + "type": "string" + }, + { + "name": "patient", + "type": "reference", + "chain": [ + "*" + ] + }, + { + "name": "provider", + "type": "token" + } + ] + }, + { + "type": "ValueSet", + "profile": { + "reference": "http://hl7.org/fhir/profiles/ValueSet" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "code", + "type": "token", + "documentation": "A code defined in the value set" + }, + { + "name": "context", + "type": "token", + "documentation": "A use context assigned to the value set" + }, + { + "name": "date", + "type": "date", + "documentation": "The value set publication date" + }, + { + "name": "description", + "type": "string", + "documentation": "Text search in the description of the value set" + }, + { + "name": "expansion", + "type": "uri" + }, + { + "name": "identifier", + "type": "token", + "documentation": "The identifier for the value set" + }, + { + "name": "name", + "type": "string", + "documentation": "The name of the value set" + }, + { + "name": "publisher", + "type": "string", + "documentation": "Name of the publisher of the value set" + }, + { + "name": "reference", + "type": "uri", + "documentation": "A code system included or excluded in the value set or an imported value set" + }, + { + "name": "status", + "type": "token", + "documentation": "The status of the value set" + }, + { + "name": "system", + "type": "uri", + "documentation": "The system for any codes defined by this value set" + }, + { + "name": "url", + "type": "uri", + "documentation": "The logical URL for the value set" + }, + { + "name": "version", + "type": "token", + "documentation": "The version identifier of the value set" + } + ] + }, + { + "type": "VisionPrescription", + "profile": { + "reference": "http://hl7.org/fhir/profiles/VisionPrescription" + }, + "interaction": [ + { + "code": "read" + }, + { + "code": "vread" + }, + { + "code": "update" + }, + { + "code": "delete" + }, + { + "code": "history-instance" + }, + { + "code": "history-type" + }, + { + "code": "create" + }, + { + "code": "search-type" + } + ], + "conditionalCreate": true, + "conditionalUpdate": true, + "conditionalDelete": "multiple", + "searchInclude": [ + "*", + "VisionPrescription:encounter", + "VisionPrescription:patient", + "VisionPrescription:prescriber" + ], + "searchParam": [ + { + "name": "_content", + "type": "string", + "documentation": "Search the contents of the resource's data using a fulltext search" + }, + { + "name": "_has", + "type": "string", + "documentation": "Return resources linked to by the given target" + }, + { + "name": "_id", + "type": "string", + "documentation": "The ID of the resource" + }, + { + "name": "_language", + "type": "string", + "documentation": "The language of the resource" + }, + { + "name": "_lastUpdated", + "type": "date", + "documentation": "Only return resources which were last updated as specified by the given range" + }, + { + "name": "_profile", + "type": "uri", + "documentation": "Search for resources which have the given profile" + }, + { + "name": "_security", + "type": "token", + "documentation": "Search for resources which have the given security labels" + }, + { + "name": "_tag", + "type": "token", + "documentation": "Search for resources which have the given tag" + }, + { + "name": "_text", + "type": "string", + "documentation": "Search the contents of the resource's narrative using a fulltext search" + }, + { + "name": "datewritten", + "type": "date", + "documentation": "Return prescriptions written on this date" + }, + { + "name": "encounter", + "type": "reference", + "documentation": "Return prescriptions with this encounter identifier", + "chain": [ + "*" + ] + }, + { + "name": "identifier", + "type": "token", + "documentation": "Return prescriptions with this external identifier" + }, + { + "name": "patient", + "type": "reference", + "documentation": "The identity of a patient to list dispenses for", + "chain": [ + "*" + ] + }, + { + "name": "prescriber", + "type": "reference", + "chain": [ + "*" + ] + } + ] + } + ], + "interaction": [ + { + "code": "history-system" + }, + { + "code": "transaction" + } + ], + "operation": [ + { + "name": "mark-all-resources-for-reindexing", + "definition": { + "reference": "OperationDefinition/-s-mark-all-resources-for-reindexing" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/-s-meta" + } + }, + { + "name": "get-resource-counts", + "definition": { + "reference": "OperationDefinition/-s-get-resource-counts" + } + }, + { + "name": "suggest-keywords", + "definition": { + "reference": "OperationDefinition/-s-suggest-keywords" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Account--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Account-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Account--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Account-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Account-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Account-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/AllergyIntolerance--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/AllergyIntolerance-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/AllergyIntolerance--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/AllergyIntolerance-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/AllergyIntolerance-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/AllergyIntolerance-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Appointment--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Appointment-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Appointment--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Appointment-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Appointment-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Appointment-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/AppointmentResponse--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/AppointmentResponse-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/AppointmentResponse--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/AppointmentResponse-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/AppointmentResponse-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/AppointmentResponse-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/AuditEvent--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/AuditEvent-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/AuditEvent--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/AuditEvent-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/AuditEvent-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/AuditEvent-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Basic--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Basic-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Basic--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Basic-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Basic-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Basic-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Binary--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Binary-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Binary--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Binary-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Binary-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Binary-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/BodySite--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/BodySite-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/BodySite--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/BodySite-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/BodySite-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/BodySite-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Bundle--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Bundle-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Bundle--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Bundle-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Bundle-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Bundle-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/CarePlan--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/CarePlan-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/CarePlan--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/CarePlan-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/CarePlan-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/CarePlan-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Claim--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Claim-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Claim--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Claim-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Claim-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Claim-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ClaimResponse--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ClaimResponse-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ClaimResponse--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ClaimResponse-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ClaimResponse-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ClaimResponse-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ClinicalImpression--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ClinicalImpression-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ClinicalImpression--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ClinicalImpression-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ClinicalImpression-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ClinicalImpression-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Communication--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Communication-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Communication--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Communication-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Communication-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Communication-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/CommunicationRequest--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/CommunicationRequest-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/CommunicationRequest--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/CommunicationRequest-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/CommunicationRequest-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/CommunicationRequest-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Composition--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Composition-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Composition--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Composition-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Composition-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Composition-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ConceptMap--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ConceptMap-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ConceptMap--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ConceptMap-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ConceptMap-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ConceptMap-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Condition--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Condition-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Condition--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Condition-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Condition-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Condition-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Conformance--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Conformance-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Conformance--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Conformance-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Conformance-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Conformance-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Contract--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Contract-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Contract--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Contract-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Contract-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Contract-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Coverage--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Coverage-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Coverage--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Coverage-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Coverage-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Coverage-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DataElement--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DataElement-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DataElement--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DataElement-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/DataElement-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/DataElement-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DetectedIssue--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DetectedIssue-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DetectedIssue--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DetectedIssue-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/DetectedIssue-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/DetectedIssue-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Device--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Device-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Device--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Device-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Device-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Device-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DeviceComponent--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DeviceComponent-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DeviceComponent--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DeviceComponent-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/DeviceComponent-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/DeviceComponent-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DeviceMetric--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DeviceMetric-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DeviceMetric--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DeviceMetric-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/DeviceMetric-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/DeviceMetric-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DeviceUseRequest--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DeviceUseRequest-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DeviceUseRequest--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DeviceUseRequest-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/DeviceUseRequest-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/DeviceUseRequest-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DeviceUseStatement--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DeviceUseStatement-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DeviceUseStatement--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DeviceUseStatement-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/DeviceUseStatement-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/DeviceUseStatement-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DiagnosticOrder--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DiagnosticOrder-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DiagnosticOrder--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DiagnosticOrder-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/DiagnosticOrder-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/DiagnosticOrder-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DiagnosticReport--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DiagnosticReport-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DiagnosticReport--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DiagnosticReport-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/DiagnosticReport-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/DiagnosticReport-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DocumentManifest--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DocumentManifest-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DocumentManifest--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DocumentManifest-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/DocumentManifest-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/DocumentManifest-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DocumentReference--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/DocumentReference-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DocumentReference--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/DocumentReference-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/DocumentReference-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/DocumentReference-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/EligibilityRequest--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/EligibilityRequest-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/EligibilityRequest--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/EligibilityRequest-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/EligibilityRequest-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/EligibilityRequest-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/EligibilityResponse--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/EligibilityResponse-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/EligibilityResponse--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/EligibilityResponse-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/EligibilityResponse-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/EligibilityResponse-i-meta-delete" + } + }, + { + "name": "everything", + "definition": { + "reference": "OperationDefinition/Encounter-i-everything" + } + }, + { + "name": "everything", + "definition": { + "reference": "OperationDefinition/Encounter--everything" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Encounter--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Encounter-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Encounter--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Encounter-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Encounter-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Encounter-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/EnrollmentRequest--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/EnrollmentRequest-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/EnrollmentRequest--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/EnrollmentRequest-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/EnrollmentRequest-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/EnrollmentRequest-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/EnrollmentResponse--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/EnrollmentResponse-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/EnrollmentResponse--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/EnrollmentResponse-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/EnrollmentResponse-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/EnrollmentResponse-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/EpisodeOfCare--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/EpisodeOfCare-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/EpisodeOfCare--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/EpisodeOfCare-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/EpisodeOfCare-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/EpisodeOfCare-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ExplanationOfBenefit--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ExplanationOfBenefit-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ExplanationOfBenefit--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ExplanationOfBenefit-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ExplanationOfBenefit-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ExplanationOfBenefit-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/FamilyMemberHistory--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/FamilyMemberHistory-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/FamilyMemberHistory--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/FamilyMemberHistory-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/FamilyMemberHistory-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/FamilyMemberHistory-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Flag--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Flag-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Flag--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Flag-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Flag-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Flag-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Goal--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Goal-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Goal--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Goal-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Goal-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Goal-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Group--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Group-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Group--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Group-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Group-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Group-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/HealthcareService--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/HealthcareService-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/HealthcareService--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/HealthcareService-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/HealthcareService-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/HealthcareService-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ImagingObjectSelection--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ImagingObjectSelection-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ImagingObjectSelection--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ImagingObjectSelection-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ImagingObjectSelection-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ImagingObjectSelection-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ImagingStudy--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ImagingStudy-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ImagingStudy--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ImagingStudy-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ImagingStudy-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ImagingStudy-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Immunization--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Immunization-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Immunization--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Immunization-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Immunization-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Immunization-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ImmunizationRecommendation--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ImmunizationRecommendation-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ImmunizationRecommendation--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ImmunizationRecommendation-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ImmunizationRecommendation-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ImmunizationRecommendation-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ImplementationGuide--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ImplementationGuide-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ImplementationGuide--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ImplementationGuide-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ImplementationGuide-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ImplementationGuide-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/List--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/List-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/List--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/List-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/List-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/List-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Location--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Location-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Location--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Location-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Location-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Location-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Media--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Media-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Media--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Media-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Media-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Media-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Medication--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Medication-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Medication--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Medication-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Medication-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Medication-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/MedicationAdministration--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/MedicationAdministration-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/MedicationAdministration--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/MedicationAdministration-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/MedicationAdministration-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/MedicationAdministration-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/MedicationDispense--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/MedicationDispense-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/MedicationDispense--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/MedicationDispense-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/MedicationDispense-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/MedicationDispense-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/MedicationOrder--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/MedicationOrder-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/MedicationOrder--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/MedicationOrder-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/MedicationOrder-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/MedicationOrder-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/MedicationStatement--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/MedicationStatement-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/MedicationStatement--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/MedicationStatement-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/MedicationStatement-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/MedicationStatement-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/MessageHeader--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/MessageHeader-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/MessageHeader--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/MessageHeader-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/MessageHeader-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/MessageHeader-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/NamingSystem--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/NamingSystem-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/NamingSystem--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/NamingSystem-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/NamingSystem-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/NamingSystem-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/NutritionOrder--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/NutritionOrder-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/NutritionOrder--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/NutritionOrder-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/NutritionOrder-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/NutritionOrder-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Observation--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Observation-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Observation--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Observation-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Observation-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Observation-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/OperationDefinition--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/OperationDefinition-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/OperationDefinition--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/OperationDefinition-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/OperationDefinition-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/OperationDefinition-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/OperationOutcome--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/OperationOutcome-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/OperationOutcome--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/OperationOutcome-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/OperationOutcome-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/OperationOutcome-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Order--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Order-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Order--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Order-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Order-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Order-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/OrderResponse--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/OrderResponse-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/OrderResponse--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/OrderResponse-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/OrderResponse-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/OrderResponse-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Organization--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Organization-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Organization--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Organization-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Organization-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Organization-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Parameters--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Parameters-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Parameters--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Parameters-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Parameters-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Parameters-i-meta-delete" + } + }, + { + "name": "everything", + "definition": { + "reference": "OperationDefinition/Patient--everything" + } + }, + { + "name": "everything", + "definition": { + "reference": "OperationDefinition/Patient-i-everything" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Patient--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Patient-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Patient--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Patient-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Patient-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Patient-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/PaymentNotice--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/PaymentNotice-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/PaymentNotice--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/PaymentNotice-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/PaymentNotice-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/PaymentNotice-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/PaymentReconciliation--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/PaymentReconciliation-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/PaymentReconciliation--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/PaymentReconciliation-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/PaymentReconciliation-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/PaymentReconciliation-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Person--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Person-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Person--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Person-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Person-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Person-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Practitioner--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Practitioner-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Practitioner--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Practitioner-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Practitioner-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Practitioner-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Procedure--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Procedure-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Procedure--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Procedure-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Procedure-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Procedure-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ProcedureRequest--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ProcedureRequest-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ProcedureRequest--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ProcedureRequest-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ProcedureRequest-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ProcedureRequest-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ProcessRequest--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ProcessRequest-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ProcessRequest--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ProcessRequest-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ProcessRequest-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ProcessRequest-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ProcessResponse--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ProcessResponse-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ProcessResponse--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ProcessResponse-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ProcessResponse-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ProcessResponse-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Provenance--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Provenance-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Provenance--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Provenance-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Provenance-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Provenance-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Questionnaire--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Questionnaire-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Questionnaire--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Questionnaire-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Questionnaire-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Questionnaire-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/QuestionnaireResponse--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/QuestionnaireResponse-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/QuestionnaireResponse--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/QuestionnaireResponse-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/QuestionnaireResponse-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/QuestionnaireResponse-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ReferralRequest--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ReferralRequest-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ReferralRequest--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ReferralRequest-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ReferralRequest-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ReferralRequest-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/RelatedPerson--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/RelatedPerson-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/RelatedPerson--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/RelatedPerson-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/RelatedPerson-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/RelatedPerson-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/RiskAssessment--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/RiskAssessment-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/RiskAssessment--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/RiskAssessment-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/RiskAssessment-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/RiskAssessment-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Schedule--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Schedule-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Schedule--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Schedule-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Schedule-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Schedule-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/SearchParameter--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/SearchParameter-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/SearchParameter--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/SearchParameter-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/SearchParameter-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/SearchParameter-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Slot--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Slot-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Slot--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Slot-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Slot-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Slot-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Specimen--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Specimen-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Specimen--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Specimen-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Specimen-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Specimen-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/StructureDefinition--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/StructureDefinition-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/StructureDefinition--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/StructureDefinition-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/StructureDefinition-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/StructureDefinition-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Subscription--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Subscription-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Subscription--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Subscription-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Subscription-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Subscription-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Substance--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Substance-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Substance--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Substance-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Substance-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Substance-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/SupplyDelivery--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/SupplyDelivery-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/SupplyDelivery--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/SupplyDelivery-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/SupplyDelivery-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/SupplyDelivery-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/SupplyRequest--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/SupplyRequest-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/SupplyRequest--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/SupplyRequest-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/SupplyRequest-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/SupplyRequest-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Test--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/Test-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Test--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/Test-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/Test-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/Test-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/TestScript--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/TestScript-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/TestScript--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/TestScript-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/TestScript-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/TestScript-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/User--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/User-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/User--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/User-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/User-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/User-i-meta-delete" + } + }, + { + "name": "validate-code", + "definition": { + "reference": "OperationDefinition/ValueSet-i-validate-code" + } + }, + { + "name": "expand", + "definition": { + "reference": "OperationDefinition/ValueSet-i-expand" + } + }, + { + "name": "lookup", + "definition": { + "reference": "OperationDefinition/ValueSet--lookup" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ValueSet--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/ValueSet-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ValueSet--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/ValueSet-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/ValueSet-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/ValueSet-i-meta-delete" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/VisionPrescription--meta" + } + }, + { + "name": "meta", + "definition": { + "reference": "OperationDefinition/VisionPrescription-i-meta" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/VisionPrescription--validate" + } + }, + { + "name": "validate", + "definition": { + "reference": "OperationDefinition/VisionPrescription-i-validate" + } + }, + { + "name": "meta-add", + "definition": { + "reference": "OperationDefinition/VisionPrescription-i-meta-add" + } + }, + { + "name": "meta-delete", + "definition": { + "reference": "OperationDefinition/VisionPrescription-i-meta-delete" + } + } + ] + } + ] +} diff --git a/lib/modules/us_core_guidance/test/fixtures/r4_provenance.json b/lib/modules/us_core_guidance/test/fixtures/r4_provenance.json new file mode 100644 index 000000000..1029aa9e1 --- /dev/null +++ b/lib/modules/us_core_guidance/test/fixtures/r4_provenance.json @@ -0,0 +1,17 @@ +{ + "resourceType": "Provenance", + "id": "1", + "target": [ + { + "reference": "Patient/1234" + } + ], + "recorded": "2009-10-10T12:00:00-05:00", + "agent": [ + { + "who": { + "reference": "Practitioner/abc" + } + } + ] +} diff --git a/test/sequence/r4_provenance_sequence_test.rb b/lib/modules/us_core_guidance/test/r4_provenance_sequence_test.rb similarity index 98% rename from test/sequence/r4_provenance_sequence_test.rb rename to lib/modules/us_core_guidance/test/r4_provenance_sequence_test.rb index fe7170fb4..ef2e24a86 100644 --- a/test/sequence/r4_provenance_sequence_test.rb +++ b/lib/modules/us_core_guidance/test/r4_provenance_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../test_helper' +require_relative '../../../../test/test_helper' class R4ProvenanceSequenceTest < MiniTest::Test def setup From f715118007241fe44aa2e30474ef7a71e690cbbf Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 1 Nov 2019 07:59:16 -0400 Subject: [PATCH 073/173] move tests from /model to /unit --- test/model/testing_instance_test.rb | 36 ------------------- test/{model => unit}/inferno_test_test.rb | 0 test/{model => unit}/sequence_result_test.rb | 0 .../server_capabilities_test.rb | 0 test/{model => unit}/test_result_test.rb | 0 ...tance_test.rb => testing_instance_test.rb} | 35 +++++++++++++++++- 6 files changed, 34 insertions(+), 37 deletions(-) delete mode 100644 test/model/testing_instance_test.rb rename test/{model => unit}/inferno_test_test.rb (100%) rename test/{model => unit}/sequence_result_test.rb (100%) rename test/{model => unit}/server_capabilities_test.rb (100%) rename test/{model => unit}/test_result_test.rb (100%) rename test/unit/{test_instance_test.rb => testing_instance_test.rb} (75%) diff --git a/test/model/testing_instance_test.rb b/test/model/testing_instance_test.rb deleted file mode 100644 index aa08bb35a..000000000 --- a/test/model/testing_instance_test.rb +++ /dev/null @@ -1,36 +0,0 @@ -# frozen_string_literal: true - -require_relative '../test_helper' -require_relative '../../lib/app/models/testing_instance' - -class TestingInstanceTest < MiniTest::Test - def setup - @patient_id1 = '1' - @patient_id2 = '2' - @testing_instance = Inferno::Models::TestingInstance.new - @testing_instance.resource_references << Inferno::Models::ResourceReference.new( - resource_type: 'Patient', - resource_id: @patient_id1 - ) - @testing_instance.save! - end - - def test_patient_id_assignment - assert(@testing_instance.resource_references.length == 1) - - @testing_instance.patient_id = @patient_id2 - - assert(@testing_instance.patient_id == @patient_id2) - assert(@testing_instance.resource_references.length == 1) - assert(@testing_instance.resource_references.first.resource_id == @patient_id2) - end - - def test_patient_id_reassignment - resource_references = @testing_instance.resource_references - assert(resource_references.length == 1) - - @testing_instance.patient_id = @patient_id1 - - assert(@testing_instance.resource_references == resource_references) - end -end diff --git a/test/model/inferno_test_test.rb b/test/unit/inferno_test_test.rb similarity index 100% rename from test/model/inferno_test_test.rb rename to test/unit/inferno_test_test.rb diff --git a/test/model/sequence_result_test.rb b/test/unit/sequence_result_test.rb similarity index 100% rename from test/model/sequence_result_test.rb rename to test/unit/sequence_result_test.rb diff --git a/test/model/server_capabilities_test.rb b/test/unit/server_capabilities_test.rb similarity index 100% rename from test/model/server_capabilities_test.rb rename to test/unit/server_capabilities_test.rb diff --git a/test/model/test_result_test.rb b/test/unit/test_result_test.rb similarity index 100% rename from test/model/test_result_test.rb rename to test/unit/test_result_test.rb diff --git a/test/unit/test_instance_test.rb b/test/unit/testing_instance_test.rb similarity index 75% rename from test/unit/test_instance_test.rb rename to test/unit/testing_instance_test.rb index e2a0edc6f..16552bada 100644 --- a/test/unit/test_instance_test.rb +++ b/test/unit/testing_instance_test.rb @@ -1,6 +1,7 @@ # frozen_string_literal: true -require File.expand_path '../test_helper.rb', __dir__ +require_relative '../test_helper' +require_relative '../../lib/app/models/testing_instance' describe Inferno::Models::TestingInstance do before do @@ -101,3 +102,35 @@ end end end + +class TestingInstanceTest < MiniTest::Test + def setup + @patient_id1 = '1' + @patient_id2 = '2' + @testing_instance = Inferno::Models::TestingInstance.new + @testing_instance.resource_references << Inferno::Models::ResourceReference.new( + resource_type: 'Patient', + resource_id: @patient_id1 + ) + @testing_instance.save! + end + + def test_patient_id_assignment + assert(@testing_instance.resource_references.length == 1) + + @testing_instance.patient_id = @patient_id2 + + assert(@testing_instance.patient_id == @patient_id2) + assert(@testing_instance.resource_references.length == 1) + assert(@testing_instance.resource_references.first.resource_id == @patient_id2) + end + + def test_patient_id_reassignment + resource_references = @testing_instance.resource_references + assert(resource_references.length == 1) + + @testing_instance.patient_id = @patient_id1 + + assert(@testing_instance.resource_references == resource_references) + end +end From 57c1d73da2902f27d5f2fe5bdb57fecfc4623b6a Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 5 Nov 2019 10:47:01 -0500 Subject: [PATCH 074/173] remove duplicate tests --- .../medication_order_sequence_test.rb | 206 ------------------ .../medication_statement_sequence_test.rb | 152 ------------- test/sequence/patient_read_sequence_test.rb | 107 --------- 3 files changed, 465 deletions(-) delete mode 100644 test/sequence/medication_order_sequence_test.rb delete mode 100644 test/sequence/medication_statement_sequence_test.rb delete mode 100644 test/sequence/patient_read_sequence_test.rb diff --git a/test/sequence/medication_order_sequence_test.rb b/test/sequence/medication_order_sequence_test.rb deleted file mode 100644 index 0b0484eca..000000000 --- a/test/sequence/medication_order_sequence_test.rb +++ /dev/null @@ -1,206 +0,0 @@ -# frozen_string_literal: true - -require_relative '../test_helper' - -# Tests for the Medication Order Sequence -# It makes sure all the sequences pass and ensures no duplicate resource references occur from multiple runs -# Note: This test currently only considers dstu2 -class MedicationOrderSequenceTest < MiniTest::Test - def setup - @patient_id = 1234 - @medication_order_bundle = { - resourceType: 'Bundle', - id: 145, - meta: { - lastUpdated: '2009-10-10T12:00:00-05:00' - }, - type: 'searchset', - link: [ - { - relation: 'self', - url: "http://www.example.com/MedicationOrder?patient=#{@patient_id}" - } - ], - entry: [] - } - - @history_bundle = @medication_order_bundle.deep_dup - @history_bundle[:type] = 'history' - @history_bundle[:total] = 1 - - add_medication_orders_to_bundle(@medication_order_bundle, - [load_json_fixture(:medication_13), - load_json_fixture(:medication_14), - load_json_fixture(:medication_15)]) - - @medication_order_bundle[:total] = @medication_order_bundle[:entry].length - - @medication_reference = load_json_fixture(:medication_reference) - - @patient_resource = FHIR::DSTU2::Patient.new(id: @patient_id) - @practitioner_resource = FHIR::DSTU2::Practitioner.new(id: 432) - - @instance = Inferno::Models::TestingInstance.create( - url: 'http://www.example.com', - client_name: 'Inferno', - base_url: 'http://localhost:4567', - client_endpoint_key: Inferno::SecureRandomBase62.generate(32), - client_id: SecureRandom.uuid, - selected_module: 'argonaut', - oauth_authorize_endpoint: 'http://oauth_reg.example.com/authorize', - oauth_token_endpoint: 'http://oauth_reg.example.com/token', - scopes: 'launch openid patient/*.* profile', - token: 99_897_979 - ) - - # Assume we already have a patient - Inferno::Models::ResourceReference.create( - resource_type: 'Patient', - resource_id: @patient_id, - testing_instance: @instance - ) - - set_resource_support(@instance, 'MedicationOrder') - - client = FHIR::Client.new(@instance.url) - client.use_dstu2 - client.default_json - @sequence = Inferno::Sequence::ArgonautMedicationOrderSequence.new(@instance, client, true) - end - - def add_medication_orders_to_bundle(bundle, med_orders) - ar_med_orders = [med_orders].flatten.compact - ar_med_orders.each do |mo| - bundle[:entry] << { - resource: mo, - fullUrl: "http://www.example.com/#{mo['resourceType']}/#{mo['id']}" - } - end - end - - def stub_get_med_order(med_res) - # Getting Medication, must have Authorization Header - med_res[:entry].each do |resource| - stub_request(:get, resource[:fullUrl]) - .with(headers: { - 'Authorization' => "Bearer #{@instance.token}" - }) - .to_return(status: 200, - body: resource[:resource].to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - end - end - - def stub_history(med_res) - # Getting Medication Resource History, must have Authorization Header - med_res[:entry].each do |resource| - @history_bundle[:entry] = [{ - fullUrl: resource[:fullUrl], - resource: resource[:resource] - }] - - stub_request(:get, resource[:fullUrl] + '/_history') - .with(headers: { - 'Authorization' => "Bearer #{@instance.token}" - }) - .to_return(status: 200, - body: @history_bundle.to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - end - end - - def stub_vread(med_res) - # Getting Medication Resource History, must have Authorization Header - med_res[:entry].each do |resource| - stub_request(:get, resource[:fullUrl] + '/_history/1') - .with(headers: { - 'Authorization' => "Bearer #{@instance.token}" - }) - .to_return(status: 200, - body: resource[:resource].to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - end - end - - def full_sequence_stubs - WebMock.reset! - # Return 401 if no Authorization Header - stub_request(:get, @medication_order_bundle.dig(:link, 0, :url)).to_return(status: 401) - - # Getting Bundle, must have Authorization Header - stub_request(:get, @medication_order_bundle.dig(:link, 0, :url)) - .with(headers: { - 'Authorization' => "Bearer #{@instance.token}" - }) - .to_return(status: 200, - body: @medication_order_bundle.to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - - # Return Medication from a reference - stub_request(:get, %r{example.com/Medication/}) - .with(headers: { - 'Authorization' => "Bearer #{@instance.token}" - }) - .to_return(status: 200, - body: @medication_reference.to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - - # Stub Patient for Reference Resolution Tests - stub_request(:get, %r{example.com/Patient/}) - .with(headers: { - 'Authorization' => "Bearer #{@instance.token}" - }) - .to_return(status: 200, - body: @patient_resource.to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - - # Stub Practitioner for Reference Resolution Tests - stub_request(:get, %r{example.com/Practitioner/}) - .with(headers: { - 'Authorization' => "Bearer #{@instance.token}" - }) - .to_return(status: 200, - body: @practitioner_resource.to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - - stub_get_med_order @medication_order_bundle - stub_history @medication_order_bundle - stub_vread @medication_order_bundle - end - - def test_all_pass - full_sequence_stubs - - sequence_result = @sequence.start - - failures = sequence_result.failures - assert failures.empty?, "All tests should pass. First error: #{!failures.empty? && failures.first.message}" - assert sequence_result.pass?, 'The sequence should be marked as pass.' - end - - def test_no_duplicate_orders - full_sequence_stubs - - sequence_result = @sequence.start - sequence_result.save! - - # Running second sequence... - - # When sequences are rerun with the Sinatra Interface new sequences are created - client = FHIR::Client.new(@instance.url) - client.use_dstu2 - client.default_json - second_instance = Inferno::Models::TestingInstance.get(@instance[:id]) - second_instance.patient_id = @patient_id - second_sequence = Inferno::Sequence::ArgonautMedicationOrderSequence.new(second_instance, client, true) - second_sequence.start - expected_reference_number = @medication_order_bundle[:entry].length + 1 # add one for the patient reference - assert second_instance.resource_references.length == expected_reference_number, - "There should only be #{expected_reference_number} reference resources..." \ - "but #{second_instance.resource_references.length} were found\n" \ - "They are: #{second_instance.resource_references.map do |reference| - reference[:resource_type] + reference[:resource_id] - end.join(', ')} \n" \ - 'Check for duplicates.' - end -end diff --git a/test/sequence/medication_statement_sequence_test.rb b/test/sequence/medication_statement_sequence_test.rb deleted file mode 100644 index 172933dc7..000000000 --- a/test/sequence/medication_statement_sequence_test.rb +++ /dev/null @@ -1,152 +0,0 @@ -# frozen_string_literal: true - -require_relative '../test_helper' - -# Tests for the Medication Order Sequence -# It makes sure all the sequences pass and ensures no duplicate resource references occur from multiple runs -class MedicationStatementSequenceTest < MiniTest::Test - def setup - @medication_statement = FHIR::DSTU2.from_contents(load_fixture(:medication_statement)) - - @medication_statement_bundle = wrap_resources_in_bundle(@medication_statement) - - @medication_statement_bundle.entry.each do |entry| - entry.resource.meta = FHIR::DSTU2::Meta.new unless entry.resource.meta - entry.resource.meta.versionId = '1' - end - - @medication_statement_bundle.link << FHIR::DSTU2::Bundle::Link.new(url: "http://www.example.com/#{@medication_statement.resourceType}?patient=pat1") - - @medication_reference = load_json_fixture(:medication_reference) - - @instance = get_test_instance - - @patient_id = @medication_statement.patient.reference - @patient_id = @patient_id.split('/')[-1] if @patient_id.include?('/') - - @patient_resource = FHIR::DSTU2::Patient.new(id: @patient_id) - @practitioner_resource = FHIR::DSTU2::Practitioner.new(id: 432) - - # Assume we already have a patient - @instance.resource_references << Inferno::Models::ResourceReference.new( - resource_type: 'Patient', - resource_id: @patient_id - ) - - set_resource_support(@instance, 'MedicationStatement') - - @instance.save! # this is for convenience. we could rewrite to ensure nothing gets saved within tests. - - client = get_client(@instance) - - @sequence = Inferno::Sequence::ArgonautMedicationStatementSequence.new(@instance, client) - - @request_headers = { 'Accept' => 'application/json+fhir', - 'Accept-Charset' => 'utf-8', - 'User-Agent' => 'Ruby FHIR Client', - 'Authorization' => "Bearer #{@instance.token}" } - @response_headers = { 'content-type' => 'application/json+fhir' } - end - - def full_sequence_stubs - WebMock.reset! - # Return 401 if no Authorization Header - stub_request(:get, @medication_statement_bundle.link.first.url).to_return(status: 401) - - # Search Resources - uri_template = Addressable::Template.new 'http://www.example.com/MedicationStatement{?patient,target,start,end,userid,agent}' - stub_request(:get, uri_template) - .with(headers: @request_headers) - .to_return( - status: 200, body: @medication_statement_bundle.to_json, headers: @response_headers - ) - - # Read Resources - stub_request(:get, "http://www.example.com/MedicationStatement/#{@medication_statement.id}") - .with(headers: @request_headers) - .to_return(status: 200, - body: @medication_statement.to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - - # history should return a history bundle - stub_request(:get, "http://www.example.com/MedicationStatement/#{@medication_statement.id}/_history") - .with(headers: @request_headers) - .to_return(status: 200, - body: wrap_resources_in_bundle(@medication_statement, type: 'history').to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - - # vread should return an instance - stub_request(:get, "http://www.example.com/MedicationStatement/#{@medication_statement.id}/_history/1") - .with(headers: @request_headers) - .to_return(status: 200, - body: @medication_statement.to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - - # Return Medication from a reference - stub_request(:get, %r{example.com/Medication/}) - .with(headers: { - 'Authorization' => "Bearer #{@instance.token}" - }) - .to_return(status: 200, - body: @medication_reference.to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - - # Stub Patient for Reference Resolution Tests - stub_request(:get, %r{example.com/Patient/}) - .with(headers: { - 'Authorization' => "Bearer #{@instance.token}" - }) - .to_return(status: 200, - body: @patient_resource.to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - - # Stub Practitioner for Reference Resolution Tests - stub_request(:get, %r{example.com/Practitioner/}) - .with(headers: { - 'Authorization' => "Bearer #{@instance.token}" - }) - .to_return(status: 200, - body: @practitioner_resource.to_json, - headers: { content_type: 'application/json+fhir; charset=UTF-8' }) - end - - def test_all_pass - full_sequence_stubs - - sequence_result = @sequence.start - - failures = sequence_result.failures - assert failures.empty?, "All tests should pass. First error: #{!failures.empty? && failures.first.message}" - assert sequence_result.pass?, 'The sequence should be marked as pass.' - assert sequence_result.test_results.all? { |r| r.test_warnings.empty? }, 'There should not be any warnings.' - end - - def test_no_duplicate_orders - # Setup WebMocks - full_sequence_stubs - - # Run First Sequence - sequence_result = @sequence.start - sequence_result.save! - - # Create the second sequence - second_instance = Inferno::Models::TestingInstance.get(@instance[:id]) - second_instance.patient_id = @patient_id - client = get_client(second_instance) - - # Run the sequence again - second_instance = Inferno::Models::TestingInstance.get(@instance[:id]) - second_instance.patient_id = @patient_id - second_sequence = Inferno::Sequence::ArgonautMedicationStatementSequence.new(second_instance, client, true) - second_sequence.start - - expected_reference_number = @medication_statement_bundle.entry.length + 1 # add one for the patient reference - assert second_instance.resource_references.length == expected_reference_number, - "There should only be #{expected_reference_number} reference resources..." \ - "but #{second_instance.resource_references.length} were found\n" \ - "They are: #{second_instance.resource_references.map do |reference| - reference[:resource_type] + reference[:resource_id] - end.join(', ')} \n" \ - 'Check for duplicates.' - end -end diff --git a/test/sequence/patient_read_sequence_test.rb b/test/sequence/patient_read_sequence_test.rb deleted file mode 100644 index cb285ed1d..000000000 --- a/test/sequence/patient_read_sequence_test.rb +++ /dev/null @@ -1,107 +0,0 @@ -# frozen_string_literal: true - -require_relative '../test_helper' - -# Tests for the Patient Read Sequence -# It makes sure all the sequences pass and ensures no duplicate resource references occur from multiple runs -class PatientSequenceTest < MiniTest::Test - def setup - @bundle = FHIR::DSTU2.from_contents(load_fixture(:sample_record)) - @patient = get_resources_from_bundle(@bundle, 'Patient').first - - @bundle.entry.each do |entry| - entry.resource.meta = FHIR::DSTU2::Meta.new unless entry.resource.meta - entry.resource.meta.versionId = '1' - end - - @instance = get_test_instance - - @patient_id = @patient.id - @patient_id = @patient_id.split('/')[-1] if @patient_id.include?('/') - - # Assume we already have a patient - @instance.resource_references << Inferno::Models::ResourceReference.new( - resource_type: 'Patient', - resource_id: @patient_id - ) - - @instance.save! # this is for convenience. we could rewrite to ensure nothing gets saved within tests. - - client = get_client(@instance) - - @sequence = Inferno::Sequence::ArgonautPatientSequence.new(@instance, client) - - @request_headers = { 'Accept' => 'application/json+fhir', - 'Accept-Charset' => 'utf-8', - 'User-Agent' => 'Ruby FHIR Client', - 'Authorization' => "Bearer #{@instance.token}" } - - @history_request_headers = { - 'Accept' => 'application/json+fhir', - 'Accept-Charset' => 'utf-8', - 'User-Agent' => 'Ruby FHIR Client', - 'Authorization' => "Bearer #{@instance.token}", - 'Host' => 'www.example.com', - 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3' - } - @response_headers = { 'content-type' => 'application/json+fhir' } - end - - def full_sequence_stubs - WebMock.reset! - - patient = get_resources_from_bundle(@bundle, 'Patient').first - # Reject requests without authorization, then accept subsequent requests - uri_template = Addressable::Template.new 'http://www.example.com/Patient{?identifier,family,gender,given,birthdate}' - stub_request(:get, "http://www.example.com/Patient/#{@patient_id}") - .to_return( - { status: 401, body: nil, headers: @response_headers }, - status: 200, body: patient.to_json, headers: @response_headers - ) - - stub_request(:get, uri_template) - .to_return( - { status: 401, body: nil, headers: @response_headers }, - status: 200, body: patient.to_json, headers: @response_headers - ) - - patient_bundle = wrap_resources_in_bundle([patient]) - # Search Patient - - stub_request(:get, "http://www.example.com/Patient/#{@patient_id}") - .with(headers: @request_headers) - .to_return( - status: 200, body: patient.to_json, headers: @response_headers - ) - - stub_request(:get, uri_template) - .with(headers: @request_headers) - .to_return( - status: 200, body: patient_bundle.to_json, headers: @response_headers - ) - - # Patient history - patient_history_bundle = wrap_resources_in_bundle([patient]) - patient_history_bundle.type = 'history' - uri_template = Addressable::Template.new "http://www.example.com/Patient/#{@patient_id}/_history" - stub_request(:get, uri_template) - .with(headers: @history_request_headers) - .to_return(status: 200, body: patient_history_bundle.to_json, headers: @response_headers) - - uri_template = Addressable::Template.new "http://www.example.com/Patient/#{@patient_id}/_history/1" - stub_request(:get, uri_template) - .with(headers: @history_request_headers) - .to_return(status: 200, body: patient.to_json, headers: @response_headers) - end - - def test_all_pass - full_sequence_stubs - - sequence_result = @sequence.start - - failures = sequence_result.failures - assert failures.empty?, "All tests should pass. First error: #{!failures.empty? && failures.first.message}" - assert sequence_result.pass?, 'The sequence should be marked as pass.' - assert sequence_result.test_results.all? { |r| r.test_warnings.empty? }, 'There should not be any warnings.' - end -end From b001e47c1a28026b3bb5f10701fdbd2695a58800 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 5 Nov 2019 10:50:06 -0500 Subject: [PATCH 075/173] update .gitattributes --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 516df5c0f..67fa9b319 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -lib/app/modules/uscore_v*/* linguist-generated=true +lib/modules/uscore_v*/* linguist-generated=true resources/terminology/validators/* linguist-generated=true From 251ece12e950325eefaf339ad66aef66c0a290c3 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 5 Nov 2019 10:53:06 -0500 Subject: [PATCH 076/173] fix rebasing error --- .../us_core_patient_read_only_sequence.rb | 130 ------------------ .../us_core_r4_patient_read_only_sequence.rb | 0 2 files changed, 130 deletions(-) delete mode 100644 lib/modules/us_core_guidance/us_core_patient_read_only_sequence.rb rename lib/{app => }/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb (100%) diff --git a/lib/modules/us_core_guidance/us_core_patient_read_only_sequence.rb b/lib/modules/us_core_guidance/us_core_patient_read_only_sequence.rb deleted file mode 100644 index f5bddfafc..000000000 --- a/lib/modules/us_core_guidance/us_core_patient_read_only_sequence.rb +++ /dev/null @@ -1,130 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCoreR4PatientReadOnlySequence < SequenceBase - title 'Patient' - - description 'Verify that Patient resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'ARPA' - - requires :token, :patient_id - conformance_supports :Patient - - test 'Server rejects patient read without proper authorization' do - metadata do - id '01' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' - description %( - A patient read does not work without authorization. - ) - versions :r4 - end - - @client.set_no_auth - skip 'Could not verify this functionality when bearer token is not set' if @instance.token.blank? - - reply = @client.read(versioned_resource_class('Patient'), @instance.patient_id) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Patient read resource' do - metadata do - id '02' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' - description %( - All servers SHALL make available the read interactions for the Argonaut Profiles the server chooses to support. - ) - versions :r4 - end - - patient_read_response = @client.read(versioned_resource_class('Patient'), @instance.patient_id) - assert_response_ok patient_read_response - @patient = patient_read_response.resource - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - end - - test 'Patient validates against Argonaut Profile' do - metadata do - id '03' - link 'http://www.fhir.org/guides/argonaut/r2/Conformance-server.html' - description %( - A server returns valid FHIR Patient resources according to the [Data Access Framework (DAF) Patient Profile](http://www.fhir.org/guides/argonaut/r2/StructureDefinition-argo-patient.html). - ) - versions :r4 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - profile = Inferno::ValidationUtil.guess_profile(@patient, @instance.fhir_version.to_sym) - errors = profile.validate_resource(@patient) - assert errors.empty?, "Patient did not validate against profile: #{errors.join(', ')}" - end - - test 'Patient has address' do - metadata do - id '04' - description %( - Additional Patient resource requirement - ) - versions :r4 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - address = @patient.try(:address).try(:first) - assert !address.nil?, 'Patient address not returned' - end - - test 'Patient has telecom' do - metadata do - id '05' - description %( - Additional Patient resource requirement - ) - versions :r4 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - assert @patient.is_a?(versioned_resource_class('Patient')), 'Expected resource to be valid Patient' - telecom = @patient.try(:telecom).try(:first) - assert !telecom.nil?, 'Patient telecom not returned' - end - - # test 'Patient supports $everything operation' do - - # metadata { - # id '00' - # optional - # description %( - # Additional Patient resource requirement - # ) - # } - # test 'Patient supports $everything operation', '', 'DISCUSSION REQUIRED', :optional do - # everything_response = @client.fetch_patient_record(@instance.patient_id) - # skip_unless [200, 201].include?(everything_response.code) - # @everything = everything_response.resource - # assert !@everything.nil?, 'Expected valid Bundle resource on $everything request' - # assert @everything.is_a?(versioned_resource_class('Bundle')), 'Expected resource to be valid Bundle' - # end - - test 'All references can be resolved' do - metadata do - id '06' - link 'https://www.hl7.org/fhir/r4references.html' - description %( - All references in the Patient resource should be resolveable. - ) - versions :r4 - end - - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - validate_reference_resolutions(@patient) - end - end - end -end diff --git a/lib/app/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb b/lib/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb similarity index 100% rename from lib/app/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb rename to lib/modules/us_core_guidance/us_core_r4_patient_read_only_sequence.rb From 7ce8ab94a7a7306fd662826dead6c4b9b3af3137 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 5 Nov 2019 10:58:30 -0500 Subject: [PATCH 077/173] update rubocop config --- .rubocop.yml | 2 +- .rubocop_todo.yml | 41 +++++++++++++++++------------------------ 2 files changed, 18 insertions(+), 25 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 92eb478b1..d457f9e87 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -19,7 +19,7 @@ Style/SymbolArray: Metrics/LineLength: Exclude: - - 'lib/app/modules/**/*' + - 'lib/modules/**/*' - 'lib/app/helpers/browser_logic.rb' # Use code climate's metrics measurement rather than rubocop's diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e5ea4b131..ff26647d5 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2019-09-26 15:38:33 -0400 using RuboCop version 0.74.0. +# on 2019-11-05 10:58:04 -0500 using RuboCop version 0.74.0. # The point is for the user to remove these configuration records # one by one as the offenses are removed from the code base. # Note that changes in the inspected code, or installation of new @@ -9,19 +9,13 @@ # Offense count: 6 Lint/EmptyWhen: Exclude: - - 'lib/app/modules/argonaut/argonaut_careplan_sequence.rb' - - 'lib/app/modules/argonaut/argonaut_diagnostic_report_sequence.rb' - - 'lib/app/modules/argonaut/argonaut_observation_sequence.rb' - - 'lib/app/modules/argonaut/argonaut_procedure_sequence.rb' - - 'lib/app/modules/argonaut/argonaut_vital_signs_observation_sequence.rb' + - 'lib/modules/argonaut/argonaut_careplan_sequence.rb' + - 'lib/modules/argonaut/argonaut_diagnostic_report_sequence.rb' + - 'lib/modules/argonaut/argonaut_observation_sequence.rb' + - 'lib/modules/argonaut/argonaut_procedure_sequence.rb' + - 'lib/modules/argonaut/argonaut_vital_signs_observation_sequence.rb' - 'lib/tasks/tasks.rake' -# Offense count: 1 -# Configuration parameters: AllowComments. -Lint/HandleExceptions: - Exclude: - - 'lib/app/sequence_base.rb' - # Offense count: 1 Lint/NonLocalExitFromIterator: Exclude: @@ -33,20 +27,19 @@ Lint/ShadowingOuterLocalVariable: - 'lib/app/utils/terminology.rb' - 'lib/app/utils/valueset.rb' -# Offense count: 32 +# Offense count: 36 Metrics/CyclomaticComplexity: Max: 30 -# Offense count: 32 +# Offense count: 19 Style/ClassVars: Exclude: - - 'lib/app/modules/onc_program/onc_ehr_launch_sequence.rb' - - 'lib/app/modules/onc_program/onc_standalone_launch_sequence.rb' - 'lib/app/sequence_base.rb' - 'lib/app/utils/logged_rest_client.rb' - - 'lib/app/utils/terminology.rb' + - 'lib/modules/onc_program/onc_ehr_launch_sequence.rb' + - 'lib/modules/onc_program/onc_standalone_launch_sequence.rb' -# Offense count: 132 +# Offense count: 162 Style/Documentation: Enabled: false @@ -57,12 +50,11 @@ Style/GuardClause: - 'lib/app/utils/tls_tester.rb' - 'lib/app/utils/validation.rb' -# Offense count: 3 +# Offense count: 1 # Cop supports --auto-correct. Style/IfUnlessModifier: Exclude: - 'lib/app/models/testing_instance.rb' - - 'lib/app/utils/assertions.rb' # Offense count: 1 Style/MixinUsage: @@ -79,12 +71,13 @@ Style/MutableConstant: # Offense count: 1 # Cop supports --auto-correct. -# Configuration parameters: AllowAsExpressionSeparator. -Style/Semicolon: +# Configuration parameters: EnforcedStyle, AllowInnerSlashes. +# SupportedStyles: slashes, percent_r, mixed +Style/RegexpLiteral: Exclude: - - 'test/unit/sequence_validation_test.rb' + - 'test/test_helper.rb' -# Offense count: 1064 +# Offense count: 542 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https From 3452e95c9d77dc1f067a445d46db16349c796a5e Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 13 Nov 2019 11:13:25 -0500 Subject: [PATCH 078/173] remove moved fixtures --- .../fixtures/additional_resources_bundle.json | 269 ------------------ test/fixtures/allergy_intolerance.json | 46 --- test/fixtures/care_plan.json | 32 --- test/fixtures/care_team.json | 60 ---- test/fixtures/condition.json | 76 ----- ...fidential_client_dynamic_registration.json | 1 - test/fixtures/device.json | 28 -- test/fixtures/diagnostic_report.json | 34 --- test/fixtures/document_reference.json | 51 ---- test/fixtures/dynamic_registration.json | 1 - test/fixtures/goal.json | 20 -- test/fixtures/immunization.json | 72 ----- test/fixtures/medication.json | 32 --- test/fixtures/medication_13.json | 62 ---- test/fixtures/medication_14.json | 62 ---- test/fixtures/medication_15.json | 55 ---- test/fixtures/medication_order.json | 110 ------- test/fixtures/medication_reference.json | 17 -- test/fixtures/medication_statement.json | 69 ----- test/fixtures/observation.json | 46 --- test/fixtures/openid_configuration.json | 14 - test/fixtures/patient.json | 186 ------------ test/fixtures/procedure.json | 22 -- test/fixtures/provenance.json | 21 -- test/fixtures/r4_provenance.json | 17 -- test/fixtures/smart_configuration.json | 32 --- test/fixtures/smart_metadata.json | 61 ---- test/fixtures/smoking_status.json | 42 --- test/fixtures/standalone_token_exchange.json | 8 - ..._core_r4_clinicalnotes_diagrpt_bundle.json | 177 ------------ ...s_core_r4_clinicalnotes_docref_bundle.json | 162 ----------- test/fixtures/vital_signs_observation.json | 39 --- 32 files changed, 1924 deletions(-) delete mode 100644 test/fixtures/additional_resources_bundle.json delete mode 100644 test/fixtures/allergy_intolerance.json delete mode 100644 test/fixtures/care_plan.json delete mode 100644 test/fixtures/care_team.json delete mode 100644 test/fixtures/condition.json delete mode 100644 test/fixtures/confidential_client_dynamic_registration.json delete mode 100644 test/fixtures/device.json delete mode 100644 test/fixtures/diagnostic_report.json delete mode 100644 test/fixtures/document_reference.json delete mode 100644 test/fixtures/dynamic_registration.json delete mode 100644 test/fixtures/goal.json delete mode 100644 test/fixtures/immunization.json delete mode 100644 test/fixtures/medication.json delete mode 100644 test/fixtures/medication_13.json delete mode 100644 test/fixtures/medication_14.json delete mode 100644 test/fixtures/medication_15.json delete mode 100644 test/fixtures/medication_order.json delete mode 100644 test/fixtures/medication_reference.json delete mode 100644 test/fixtures/medication_statement.json delete mode 100644 test/fixtures/observation.json delete mode 100644 test/fixtures/openid_configuration.json delete mode 100644 test/fixtures/patient.json delete mode 100644 test/fixtures/procedure.json delete mode 100644 test/fixtures/provenance.json delete mode 100644 test/fixtures/r4_provenance.json delete mode 100644 test/fixtures/smart_configuration.json delete mode 100644 test/fixtures/smart_metadata.json delete mode 100644 test/fixtures/smoking_status.json delete mode 100644 test/fixtures/standalone_token_exchange.json delete mode 100644 test/fixtures/us_core_r4_clinicalnotes_diagrpt_bundle.json delete mode 100644 test/fixtures/us_core_r4_clinicalnotes_docref_bundle.json delete mode 100644 test/fixtures/vital_signs_observation.json diff --git a/test/fixtures/additional_resources_bundle.json b/test/fixtures/additional_resources_bundle.json deleted file mode 100644 index 2e9567c82..000000000 --- a/test/fixtures/additional_resources_bundle.json +++ /dev/null @@ -1,269 +0,0 @@ -{ - "resourceType": "Bundle", - "type": "collection", - "entry": [ - { - "resource": { - "resourceType": "Composition", - "id": "example", - "text": { - "status": "generated", - "div": "
    \n\t\t\t

    Consultation note for Henry Levin the 7th

    \n\t\t\t

    Managed by Good Health Clinic

    \n\t\t
    " - }, - "identifier": { - "system": "http://healthintersections.com.au/test", - "value": "1" - }, - "date": "2012-01-04T09:10:14Z", - "type": { - "coding": [ - { - "system": "http://loinc.org", - "code": "11488-4", - "display": "Consult note" - } - ] - }, - "class": { - "coding": [ - { - "system": "http://loinc.org", - "code": "LP173421-1", - "display": "Report" - } - ] - }, - "title": "Consultation Note", - "status": "final", - "confidentiality": "N", - "subject": { - "reference": "Patient/bar", - "display": "Henry Levin the 7th" - }, - "author": [ - { - "reference": "Practitioner/xcda-author", - "display": "Harold Hippocrates, MD" - } - ], - "attester": [ - { - "mode": [ - "legal" - ], - "time": "2012-01-04T09:10:14Z", - "party": { - "reference": "Practitioner/xcda-author", - "display": "Harold Hippocrates, MD" - } - } - ], - "custodian": { - "reference": "Organization/2.16.840.1.113883.19.5", - "display": "Good Health Clinic" - }, - "event": [ - { - "code": [ - { - "coding": [ - { - "system": "http://hl7.org/fhir/v3/ActCode", - "code": "HEALTHREC", - "display": "health record" - } - ] - } - ], - "period": { - "start": "2010-07-18", - "end": "2012-11-12" - }, - "detail": [ - { - "reference": "Observation/example" - } - ] - } - ], - "encounter": { - "reference": "Encounter/xcda" - }, - "section": [ - { - "title": "History of present illness", - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "11348-0", - "display": "History of past illness Narrative" - } - ] - }, - "text": { - "status": "generated", - "div": "
    \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
    \n\t\t\t\t\t\t\tCode\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tDate\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tType\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tBodySite\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tSeverity\n\t\t\t\t\t\t
    Stroke2010-07-18Diagnosis\n\t\t\t\t\t\t\n\t\t\t\t\t
    Burnt Ear2012-05-24DiagnosisLeft Ear\n\t\t\t\t\t
    Asthma2012-11-12Finding\n\t\t\t\t\t\tMild
    \n\t\t\t
    " - }, - "mode": "snapshot", - "orderedBy": { - "coding": [ - { - "system": "http://hl7.org/fhir/list-order", - "code": "event-date", - "display": "Sorted by Event Date" - } - ] - }, - "entry": [ - { - "reference": "Condition/stroke" - }, - { - "reference": "Condition/example" - }, - { - "reference": "Condition/example2" - } - ] - }, - { - "title": "History of family member diseases", - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "10157-6", - "display": "History of family member diseases Narrative" - } - ] - }, - "text": { - "status": "generated", - "div": "
    \n\t\t\t

    History of family member diseases - not available

    \n\t\t\t
    " - }, - "mode": "snapshot", - "emptyReason": { - "coding": [ - { - "system": "http://hl7.org/fhir/list-empty-reason", - "code": "withheld", - "display": "Information Withheld" - } - ] - } - } - ] - } - }, - { - "resource": { - "resourceType": "Provenance", - "id": "example", - "text": { - "status": "generated", - "div": "
    procedure record authored on 27-June 2015 by Harold Hippocrates, MD Content extracted from Referral received 26-June
    " - }, - "target": [ - { - "reference": "Patient/bar" - }, - { - "fhir_comments": [ - " \n where possible, provenance targets should be version specific,\n so that there is no ambiguity about which version of the \n record this relates to\n " - ], - "reference": "Procedure/example/_history/1" - } - ], - "period": { - "start": "2015-06-27", - "end": "2015-07-04" - }, - "recorded": "2015-06-27T08:39:24+10:00", - "reason": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "3457005", - "display": "Referral" - } - ], - "text": "Accepting a referral" - } - ], - "location": { - "reference": "Location/1" - }, - "policy": [ - "http://acme.com/fhir/Consent/25" - ], - "agent": [ - { - "fhir_comments": [ - " author = Harold Hippocrates " - ], - "role": { - "system": "http://hl7.org/fhir/provenance-participant-role", - "code": "author" - }, - "actor": { - "reference": "Practitioner/xcda-author" - }, - "userId": { - "fhir_comments": [ - " very often, the user won't have a known system - these aren't available \n for security system log ons. But where you can define it, you should " - ], - "system": "http://acme.com/fhir/users/sso", - "value": "hhd" - }, - "relatedAgent": [ - { - "type": { - "text": "used" - }, - "target": "#a1" - } - ] - }, - { - "id": "a1", - "fhir_comments": [ - " device = software Harold used " - ], - "role": { - "system": "http://hl7.org/fhir/v3/ParticipationType", - "code": "DEV" - }, - "actor": { - "reference": "Device/software" - } - } - ], - "entity": [ - { - "fhir_comments": [ - " information extract from a CCDA referral document " - ], - "role": "source", - "type": { - "fhir_comments": [ - " this code is extracted from the CDA source document " - ], - "system": "http://loinc.org", - "code": "57133-1", - "display": "Referral note" - }, - "reference": "DocumentReference/90f55916-9d15-4b8f-87a9-2d7ade8670c8", - "_reference": { - "fhir_comments": [ - " \n the document is in an XDS repository. \n as a source, we're going to give an MHD \n reference. (easier than XDS.b call with parameters!)\n\n Note that though this is a URI, so that you can reference\n outside FHIR, you can also put a standard FHIR reference \n here as well\n " - ] - }, - "display": "CDA Document in XDS repository" - } - ] - } - } - ] -} diff --git a/test/fixtures/allergy_intolerance.json b/test/fixtures/allergy_intolerance.json deleted file mode 100644 index c0a4c614a..000000000 --- a/test/fixtures/allergy_intolerance.json +++ /dev/null @@ -1,46 +0,0 @@ - { - "resourceType": "AllergyIntolerance", - "id": "SMART-AllergyIntolerance-28", - "meta": { - "versionId": "3", - "lastUpdated": "2018-01-31T22:43:25.000+00:00" - }, - "text": { - "status": "generated", - "div": "
    Sensitivity to sulfonamide antibacterial
    " - }, - "recordedDate": "2000", - "patient": { - "reference": "Patient/SMART-1288992" - }, - "substance": { - "coding": [ - { - "system": "http://rxnav.nlm.nih.gov/REST/Ndfrt", - "code": "N0000175503", - "display": "sulfonamide antibacterial" - } - ], - "text": "sulfonamide antibacterial" - }, - "status": "confirmed", - "criticality": "CRITL", - "category": "medication", - "reaction": [ - { - "manifestation": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "271807003", - "display": "skin rash" - } - ], - "text": "skin rash" - } - ], - "severity": "mild" - } - ] -} \ No newline at end of file diff --git a/test/fixtures/care_plan.json b/test/fixtures/care_plan.json deleted file mode 100644 index b0ac76b17..000000000 --- a/test/fixtures/care_plan.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "id": "85e027e0-103b-0136-6943-60f81dc2d82a", - "meta": { - "profile": [ - "http://fhir.org/guides/argonaut/StructureDefinition/argo-careplan" - ] - }, - "text": { - "status": "additional", - "div": "This example is modified from the Official Argonaut Implementation Guide at http://www.fhir.org/guides/argonaut/r2/CarePlan-colonoscopy.html" - }, - "subject": { - "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df", - "display": "Mrs. Rhea34 Ernser583" - }, - "status": "active", - "period": { - "start": "2018-03-05", - "end": "2018-03-05" - }, - "category": [ - { - "coding": [ - { - "system": "http://argonaut.hl7.org", - "code": "assess-plan" - } - ] - } - ], - "resourceType": "CarePlan" -} \ No newline at end of file diff --git a/test/fixtures/care_team.json b/test/fixtures/care_team.json deleted file mode 100644 index dba371582..000000000 --- a/test/fixtures/care_team.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "id": "85e027e0-103b-0136-6943-60f81dc2d82a", - "meta": { - "profile": [ - "http://fhir.org/guides/argonaut/StructureDefinition/argo-careteam" - ] - }, - "text": { - "status": "additional", - "div": "This example is modified from the Official Argonaut Implementation Guide at http://www.fhir.org/guides/argonaut/r2/CarePlan-colonoscopy.html" - }, - "subject": { - "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df", - "display": "Mrs. Rhea34 Ernser583" - }, - "status": "active", - "category": [ - { - "coding": [ - { - "system": "http://argonaut.hl7.org/ValueSet/extension-codes", - "code": "careteam" - } - ] - } - ], - "participant": [ - { - "role": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "116154003", - "display": "Patient (person)" - } - ] - }, - "member": { - "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df", - "display": "Mrs. Rhea34 Ernser583" - } - }, - { - "role": { - "coding": [ - { - "system": "http://www.nucc.org", - "code": "207RC0000X", - "display": "Allopathic and Osteopathic Physicians:Internal Medicine:Cardiovascular Disease" - } - ] - }, - "member": { - "reference": "Practitioner/1", - "display": "Dr. Cayr (BMC PCP)" - } - } - ], - "resourceType": "CarePlan" -} \ No newline at end of file diff --git a/test/fixtures/condition.json b/test/fixtures/condition.json deleted file mode 100644 index 8f9e0bddb..000000000 --- a/test/fixtures/condition.json +++ /dev/null @@ -1,76 +0,0 @@ -{ - "resourceType": "Condition", - "id": "f202", - "text": { - "status": "generated", - "div": "

    Generated Narrative with Details

    id: f202

    patient: Roel

    dateRecorded: 01/12/2012

    code: Malignant neoplastic disease (Details : {SNOMED CT code '363346000' = '363346000', given as 'Malignant neoplastic disease'})

    category: Diagnosis (Details : {http://hl7.org/fhir/condition-category code 'diagnosis' = 'Diagnosis)

    clinicalStatus: active

    verificationStatus: confirmed

    severity: Severe (Details : {SNOMED CT code '24484000' = '24484000', given as 'Severe'})

    onset: 52 years (Details: SNOMED CT code 258707000 = '258707000')

    Evidences

    -Detail
    *Erasmus' diagnostic report of Roel's tumor

    bodySite: Entire head and neck (Details : {SNOMED CT code '361355005' = '361355005', given as 'Entire head and neck'})

    " - }, - "patient": { - "reference": "Patient/f201", - "display": "Roel" - }, - "dateRecorded": "2012-12-01", - "_dateRecorded": { - "fhir_comments": [ - " It was not established during an encounter, but through a diagnostic report of december 2012 " - ] - }, - "code": { - "fhir_comments": [ - " The problem was asserted at December first " - ], - "coding": [ - { - "fhir_comments": [ - " The problem is a malignant tumor " - ], - "system": "http://snomed.info/sct", - "code": "363346000", - "display": "Malignant neoplastic disease" - } - ] - }, - "category": { - "coding": [ - { - "system": "http://hl7.org/fhir/condition-category", - "code": "problem" - }, - { - "system": "http://hl7.org/fhir/condition-category", - "code": "health-concern" - } - ] - }, - "clinicalStatus": "active", - "verificationStatus": "confirmed", - "severity": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "24484000", - "display": "Severe" - } - ] - }, - "onsetQuantity": { - "value": 52, - "unit": "years", - "system": "http://snomed.info/sct", - "code": "258707000" - }, - "bodySite": [ - { - "coding": [ - { - "fhir_comments": [ - " Head and neck malignancy " - ], - "system": "http://snomed.info/sct", - "code": "361355005", - "display": "Entire head and neck" - } - ] - } - ] - } \ No newline at end of file diff --git a/test/fixtures/confidential_client_dynamic_registration.json b/test/fixtures/confidential_client_dynamic_registration.json deleted file mode 100644 index 4d72e1d9e..000000000 --- a/test/fixtures/confidential_client_dynamic_registration.json +++ /dev/null @@ -1 +0,0 @@ -{"client_id":"72e731c6-648c-4947-af23-4518a312c845","client_secret":"AIPzBqxIBCA4kaHVzSvQj5QKxSXf1B6lGUgtnGXvCDh_djEA5K-ZKkKadsOPX9pEhGd9XaThjqGqIXulfTgh9gE","client_secret_expires_at":0,"client_id_issued_at":1518316591,"registration_access_token":"eyJraWQiOiJyc2ExIiwiYWxnIjoiUlMyNTYifQ.eyJhdWQiOiI3MmU3MzFjNi02NDhjLTQ5NDctYWYyMy00NTE4YTMxMmM4NDUiLCJpc3MiOiJodHRwczpcL1wvc2ItYXV0aC5zbWFydGhlYWx0aGl0Lm9yZ1wvIiwiaWF0IjoxNTE4MzE2NTkxLCJqdGkiOiI3M2E3MmYyMS1lN2EzLTQyYWYtODc2Ni0yYTM4NWE5NGU2MGUifQ.E3rAYVXltDOkRyLJjUxHct_8AM7O-paxKpLZ3hEkUCXkHfec6zCrnfYYbUfAguJ645Ahl2_avMbI9YxP7oqfYSO_hgxHEoE5MXA_mnp7wjJvwQp_DKlh4OrOvFV8gxyusXTVoP3IBu7VN_kqZKmoV-4QzxaKN9_GqU0YN8SPbgZRgLoawmgLXlwmhjblEufUFjt5mPcQoFsx-hQ15HX3kzb2egPMGNAlv_DMpuHxxIUjRC5NY1_Hz9xI7JlVD4PHetq35m3pc-hleunb45mPH5Bk7gjwShXIPcHHDslWZawKFU3Ho3EGJpB9eGZgvhQ4gSntLvMsJUFJAVbPqxrkgw","registration_client_uri":"https://sb-auth.smarthealthit.org/register/72e731c6-648c-4947-af23-4518a312c845","redirect_uris":["http://localhost:4567/smart/4ffksQ/3mWi7k/redirect"],"client_name":"Inferno","token_endpoint_auth_method":"client_secret_basic","scope":"launch/patient online_access openid profile launch user/*.* patient/*.*","grant_types":["authorization_code"],"response_types":["code"],"initiate_login_uri":"http://localhost:4567/smart/4ffksQ /3mWi7k/launch"} \ No newline at end of file diff --git a/test/fixtures/device.json b/test/fixtures/device.json deleted file mode 100644 index 91f68976e..000000000 --- a/test/fixtures/device.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "id": "8eb18b30-103b-0136-6943-60f81dc2d82a", - "meta": { - "profile": [ - "http://fhir.org/guides/argonaut/StructureDefinition/argo-device" - ] - }, - "text": { - "status": "generated", - "div": "This example is modified from the Official Argonaut Implementation Guide at http://www.fhir.org/guides/argonaut/r2/Device-udi-1.html" - }, - "type": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "468063009", - "display": "Coated femoral stem prosthesis, modular" - } - ] - }, - "status": "available", - "udi": "{01}09504000059118{17}141120{10}7654321D{21}10987654d321", - "patient": { - "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df", - "display": "Mrs. Rhea34 Ernser583" - }, - "resourceType": "Device" -} \ No newline at end of file diff --git a/test/fixtures/diagnostic_report.json b/test/fixtures/diagnostic_report.json deleted file mode 100644 index c725f910b..000000000 --- a/test/fixtures/diagnostic_report.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "id": "00cc87e0-77e9-449b-b713-43c22502cf1f", - "status": "final", - "category": { - "coding": [ - { - "system": "http://hl7.org/fhir/ValueSet/diagnostic-service-sections", - "code": "LAB" - } - ] - }, - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "57698-3", - "display": "Lipid Panel" - } - ], - "text": "Lipid Panel" - }, - "subject": { - "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df" - }, - "encounter": { - "reference": "Encounter/593685e0-ba12-4b0d-9233-7b7772c8cc7e" - }, - "effectiveDateTime": "2010-03-01T15:15:00-05:00", - "issued": "2010-03-01T15:15:00.091-05:00", - "performer": { - "reference": "Practitioner/c82c182f-c49e-4f66-9809-8dc66cb8ffb4" - }, - "resourceType": "DiagnosticReport" -} \ No newline at end of file diff --git a/test/fixtures/document_reference.json b/test/fixtures/document_reference.json deleted file mode 100644 index d23d24fd3..000000000 --- a/test/fixtures/document_reference.json +++ /dev/null @@ -1,51 +0,0 @@ -{ - "resourceType": "DocumentReference", - "id": "1234", - "subject": { - "reference": "Patient/1234" - }, - "status": "current", - "type": { - "coding": [ - { - "system": "http://loinc.org", - "code": "34108-1", - "display": "Outpatient Note" - } - ] - }, - "class": { - "coding": [ - { - "system": "http://ihe.net/xds/connectathon/classCodes", - "code": "History and Physical", - "display": "History and Physical" - } - ] - }, - "author": [ - { - "reference": "Practitioner/abcd" - } - ], - "created": "2005-12-24T09:35:00+11:00", - "indexed": "2005-12-24T09:43:41+11:00", - "content": [ - { - "attachment": { - "contentType": "application/hl7-v3+xml", - "language": "en-US", - "url": "http://example.org/xds/mhd/Binary/07a6483f-732b-461e-86b6-edb665c45510", - "size": 3654, - "hash": "2jmj7l5rSw0yVb/vlWAYkK/YBwk=" - }, - "format": [ - { - "system": "urn:oid:1.3.6.1.4.1.19376.1.2.3", - "code": "urn:ihe:pcc:handp:2008", - "display": "History and Physical Specification" - } - ] - } - ] -} \ No newline at end of file diff --git a/test/fixtures/dynamic_registration.json b/test/fixtures/dynamic_registration.json deleted file mode 100644 index d50e50b79..000000000 --- a/test/fixtures/dynamic_registration.json +++ /dev/null @@ -1 +0,0 @@ -{"client_id":"72e731c6-648c-4947-af23-4518a312c845","client_id_issued_at":1518316591,"registration_access_token":"eyJraWQiOiJyc2ExIiwiYWxnIjoiUlMyNTYifQ.eyJhdWQiOiI3MmU3MzFjNi02NDhjLTQ5NDctYWYyMy00NTE4YTMxMmM4NDUiLCJpc3MiOiJodHRwczpcL1wvc2ItYXV0aC5zbWFydGhlYWx0aGl0Lm9yZ1wvIiwiaWF0IjoxNTE4MzE2NTkxLCJqdGkiOiI3M2E3MmYyMS1lN2EzLTQyYWYtODc2Ni0yYTM4NWE5NGU2MGUifQ.E3rAYVXltDOkRyLJjUxHct_8AM7O-paxKpLZ3hEkUCXkHfec6zCrnfYYbUfAguJ645Ahl2_avMbI9YxP7oqfYSO_hgxHEoE5MXA_mnp7wjJvwQp_DKlh4OrOvFV8gxyusXTVoP3IBu7VN_kqZKmoV-4QzxaKN9_GqU0YN8SPbgZRgLoawmgLXlwmhjblEufUFjt5mPcQoFsx-hQ15HX3kzb2egPMGNAlv_DMpuHxxIUjRC5NY1_Hz9xI7JlVD4PHetq35m3pc-hleunb45mPH5Bk7gjwShXIPcHHDslWZawKFU3Ho3EGJpB9eGZgvhQ4gSntLvMsJUFJAVbPqxrkgw","registration_client_uri":"https://sb-auth.smarthealthit.org/register/72e731c6-648c-4947-af23-4518a312c845","redirect_uris":["http://localhost:4567/smart/4ffksQ/3mWi7k/redirect"],"client_name":"Inferno","token_endpoint_auth_method":"none","scope":"launch/patient online_access openid profile launch user/*.* patient/*.*","grant_types":["authorization_code"],"response_types":["code"],"initiate_login_uri":"http://localhost:4567/smart/4ffksQ /3mWi7k/launch"} \ No newline at end of file diff --git a/test/fixtures/goal.json b/test/fixtures/goal.json deleted file mode 100644 index f080fecbc..000000000 --- a/test/fixtures/goal.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "id": "2ec42e20-1046-0136-6944-60f81dc2d82a", - "meta": { - "profile": [ - "http://fhir.org/guides/argonaut/StructureDefinition/argo-goal" - ] - }, - "text": { - "status": "generated", - "div": "This example is modified from the Official Argonaut Implementation Guide at http://www.fhir.org/guides/argonaut/r2/Goal-goal-1.html" - }, - "subject": { - "reference": "Patient/7ec866ca-4130-4a40-82a9-b67f2626a5df", - "display": "Mrs. Rhea34 Ernser583" - }, - "description": "Patient is targeting a pulse oximetry of 92% and a weight of 195 lbs", - "status": "in-progress", - "statusDate": "2018-03-05", - "resourceType": "Goal" -} diff --git a/test/fixtures/immunization.json b/test/fixtures/immunization.json deleted file mode 100644 index 0c7075283..000000000 --- a/test/fixtures/immunization.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "resourceType": "Immunization", - "id": "example", - "text": { - "status": "generated", - "div": "

    Generated Narrative with Details

    id: example

    identifier: urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234

    status: completed

    date: 10/01/2013

    vaccineCode: Fluvax (Influenza) (Details : {urn:oid:1.2.36.1.2001.1005.17 code 'FLUVAX' = '??)

    patient: Patient/example

    wasNotGiven: false

    reported: false

    performer: Practitioner/example

    requester: Practitioner/example

    encounter: Encounter/example

    manufacturer: Organization/hl7

    location: Location/1

    lotNumber: AAJN11K

    expirationDate: 15/02/2015

    site: left arm (Details : {http://hl7.org/fhir/v3/ActSite code 'LA' = 'left arm', given as 'left arm'})

    route: Injection, intramuscular (Details : {http://hl7.org/fhir/v3/RouteOfAdministration code 'IM' = 'Injection, intramuscular', given as 'Injection, intramuscular'})

    doseQuantity: 5 mg (Details: http://unitsofmeasure.org code mg = '??')

    note: Notes on adminstration of vaccine

    Explanations

    -Reason
    *429060002 (Details : {SNOMED CT code '429060002' = '429060002)

    Reactions

    -DateDetailReported
    *10/01/2013Observation/exampletrue

    VaccinationProtocols

    -DoseSequenceDescriptionAuthoritySeriesSeriesDosesTargetDiseaseDoseStatusDoseStatusReason
    *1Vaccination Protocol Sequence 1Organization/hl7Vaccination Series 121857005 (Details : {SNOMED CT code '1857005' = '1857005)Counts (Details : {http://hl7.org/fhir/vaccination-protocol-dose-status code 'count' = 'Counts', given as 'Counts'})Cold chain break (Details : {http://hl7.org/fhir/vaccination-protocol-dose-status-reason code 'coldchbrk' = 'Cold chain break', given as 'Cold chain break'})
    " - }, - "identifier": [ - { - "system": "urn:ietf:rfc:3986", - "value": "urn:oid:1.3.6.1.4.1.21367.2005.3.7.1234" - } - ], - "status": "completed", - "date": "2013-01-10", - "vaccineCode": { - "coding": [ - { - "system": "urn:oid:1.2.36.1.2001.1005.17", - "code": "FLUVAX" - } - ], - "text": "Fluvax (Influenza)" - }, - "patient": { - "reference": "Patient/example" - }, - "wasNotGiven": false, - "reported": false, - "lotNumber": "AAJN11K", - "expirationDate": "2015-02-15", - "site": { - "coding": [ - { - "system": "http://hl7.org/fhir/v3/ActSite", - "code": "LA", - "display": "left arm" - } - ] - }, - "route": { - "coding": [ - { - "system": "http://hl7.org/fhir/v3/RouteOfAdministration", - "code": "IM", - "display": "Injection, intramuscular" - } - ] - }, - "doseQuantity": { - "value": 5, - "system": "http://unitsofmeasure.org", - "code": "mg" - }, - "note": [ - { - "text": "Notes on adminstration of vaccine" - } - ], - "explanation": { - "reason": [ - { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "429060002" - } - ] - } - ] - } - } \ No newline at end of file diff --git a/test/fixtures/medication.json b/test/fixtures/medication.json deleted file mode 100644 index fcfab8efa..000000000 --- a/test/fixtures/medication.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "resourceType": "Medication", - "id": "medexample003", - "text": { - "fhir_comments": [ - " this example includes a coded Manufactured Medication " - ], - "status": "generated", - "div": "
    Amox S 250 Sus 250mg/5ml
    " - }, - "code": { - "coding": [ - { - "system": "http://hc-sc.gc.ca", - "code": "00885916", - "display": "Amox S 250 Sus 250mg/5ml" - } - ] - }, - "isBrand": true, - "product": { - "form": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "385024007", - "display": "Oral Suspension" - } - ] - } - } - } \ No newline at end of file diff --git a/test/fixtures/medication_13.json b/test/fixtures/medication_13.json deleted file mode 100644 index 66d9732e5..000000000 --- a/test/fixtures/medication_13.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "resourceType": "MedicationOrder", - "id": "13", - "meta": { - "versionId": "1", - "lastUpdated": "2009-10-10T12:00:00-05:00" - }, - "status": "active", - "patient": { - "reference": "Patient/1234" - }, - "prescriber": { - "reference": "Practitioner/432" - }, - "dateWritten": "2015-01-15", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://www.nlm.nih.gov/research/umls/rxnorm", - "code": "314077", - "display": "Lisinopril 20 MG Oral Tablet" - } - ], - "text": "Lisinopril 20 MG Oral Tablet" - }, - "dosageInstruction": [ - { - "text": "1 daily", - "timing": { - "repeat": { - "boundsPeriod": { - "start": "2008-08-13" - }, - "frequency": 1, - "period": 1, - "periodUnits": "d" - } - }, - "doseQuantity": { - "value": 1, - "unit": "{tablet}", - "system": "http://unitsofmeasure.org", - "code": "{tablet}" - } - } - ], - "dispenseRequest": { - "numberOfRepeatsAllowed": 1, - "quantity": { - "value": 90, - "unit": "{tablet}", - "system": "http://unitsofmeasure.org", - "code": "{tablet}" - }, - "expectedSupplyDuration": { - "value": 90, - "unit": "days", - "system": "http://unitsofmeasure.org", - "code": "d" - } - } -} diff --git a/test/fixtures/medication_14.json b/test/fixtures/medication_14.json deleted file mode 100644 index ba955dad3..000000000 --- a/test/fixtures/medication_14.json +++ /dev/null @@ -1,62 +0,0 @@ -{ - "resourceType": "MedicationOrder", - "id": "14", - "meta": { - "versionId": "1", - "lastUpdated": "2009-10-10T12:00:00-05:00" - }, - "status": "active", - "patient": { - "reference": "Patient/1234" - }, - "prescriber": { - "reference": "Practitioner/432" - }, - "dateWritten": "2015-01-15", - "medicationCodeableConcept": { - "coding": [ - { - "system": "http://www.nlm.nih.gov/research/umls/rxnorm", - "code": "404673", - "display": "Memantine 10 MG Oral Tablet [Namenda]" - } - ], - "text": "Memantine 10 MG Oral Tablet [Namenda]" - }, - "dosageInstruction": [ - { - "text": "1 bid", - "timing": { - "repeat": { - "boundsPeriod": { - "start": "2008-08-13" - }, - "frequency": 2, - "period": 1, - "periodUnits": "d" - } - }, - "doseQuantity": { - "value": 1, - "unit": "{tablet}", - "system": "http://unitsofmeasure.org", - "code": "{tablet}" - } - } - ], - "dispenseRequest": { - "numberOfRepeatsAllowed": 1, - "quantity": { - "value": 180, - "unit": "{tablet}", - "system": "http://unitsofmeasure.org", - "code": "{tablet}" - }, - "expectedSupplyDuration": { - "value": 90, - "unit": "days", - "system": "http://unitsofmeasure.org", - "code": "d" - } - } -} \ No newline at end of file diff --git a/test/fixtures/medication_15.json b/test/fixtures/medication_15.json deleted file mode 100644 index db8e20132..000000000 --- a/test/fixtures/medication_15.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "resourceType": "MedicationOrder", - "id": "15", - "meta": { - "versionId": "1", - "lastUpdated": "2009-10-10T12:00:00-05:00" - }, - "status": "active", - "patient": { - "reference": "Patient/1234" - }, - "prescriber": { - "reference": "Practitioner/432" - }, - "dateWritten": "2015-01-15", - "medicationReference": { - "reference": "Medication/Medication15" - }, - "dosageInstruction": [ - { - "text": "1 bid", - "timing": { - "repeat": { - "boundsPeriod": { - "start": "2008-08-13" - }, - "frequency": 2, - "period": 1, - "periodUnits": "d" - } - }, - "doseQuantity": { - "value": 1, - "unit": "{tablet}", - "system": "http://unitsofmeasure.org", - "code": "{tablet}" - } - } - ], - "dispenseRequest": { - "numberOfRepeatsAllowed": 1, - "quantity": { - "value": 180, - "unit": "{tablet}", - "system": "http://unitsofmeasure.org", - "code": "{tablet}" - }, - "expectedSupplyDuration": { - "value": 90, - "unit": "days", - "system": "http://unitsofmeasure.org", - "code": "d" - } - } -} \ No newline at end of file diff --git a/test/fixtures/medication_order.json b/test/fixtures/medication_order.json deleted file mode 100644 index e0a7b7a45..000000000 --- a/test/fixtures/medication_order.json +++ /dev/null @@ -1,110 +0,0 @@ -{ - "resourceType": "MedicationOrder", - "id": "f001", - "text": { - "status": "generated", - "div": "

    Generated Narrative with Details

    id: f001

    identifier: order9837293 (OFFICIAL)

    dateWritten: 25/05/2013 7:32:52 PM

    status: active

    patient: P. van den Heuvel

    prescriber: R.A. van den Berk

    encounter: visit who leads to this priscription

    reason: Chronic obstructive pulmonary disease (Details : {SNOMED CT code '13645005' = '13645005', given as 'Chronic obstructive pulmonary disease'})

    medication: prescribed medication

    DosageInstructions

    -TextAdditionalInstructionsTimingSite[x]RouteDose[x]
    *3 tot 4 maal daags 1 flaconfor use during pregnancy, contact physician (Details )Starting 04/08/2013, Do 3 per 1 days, Until 05/11/2013Entire oral cavity (Details : {SNOMED CT code '181220002' = '181220002', given as 'Entire oral cavity'})oral administration of treatment (Details : {SNOMED CT code '394899003' = '394899003', given as 'oral administration of treatment'})10 ml (Details: http://unitsofmeasure.org code ml = '??')

    DispenseRequests

    -ValidityPeriodNumberOfRepeatsAllowedQuantityExpectedSupplyDuration
    *08/04/2013 --> 30/05/201320100 mcg (Details: urn:oid:2.16.840.1.113883.6.8 code ug = '??')40 days (Details: urn:oid:2.16.840.1.113883.6.8 code d = '??')
    " - }, - "identifier": [ - { - "use": "official", - "system": "http://www.bmc/portal/prescriptions", - "value": "order9837293" - } - ], - "dateWritten": "2013-05-25T19:32:52+01:00", - "status": "active", - "patient": { - "reference": "Patient/f001", - "display": "P. van den Heuvel" - }, - "prescriber": { - "reference": "Practitioner/f006", - "display": "R.A. van den Berk" - }, - "reasonCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "13645005", - "display": "Chronic obstructive pulmonary disease" - } - ] - }, - "medicationReference": { - "reference": "Medication/f001", - "display": "prescribed medication" - }, - "dosageInstruction": [ - { - "text": "3 tot 4 maal daags 1 flacon", - "additionalInstructions": { - "text": "for use during pregnancy, contact physician" - }, - "timing": { - "repeat": { - "boundsPeriod": { - "start": "2013-08-04", - "end": "2013-11-05" - }, - "frequency": 3, - "period": 1, - "periodUnits": "d" - } - }, - "siteCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "181220002", - "display": "Entire oral cavity" - } - ] - }, - "route": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "394899003", - "display": "oral administration of treatment" - } - ] - }, - "doseQuantity": { - "value": 10, - "unit": "ml", - "system": "http://unitsofmeasure.org", - "code": "ml" - } - } - ], - "dispenseRequest": { - "validityPeriod": { - "start": "2013-04-08", - "end": "2013-05-30" - }, - "numberOfRepeatsAllowed": 20, - "quantity": { - "value": 100, - "unit": "mcg", - "system": "urn:oid:2.16.840.1.113883.6.8", - "code": "ug", - "_code": { - "fhir_comments": [ - " http://unitsofmeasure.org (UCUM code system) " - ] - } - }, - "expectedSupplyDuration": { - "value": 40, - "unit": "days", - "system": "urn:oid:2.16.840.1.113883.6.8", - "code": "d", - "_code": { - "fhir_comments": [ - " http://unitsofmeasure.org (UCUM code system) " - ] - } - } - } - } \ No newline at end of file diff --git a/test/fixtures/medication_reference.json b/test/fixtures/medication_reference.json deleted file mode 100644 index 635b411d8..000000000 --- a/test/fixtures/medication_reference.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "resourceType": "Medication", - "id": "Medication15", - "text": { - "status": "generated", - "div": "

    Generated Narrative with Details

    id: medexample015

    contained: ,

    code: Capecitabine 500mg oral tablet (Xeloda) (Details : {RxNorm code '213293' = '213293', given as 'Capecitabine 500mg oral tablet (Xeloda)'})

    isBrand: true

    manufacturer: id: org2; name: Gene Inc

    form: Tablet dose form (qualifier value) (Details : {SNOMED CT code '385055001' = 'Tablet', given as 'Tablet dose form (qualifier value)'})

    Ingredients

    -Item[x]Amount
    *id: sub04; Capecitabine (substance) (Details : {SNOMED CT code '386906001' = 'Capecitabine', given as 'Capecitabine (substance)'})500 mg (Details: UCUM code mg = 'mg')/1 TAB (Details: http://hl7.org/fhir/v3/orderableDrugForm code TAB = 'Tablet')

    package

    container: Bottle - unit of produce usage (qualifier value) (Details : {SNOMED CT code '419672006' = 'Bottle', given as 'Bottle - unit of produce usage (qualifier value)'})

    Contents

    -Item[x]
    *Capecitabine 500mg tablets (product) (Details : {SNOMED CT code '134622004' = 'Capecitabine 500mg tablet', given as 'Capecitabine 500mg tablets (product)'})

    Batches

    -LotNumberExpirationDate
    *949478822/05/2017
    " - }, - "code": { - "coding": [ - { - "system": "http://www.nlm.nih.gov/research/umls/rxnorm", - "code": "213293", - "display": "Capecitabine 500mg oral tablet (Xeloda)" - } - ] - } -} \ No newline at end of file diff --git a/test/fixtures/medication_statement.json b/test/fixtures/medication_statement.json deleted file mode 100644 index 0f769dbd3..000000000 --- a/test/fixtures/medication_statement.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "resourceType": "MedicationStatement", - "id": "example001", - "text": { - "status": "generated", - "div": "
    \n

    Tylenol No 1 tablet - Taking 1 tablet four times daily as needed for pain

    \n
    " - }, - "patient": { - "reference": "Patient/pat1" - }, - "informationSource": { - "reference": "Patient/pat2" - }, - "dateAsserted": "2015-02-22", - "status": "completed", - "wasNotTaken": false, - "reasonForUseCodeableConcept": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "22253000", - "display": "Pain" - } - ] - }, - "effectiveDateTime": "2015-01-23", - "note": "Patient indicates they miss the occasional dose", - "medicationReference": { - "reference": "Medication/MedicationExample7" - }, - "dosage": [ - { - "text": "one tablet four times daily as needed for pain", - "timing": { - "repeat": { - "frequency": 4, - "period": 1, - "periodUnits": "d" - } - }, - "asNeededBoolean": true, - "route": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "260548002", - "display": "Oral" - } - ] - }, - "quantityQuantity": { - "value": 1 - }, - "maxDosePerPeriod": { - "numerator": { - "value": 4, - "unit": "tablets", - "system": "http://snomed.info/sct", - "code": "385055001" - }, - "denominator": { - "value": 1, - "system": "http://unitsofmeasure.org", - "code": "d" - } - } - } - ] -} \ No newline at end of file diff --git a/test/fixtures/observation.json b/test/fixtures/observation.json deleted file mode 100644 index 7871c1fe9..000000000 --- a/test/fixtures/observation.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "id": "a421b98b-5fd7-4595-9a12-486a1aa41e67", - "meta": { - "profile": [ - "http://fhir.org/guides/argonaut/StructureDefinition/argo-observationresults" - ] - }, - "status": "final", - "category": { - "coding": [ - { - "system": "http://hl7.org/fhir/observation-category", - "code": "vital-signs", - "display": "vital-signs" - }, - { - "system": "http://hl7.org/fhir/observation-category", - "code": "laboratory", - "display": "vital-signs" - } - ], - "text": "vital-signs" - }, - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "72166-2", - "display": "Smoking Status" - } - ], - "text": "Smoking Status" - }, - "subject": { - "reference": "Patient/example" - }, - "effectiveDateTime": "2010-03-01", - "issued": "2010-03-01T15:30:10+01:00", - "valueQuantity": { - "value": 150.43678997612926, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - }, - "resourceType": "Observation" -} \ No newline at end of file diff --git a/test/fixtures/openid_configuration.json b/test/fixtures/openid_configuration.json deleted file mode 100644 index 79344b127..000000000 --- a/test/fixtures/openid_configuration.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "registration_endpoint": "https://www.example.com/register", - "token_endpoint": "https://www.example.com/token", - "token_endpoint_auth_methods_supported": ["client_secret_post", "client_secret_basic", "none"], - "jwks_uri": "https://www.example.com/jwk", - "id_token_signing_alg_values_supported": ["HS256", "HS384", "HS512", "RS256", "RS384", "RS512", "none"], - "authorization_endpoint": "https://www.example.com/authorize", - "introspection_endpoint": "https://www.example.com/introspect", - "response_types_supported": ["code"], - "grant_types_supported": ["authorization_code"], - "scopes_supported": ["launch", "openid", "patient/*.*", "profile"], - "userinfo_endpoint": "https://www.example.com/userinfo", - "issuer": "https://www.example.com/" -} diff --git a/test/fixtures/patient.json b/test/fixtures/patient.json deleted file mode 100644 index 61855e512..000000000 --- a/test/fixtures/patient.json +++ /dev/null @@ -1,186 +0,0 @@ -{ - "id": "7ec866ca-4130-4a40-82a9-b67f2626a5df", - "text": { - "status": "generated", - "div": "
    Generated by Synthea.Version identifier: v1.3.1-462-ga4e4ad9\n . Person seed: -6604010938320047939 Population seed: 1521224923924
    " - }, - "extension": [ - { - "url": "http://hl7.org/fhir/StructureDefinition/us-core-race", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://hl7.org/fhir/v3/Race", - "code": "2106-3", - "display": "White" - } - ], - "text": "White" - } - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/us-core-ethnicity", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://hl7.org/fhir/v3/Ethnicity", - "code": "2186-5", - "display": "Not Hispanic or Latino" - } - ], - "text": "Not Hispanic or Latino" - } - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName", - "valueString": "Kimi714 Hermiston71" - }, - { - "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", - "valueCode": "F" - }, - { - "url": "http://hl7.org/fhir/StructureDefinition/birthPlace", - "valueAddress": { - "city": "Mansfield", - "state": "Massachusetts", - "country": "US" - } - }, - { - "url": "http://synthetichealth.github.io/synthea/disability-adjusted-life-years", - "valueDecimal": 1.9189183066996247 - }, - { - "url": "http://synthetichealth.github.io/synthea/quality-adjusted-life-years", - "valueDecimal": 51.081081693300376 - } - ], - "identifier": [ - { - "system": "https://github.com/synthetichealth/synthea", - "value": "10a389cd-3422-4a98-9481-7eceec6118a9" - }, - { - "type": { - "coding": [ - { - "system": "http://hl7.org/fhir/v2/0203", - "code": "MR" - } - ] - }, - "system": "http://hospital.smarthealthit.org", - "value": "10a389cd-3422-4a98-9481-7eceec6118a9" - }, - { - "type": { - "coding": [ - { - "system": "http://hl7.org/fhir/identifier-type", - "code": "SB" - } - ] - }, - "system": "http://hl7.org/fhir/sid/us-ssn", - "value": "999-40-6899" - }, - { - "type": { - "coding": [ - { - "system": "http://hl7.org/fhir/v2/0203", - "code": "DL" - } - ] - }, - "system": "urn:oid:2.16.840.1.113883.4.3.25", - "value": "S99980352" - } - ], - "name": [ - { - "use": "official", - "family": [ - "Ernser583" - ], - "given": [ - "Rhea34" - ], - "prefix": [ - "Mrs." - ] - }, - { - "use": "maiden", - "family": [ - "Marks830" - ], - "given": [ - "Rhea34" - ], - "prefix": [ - "Mrs." - ] - } - ], - "telecom": [ - { - "system": "phone", - "value": "555-317-4311", - "use": "home" - } - ], - "gender": "female", - "birthDate": "1964-02-10", - "address": [ - { - "extension": [ - { - "extension": [ - { - "url": "latitude", - "valueDecimal": -71.281889 - }, - { - "url": "longitude", - "valueDecimal": 42.499295000000004 - } - ], - "url": "http://hl7.org/fhir/StructureDefinition/geolocation" - } - ], - "line": [ - "554 Cummings Lane Suite 22" - ], - "city": "Bedford", - "state": "Massachusetts", - "postalCode": "01730", - "country": "US" - } - ], - "maritalStatus": { - "coding": [ - { - "system": "http://hl7.org/fhir/v3/MaritalStatus", - "code": "M" - } - ] - }, - "multipleBirthBoolean": false, - "communication": [ - { - "language": { - "coding": [ - { - "system": "urn:ietf:bcp:47", - "code": "en-US", - "display": "English" - } - ], - "text": "English" - } - } - ], - "resourceType": "Patient" -} \ No newline at end of file diff --git a/test/fixtures/procedure.json b/test/fixtures/procedure.json deleted file mode 100644 index 82a6a74ce..000000000 --- a/test/fixtures/procedure.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "id": "92134275-3ce9-4867-a2e9-49d712f91a1e", - "subject": { - "reference": "Patient/example" - }, - "status": "completed", - "code": { - "coding": [ - { - "system": "http://snomed.info/sct", - "code": "755621000000101", - "display": "Replacement of subcutaneous contraceptive" - } - ], - "text": "Replacement of subcutaneous contraceptive" - }, - "performedPeriod": { - "start": "2010-08-09", - "end": "2010-08-09" - }, - "resourceType": "Procedure" - } \ No newline at end of file diff --git a/test/fixtures/provenance.json b/test/fixtures/provenance.json deleted file mode 100644 index 2222f3cb3..000000000 --- a/test/fixtures/provenance.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "resourceType": "Provenance", - "id": "1", - "target": [ - { - "reference": "Patient/1234" - } - ], - "recorded": "2009-10-10T12:00:00-05:00", - "agent": [ - { - "role": { - "system": "http://hl7.org/fhir/provenance-participant-role", - "code": "enterer" - }, - "actor": { - "reference": "Practitioner/abc" - } - } - ] -} diff --git a/test/fixtures/r4_provenance.json b/test/fixtures/r4_provenance.json deleted file mode 100644 index 1029aa9e1..000000000 --- a/test/fixtures/r4_provenance.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "resourceType": "Provenance", - "id": "1", - "target": [ - { - "reference": "Patient/1234" - } - ], - "recorded": "2009-10-10T12:00:00-05:00", - "agent": [ - { - "who": { - "reference": "Practitioner/abc" - } - } - ] -} diff --git a/test/fixtures/smart_configuration.json b/test/fixtures/smart_configuration.json deleted file mode 100644 index e03e434c3..000000000 --- a/test/fixtures/smart_configuration.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "authorization_endpoint": "https://www.example.com/authorize", - "token_endpoint": "https://www.example.com/token", - "token_endpoint_auth_methods_supported": ["client_secret_basic"], - "registration_endpoint": "https://www.example.com/register", - "scopes_supported": [ - "openid", - "profile", - "launch", - "launch/patient", - "patient/*.*", - "user/*.*", - "offline_access" - ], - "response_types_supported": ["code", "code id_token", "id_token", "refresh_token"], - "management_endpoint": "https://www.example.com/manage", - "introspection_endpoint": "https://www.example.com/introspect", - "revocation_endpoint": "https://www.example.com/revoke", - "capabilities": [ - "launch-ehr", - "launch-standalone", - "client-public", - "client-confidential-symmetric", - "sso-openid-connect", - "context-ehr-patient", - "context-standalone-patient", - "context-standalone-encounter", - "permission-offline", - "permission-patient", - "permission-user" - ] -} diff --git a/test/fixtures/smart_metadata.json b/test/fixtures/smart_metadata.json deleted file mode 100644 index 3f4a28912..000000000 --- a/test/fixtures/smart_metadata.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "resourceType": "CapabilityStatement", - "publisher": "Not provided", - "date": "2018-02-10T04:02:11+00:00", - "kind": "instance", - "fhirVersion": "4.0.0", - "acceptUnknown": "extensions", - "format": [ - "application/xml+fhir", - "application/json+fhir" - ], - "rest": [ - { - "mode": "server", - "security": { - "extension": [ - { - "url": "http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris", - "extension": [ - { - "url": "authorize", - "valueUri": "https://www.example.com/authorize" - }, - { - "url": "token", - "valueUri": "https://www.example.com/token" - }, - { - "url": "register", - "valueUri": "https://www.example.com/register" - }, - { - "url": "manage", - "valueUri": "https://www.example.com/manage" - }, - { - "url": "introspect", - "valueUri": "https://www.example.com/introspect" - }, - { - "url": "revoke", - "valueUri": "https://www.example.com/revoke" - } - ] - } - ], - "service": [ - { - "coding": [ - { - "system": "http://hl7.org/fhir/restful-security-service", - "code": "SMART-on-FHIR" - } - ], - "text": "OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org)" - } - ] - } - } - ] -} diff --git a/test/fixtures/smoking_status.json b/test/fixtures/smoking_status.json deleted file mode 100644 index 8ede49168..000000000 --- a/test/fixtures/smoking_status.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "id": "1ce7d12f-09eb-49b0-b4c4-7870ce3236b5", - "status": "final", - "category": { - "coding": [ - { - "system": "http://hl7.org/fhir/observation-category", - "code": "72166-2", - "display": "vital-signs" - } - ], - "text": "vital-signs" - }, - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "72166-2", - "display": "Vital Signs" - } - ], - "text": "Vital Signs" - }, - "subject": { - "reference": "7ec866ca-4130-4a40-82a9-b67f2626a5df" - }, - "encounter": { - "reference": "593685e0-ba12-4b0d-9233-7b7772c8cc7e" - }, - "effectiveDateTime": "2010-03-01T15:15:00-05:00", - "issued": "2010-03-01T15:15:00.091-05:00", - "valueCodeableConcept": { - "coding": [ - { - "system": "http://loinc.org", - "code": "29463-7", - "display": "Body weight" - } - ] - }, - "resourceType": "Observation" -} \ No newline at end of file diff --git a/test/fixtures/standalone_token_exchange.json b/test/fixtures/standalone_token_exchange.json deleted file mode 100644 index f3428af0d..000000000 --- a/test/fixtures/standalone_token_exchange.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "access_token":"eyJhbGciOiJSUzI1NiJ9.eyJhdWQiOiIwYWYwNmU5My0zMTJhLTQwZGEtOTlkYS00ZDVjYjUyYzYwZTQiLCJpc3MiOiJodHRwczpcL1wvc2ItYXV0aC5zbWFydGhlYWx0aGl0Lm9yZ1wvIiwiZXhwIjoxNTE4Mzc5MjgzLCJpYXQiOjE1MTgzNzU2ODMsImp0aSI6IjNmMWUwYmJmLWQ2MDMtNGE1Ni04MDEzLTZkYjYxYzVkMWVhNyJ9.iVnDGZD3WgFZu7BMTwNUoZ--xHedHfoeE9EfisGDNsn5qmh8AJfcyyM55v8BgqfQ7szMqdZctOPl4xfJoi5OxQT3SpMfYQ8vPQg1T530YZt5ik6OUP86QpvE0VEEM4cEq1YDHyDl3FsU4oKyb6uJR7PwULiG6Qpij0ydzQdhLrQZpV_hP7_2pyLDnNVT9R7xtCDoo0pxsh4MmCFjrbmgaXohLCl1aqIgCx58LSZnARH_WXYF9345aS63irc_DmyMXlBQbPq31HxHjH80HHajoPs-3oMWZSLuNfDwUZo2GHasLvZYzdWA7gkaolRRLbZDPx9TYXwzfEJ1YwYYulkYFw", - "token_type":"Bearer", - "expires_in":3599, - "scope":"launch/patient online_access openid profile launch user/*.* patient/*.*", - "patient":"783a1f02-5bf9-41c9-90d0-c2c4d35d3ec3", - "id_token":"eyJraWQiOiJyc2ExIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJyc2NhbmxvbkBtaXRyZS5vcmciLCJhdWQiOiIwYWYwNmU5My0zMTJhLTQwZGEtOTlkYS00ZDVjYjUyYzYwZTQiLCJvcmdhbml6YXRpb25OYW1lIjoiOVJ0bzRxd1IwbXNSbEpXbjBpOGxsQll1TEg0ZnZvdE0iLCJkaXNwbGF5TmFtZSI6IlJvYmVydCBTY2FubG9uIiwicHJvZmlsZSI6InN5NjF5dlJnemtxMDZPNUQxbmYwIiwia2lkIjoicnNhMSIsImlzcyI6Imh0dHBzOlwvXC9zYi1hdXRoLnNtYXJ0aGVhbHRoaXQub3JnXC8iLCJleHAiOjE1MTgzNzYyODMsImlhdCI6MTUxODM3NTY4M30.WZxm11AXLguFX8IUPLC_mozfad0s0i_1um09cOfPQ4-GpUSMIFFMx7xt5_qFX5b-lCZKcHC7BBdHdp5Qnbf_azSCjBh9BHG08FcI9Q8OorftP2O5RefTXY1WVHaEbYJcRokBUfwOQYk3PqXmfyVdruxxqMZwF0cCP-EsOSpxGEcPgGqV2zr266vsS2iDUXDVmS1kLZqEPaHqT_v2OkOwZKUy8Gpz1LxY_g48m5RKGblYZjYUIQUBaLov3aDIQQRy6gdtGAyhMbWehe5q8FNsdZvUMOP2761SIieq39Lv0H-54uJnEDWXJJkyWJ17dw3USCqe2X0yRRxflnpLTNXARQ" -} diff --git a/test/fixtures/us_core_r4_clinicalnotes_diagrpt_bundle.json b/test/fixtures/us_core_r4_clinicalnotes_diagrpt_bundle.json deleted file mode 100644 index 96962992e..000000000 --- a/test/fixtures/us_core_r4_clinicalnotes_diagrpt_bundle.json +++ /dev/null @@ -1,177 +0,0 @@ -{ - "resourceType": "Bundle", - "id": "9d89bb92-1bac-498e-99ac-d2dbaa75caed", - "type": "searchset", - "entry": [ - { - "resource": { - "resourceType": "DiagnosticReport", - "id": "SMART-DiagnosticReport-1-note", - "status": "final", - "category": { - "coding": [ - { - "system": "http://loinc.org", - "code": "LP29708-2", - "display": "Cardiology" - } - ] - }, - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "57698-3", - "display": "Lipid Panel" - } - ] - }, - "subject": { - "reference": "Patient/1234" - }, - "presentedForm": [ - { - "contentType": "text/plain", - "url": "/Binary/SMART-Binary-1-note" - } - ] - } - }, - { - "resource": { - "resourceType": "DiagnosticReport", - "id": "SMART-DiagnosticReport-2-note", - "status": "final", - "category": { - "coding": [ - { - "system": "http://loinc.org", - "code": "LP7839-6", - "display": "Pathology" - } - ] - }, - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "57698-3", - "display": "Lipid Panel" - } - ] - }, - "subject": { - "reference": "Patient/1234" - }, - "presentedForm": [ - { - "contentType": "text/plain", - "url": "/Binary/SMART-Binary-2-note" - } - ] - } - }, - { - "resource": { - "resourceType": "DiagnosticReport", - "id": "SMART-DiagnosticReport-3-note", - "status": "final", - "category": { - "coding": [ - { - "system": "http://loinc.org", - "code": "LP29684-5", - "display": "Radiology" - } - ] - }, - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "57698-3", - "display": "Lipid Panel" - } - ] - }, - "subject": { - "reference": "Patient/1234" - }, - "presentedForm": [ - { - "contentType": "text/plain", - "url": "/Binary/SMART-Binary-3-note" - } - ] - } - }, - { - "resource": { - "resourceType": "DiagnosticReport", - "id": "SMART-DiagnosticReport-4-note", - "status": "final", - "category": { - "coding": [ - { - "system": "http://loinc.org", - "code": "LP29708-2", - "display": "Cardiology" - } - ] - }, - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "57698-3", - "display": "Lipid Panel" - } - ] - }, - "subject": { - "reference": "Patient/1234" - }, - "presentedForm": [ - { - "contentType": "text/plain", - "url": "/Binary/SMART-Binary-4-note" - } - ] - } - }, - { - "resource": { - "resourceType": "DiagnosticReport", - "id": "SMART-DiagnosticReport-5-note", - "status": "final", - "category": { - "coding": [ - { - "system": "http://loinc.org", - "code": "LP29708-2", - "display": "Cardiology" - } - ] - }, - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "57698-3", - "display": "Lipid Panel" - } - ] - }, - "subject": { - "reference": "Patient/1234" - }, - "presentedForm": [ - { - "contentType": "text/plain", - "url": "/Binary/SMART-Binary-5-note" - } - ] - } - } - ] - } \ No newline at end of file diff --git a/test/fixtures/us_core_r4_clinicalnotes_docref_bundle.json b/test/fixtures/us_core_r4_clinicalnotes_docref_bundle.json deleted file mode 100644 index 4c3889c0c..000000000 --- a/test/fixtures/us_core_r4_clinicalnotes_docref_bundle.json +++ /dev/null @@ -1,162 +0,0 @@ -{ - "resourceType": "Bundle", - "id": "9d89bb92-1bac-498e-99ac-d2dbaa75caed", - "type": "searchset", - "entry": [ - { - "resource": { - "resourceType": "DocumentReference", - "id": "SMART-DocumentReference-1-note", - "status": "current", - "type": { - "coding": [ - { - "system": "http://loinc.org", - "code": "11488-4", - "display": "Consultation Note" - } - ] - }, - "subject": { - "reference": "Patient/1234" - }, - "content": [ - { - "attachment": { - "contentType": "text/plain", - "url": "/Binary/SMART-Binary-1-note" - } - } - ] - } - }, - { - "resource": { - "resourceType": "DocumentReference", - "id": "SMART-DocumentReference-2-note", - "status": "current", - "type": { - "coding": [ - { - "system": "http://loinc.org", - "code": "18842-5", - "display": "Discharge Summary" - } - ] - }, - "subject": { - "reference": "Patient/1234" - }, - "content": [ - { - "attachment": { - "contentType": "text/plain", - "url": "/Binary/SMART-Binary-2-note" - } - } - ] - } - }, - { - "fullUrl": "https://api.logicahealth.org/InfernoR4yw/open/DocumentReference/SMART-DocumentReference-3-note", - "resource": { - "resourceType": "DocumentReference", - "id": "SMART-DocumentReference-3-note", - "meta": { - "versionId": "1", - "lastUpdated": "2019-03-07T08:52:17.000+00:00" - }, - "text": { - "status": "generated", - "div": "
    Emergency Department Note
    " - }, - "status": "current", - "type": { - "coding": [ - { - "system": "http://loinc.org", - "code": "34117-2", - "display": "History & Physical Note" - } - ], - "text": "Note" - }, - "subject": { - "reference": "Patient/SMART-2169591" - }, - "date": "2006-08-30T00:00:00.000-06:00", - "description": "Emergency Department Note", - "content": [ - { - "attachment": { - "contentType": "text/plain", - "url": "/Binary/SMART-Binary-3-note", - "size": 0 - } - } - ] - }, - "search": { - "mode": "match" - }, - "response": { - "status": "201 Created", - "etag": "W/\"1\"" - } - }, - { - "resource": { - "resourceType": "DocumentReference", - "id": "SMART-DocumentReference-4-note", - "status": "current", - "type": { - "coding": [ - { - "system": "http://loinc.org", - "code": "28570-0", - "display": "Procedures Note" - } - ] - }, - "subject": { - "reference": "Patient/1234" - }, - "content": [ - { - "attachment": { - "contentType": "text/plain", - "url": "/Binary/SMART-Binary-4-note" - } - } - ] - } - }, - { - "resource": { - "resourceType": "DocumentReference", - "id": "SMART-DocumentReference-5-document", - "status": "current", - "type": { - "coding": [ - { - "system": "http://loinc.org", - "code": "11506-3", - "display": "Progress Note" - } - ] - }, - "subject": { - "reference": "Patient/1234" - }, - "content": [ - { - "attachment": { - "contentType": "application/pdf", - "url": "/Binary/SMART-Binary-5-note" - } - } - ] - } - } - ] - } \ No newline at end of file diff --git a/test/fixtures/vital_signs_observation.json b/test/fixtures/vital_signs_observation.json deleted file mode 100644 index 0166aa8b9..000000000 --- a/test/fixtures/vital_signs_observation.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "id": "a421b98b-5fd7-4595-9a12-486a1aa41e67", - "status": "final", - "category": { - "coding": [ - { - "system": "http://hl7.org/fhir/observation-category", - "code": "vital-signs", - "display": "vital-signs" - } - ], - "text": "vital-signs" - }, - "code": { - "coding": [ - { - "system": "http://loinc.org", - "code": "8302-2", - "display": "Body Height" - } - ], - "text": "Body Height" - }, - "subject": { - "reference": "Patient/example" - }, - "encounter": { - "reference": "593685e0-ba12-4b0d-9233-7b7772c8cc7e" - }, - "effectiveDateTime": "2010-03-01", - "issued": "2010-03-01T15:30:10+01:00", - "valueQuantity": { - "value": 150.43678997612926, - "unit": "cm", - "system": "http://unitsofmeasure.org", - "code": "cm" - }, - "resourceType": "Observation" -} \ No newline at end of file From 1f1f118f7c288f0975b68f94ce570c7995f06505 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 29 Oct 2019 10:57:30 -0400 Subject: [PATCH 079/173] add unit test for onc ehr launch --- .../onc_program/onc_ehr_launch_sequence.rb | 3 +- .../onc_ehr_launch_sequence_test.rb | 58 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 test/sequence/onc_program/onc_ehr_launch_sequence_test.rb diff --git a/lib/modules/onc_program/onc_ehr_launch_sequence.rb b/lib/modules/onc_program/onc_ehr_launch_sequence.rb index 688882321..9bcdd5374 100644 --- a/lib/modules/onc_program/onc_ehr_launch_sequence.rb +++ b/lib/modules/onc_program/onc_ehr_launch_sequence.rb @@ -39,9 +39,10 @@ class OncEHRLaunchSequence < EHRLaunchSequence 'Provenance' ] - test 'Scopes enabling user-level access with OpenID Connect and Refresh Token present' do + test :onc_scopes do metadata do id '11' + name 'Scopes enabling user-level access with OpenID Connect and Refresh Token present' link 'http://www.hl7.org/fhir/smart-app-launch/scopes-and-launch-context/index.html#quick-start' description %( The scopes being input must follow the guidelines specified in the smart-app-launch guide diff --git a/test/sequence/onc_program/onc_ehr_launch_sequence_test.rb b/test/sequence/onc_program/onc_ehr_launch_sequence_test.rb new file mode 100644 index 000000000..9dfa56abf --- /dev/null +++ b/test/sequence/onc_program/onc_ehr_launch_sequence_test.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +describe Inferno::Sequence::OncEHRLaunchSequence do + before do + @sequence_class = Inferno::Sequence::OncEHRLaunchSequence + @client = FHIR::Client.new('http://www.example.com/fhir') + @instance = Inferno::Models::TestingInstance.new + @required_scopes = ['openid', 'fhirUser', 'launch', 'offline_access'] + end + + describe 'ONC scopes test' do + before do + @test = @sequence_class[:onc_scopes] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'fails when a required scope is missing' do + @required_scopes.each do |scope| + scopes = @required_scopes - [scope] + @instance.instance_variable_set(:'@scopes', scopes.join(' ')) + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal %(Scope did not include "#{scope}"), exception.message + end + end + + it 'fails when there is no user-level scope' do + @instance.instance_variable_set(:'@scopes', @required_scopes.join(' ')) + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Must contain a user-level scope in the format: user/[ resource | * ].[ read | *].', exception.message + end + + it 'fails when there is a badly formatted scope' do + bad_scopes = ['user/*/*', 'patient/*.read', 'user/*.*.*', 'user/*.write'] + bad_scopes.each do |scope| + @instance.instance_variable_set(:'@scopes', (@required_scopes + [scope]).join(' ')) + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "Scope '#{scope}' does not follow the format: user/[ resource | * ].[ read | * ]", exception.message + end + + bad_resource_type = 'ValueSet' + @instance.instance_variable_set(:'@scopes', (@required_scopes + ["user/#{bad_resource_type}.*"]).join(' ')) + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "'#{bad_resource_type}' must be either a valid resource type or '*'", exception.message + end + + it 'succeeds when the required scopes and a user-level scope are present' do + @instance.instance_variable_set(:'@scopes', (@required_scopes + ['user/*.*']).join(' ')) + + @sequence.run_test(@test) + end + end +end From f040e37de097eac4dc431302afd7a096adcaafc1 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 29 Oct 2019 11:13:30 -0400 Subject: [PATCH 080/173] add unit test for onc standalone launch --- .../onc_standalone_launch_sequence.rb | 3 +- .../onc_standalone_launch_sequence_test.rb | 58 +++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 test/sequence/onc_program/onc_standalone_launch_sequence_test.rb diff --git a/lib/modules/onc_program/onc_standalone_launch_sequence.rb b/lib/modules/onc_program/onc_standalone_launch_sequence.rb index bc6bcfbb0..71991cccb 100644 --- a/lib/modules/onc_program/onc_standalone_launch_sequence.rb +++ b/lib/modules/onc_program/onc_standalone_launch_sequence.rb @@ -39,9 +39,10 @@ class OncStandaloneLaunchSequence < StandaloneLaunchSequence 'Provenance' ] - test 'Patient-level access with OpenID Connect and Refresh Token scopes used.' do + test :onc_scopes do metadata do id '09' + name 'Patient-level access with OpenID Connect and Refresh Token scopes used.' link 'http://www.hl7.org/fhir/smart-app-launch/scopes-and-launch-context/index.html#quick-start' description %( The scopes being input must follow the guidelines specified in the smart-app-launch guide diff --git a/test/sequence/onc_program/onc_standalone_launch_sequence_test.rb b/test/sequence/onc_program/onc_standalone_launch_sequence_test.rb new file mode 100644 index 000000000..247b6bd11 --- /dev/null +++ b/test/sequence/onc_program/onc_standalone_launch_sequence_test.rb @@ -0,0 +1,58 @@ +# frozen_string_literal: true + +require_relative '../../test_helper' + +describe Inferno::Sequence::OncStandaloneLaunchSequence do + before do + @sequence_class = Inferno::Sequence::OncStandaloneLaunchSequence + @client = FHIR::Client.new('http://www.example.com/fhir') + @instance = Inferno::Models::TestingInstance.new + @required_scopes = ['openid', 'fhirUser', 'launch/patient', 'offline_access'] + end + + describe 'ONC scopes test' do + before do + @test = @sequence_class[:onc_scopes] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'fails when a required scope is missing' do + @required_scopes.each do |scope| + scopes = @required_scopes - [scope] + @instance.instance_variable_set(:'@scopes', scopes.join(' ')) + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal %(Scope did not include "#{scope}"), exception.message + end + end + + it 'fails when there is no patient-level scope' do + @instance.instance_variable_set(:'@scopes', @required_scopes.join(' ')) + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Must contain a patient-level scope in the format: patient/[ resource | * ].[ read | *].', exception.message + end + + it 'fails when there is a badly formatted scope' do + bad_scopes = ['patient/*/*', 'user/*.read', 'patient/*.*.*', 'patient/*.write'] + bad_scopes.each do |scope| + @instance.instance_variable_set(:'@scopes', (@required_scopes + [scope]).join(' ')) + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "Scope '#{scope}' does not follow the format: patient/[ resource | * ].[ read | * ]", exception.message + end + + bad_resource_type = 'ValueSet' + @instance.instance_variable_set(:'@scopes', (@required_scopes + ["patient/#{bad_resource_type}.*"]).join(' ')) + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "'#{bad_resource_type}' must be either a valid resource type or '*'", exception.message + end + + it 'succeeds when the required scopes and a patient-level scope are present' do + @instance.instance_variable_set(:'@scopes', (@required_scopes + ['patient/*.*']).join(' ')) + + @sequence.run_test(@test) + end + end +end From b4ee6a5afc7380f4f4537bb88e1d7a294967d3b1 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 29 Oct 2019 11:23:26 -0400 Subject: [PATCH 081/173] refactor onc launch sequences --- .../onc_program/onc_ehr_launch_sequence.rb | 77 +++++++++++-------- .../onc_standalone_launch_sequence.rb | 76 ++++++++++-------- .../onc_ehr_launch_sequence_test.rb | 15 ++-- .../onc_standalone_launch_sequence_test.rb | 15 ++-- 4 files changed, 99 insertions(+), 84 deletions(-) diff --git a/lib/modules/onc_program/onc_ehr_launch_sequence.rb b/lib/modules/onc_program/onc_ehr_launch_sequence.rb index 9bcdd5374..295a88eb7 100644 --- a/lib/modules/onc_program/onc_ehr_launch_sequence.rb +++ b/lib/modules/onc_program/onc_ehr_launch_sequence.rb @@ -17,27 +17,34 @@ class OncEHRLaunchSequence < EHRLaunchSequence defines :token, :id_token, :refresh_token, :patient_id - @@resource_types = [ - 'Patient', - 'AllergyIntolerance', - 'CarePlan', - 'Condition', - 'Device', - 'DiagnosticReport', - 'DocumentReference', - 'Encounter', - 'ExplanationOfBenefit', - 'Goal', - 'Immunization', - 'Medication', - 'MedicationDispense', - 'MedicationStatement', - 'MedicationOrder', - 'Observation', - 'Procedure', - 'DocumentReference', - 'Provenance' - ] + def valid_resource_types + [ + '*', + 'Patient', + 'AllergyIntolerance', + 'CarePlan', + 'Condition', + 'Device', + 'DiagnosticReport', + 'DocumentReference', + 'Encounter', + 'ExplanationOfBenefit', + 'Goal', + 'Immunization', + 'Medication', + 'MedicationDispense', + 'MedicationStatement', + 'MedicationOrder', + 'Observation', + 'Procedure', + 'DocumentReference', + 'Provenance' + ] + end + + def required_scopes + ['openid', 'fhirUser', 'launch', 'offline_access'] + end test :onc_scopes do metadata do @@ -48,33 +55,35 @@ class OncEHRLaunchSequence < EHRLaunchSequence The scopes being input must follow the guidelines specified in the smart-app-launch guide ) end + scopes = @instance.scopes.split(' ') - assert scopes.include?('openid'), 'Scope did not include "openid"' - scopes.delete('openid') - assert scopes.include?('fhirUser'), 'Scope did not include "fhirUser"' - scopes.delete('fhirUser') - assert scopes.include?('launch'), 'Scope did not include "launch"' - scopes.delete('launch') - assert scopes.include?('offline_access'), 'Scope did not include "offline_access"' - scopes.delete('offline_access') + missing_scopes = required_scopes - scopes + assert missing_scopes.empty?, "Required scopes missing: #{missing_scopes.join(', ')}" + scopes -= required_scopes # Other 'okay' scopes scopes.delete('online_access') user_scope_found = false scopes.each do |scope| + bad_format_message = "Scope '#{scope}' does not follow the format: user/[ resource | * ].[ read | * ]" scope_pieces = scope.split('/') - assert scope_pieces.count == 2, "Scope '#{scope}' does not follow the format: user/[ resource | * ].[ read | * ]" - assert scope_pieces[0] == 'user', "Scope '#{scope}' does not follow the format: user/[ resource | * ].[ read | * ]" + + assert scope_pieces.count == 2, bad_format_message + assert scope_pieces[0] == 'user', bad_format_message + resource_access = scope_pieces[1].split('.') - assert resource_access.count == 2, "Scope '#{scope}' does not follow the format: user/[ resource | * ].[ read | * ]" - assert resource_access[0] == '*' || @@resource_types.include?(resource_access[0]), "'#{resource_access[0]}' must be either a valid resource type or '*'" - assert resource_access[1] =~ /^(\*|read)/, "Scope '#{scope}' does not follow the format: user/[ resource | * ].[ read | * ]" + bad_resource_message = "'#{resource_access[0]}' must be either a valid resource type or '*'" + + assert resource_access.count == 2, bad_format_message + assert valid_resource_types.include?(resource_access[0]), bad_resource_message + assert resource_access[1] =~ /^(\*|read)/, bad_format_message user_scope_found = true end + assert user_scope_found, 'Must contain a user-level scope in the format: user/[ resource | * ].[ read | *].' end end diff --git a/lib/modules/onc_program/onc_standalone_launch_sequence.rb b/lib/modules/onc_program/onc_standalone_launch_sequence.rb index 71991cccb..463f5e370 100644 --- a/lib/modules/onc_program/onc_standalone_launch_sequence.rb +++ b/lib/modules/onc_program/onc_standalone_launch_sequence.rb @@ -17,27 +17,34 @@ class OncStandaloneLaunchSequence < StandaloneLaunchSequence defines :token, :id_token, :refresh_token, :patient_id - @@resource_types = [ - 'Patient', - 'AllergyIntolerance', - 'Encounter', - 'CarePlan', - 'Condition', - 'Device', - 'DiagnosticReport', - 'DocumentReference', - 'ExplanationOfBenefit', - 'Goal', - 'Immunization', - 'Medication', - 'MedicationDispense', - 'MedicationStatement', - 'MedicationOrder', - 'Observation', - 'Procedure', - 'DocumentReference', - 'Provenance' - ] + def valid_resource_types + [ + '*', + 'Patient', + 'AllergyIntolerance', + 'Encounter', + 'CarePlan', + 'Condition', + 'Device', + 'DiagnosticReport', + 'DocumentReference', + 'ExplanationOfBenefit', + 'Goal', + 'Immunization', + 'Medication', + 'MedicationDispense', + 'MedicationStatement', + 'MedicationOrder', + 'Observation', + 'Procedure', + 'DocumentReference', + 'Provenance' + ] + end + + def required_scopes + ['openid', 'fhirUser', 'launch/patient', 'offline_access'] + end test :onc_scopes do metadata do @@ -48,30 +55,31 @@ class OncStandaloneLaunchSequence < StandaloneLaunchSequence The scopes being input must follow the guidelines specified in the smart-app-launch guide ) end + scopes = @instance.scopes.split(' ') - assert scopes.include?('openid'), 'Scope did not include "openid"' - scopes.delete('openid') - assert scopes.include?('fhirUser'), 'Scope did not include "fhirUser"' - scopes.delete('fhirUser') - assert scopes.include?('launch/patient'), 'Scope did not include "launch/patient"' - scopes.delete('launch/patient') - assert scopes.include?('offline_access'), 'Scope did not include "offline_access"' - scopes.delete('offline_access') + missing_scopes = required_scopes - scopes + assert missing_scopes.empty?, "Required scopes missing: #{missing_scopes.join(', ')}" + scopes -= required_scopes # Other 'okay' scopes scopes.delete('online_access') patient_scope_found = false scopes.each do |scope| + bad_format_message = "Scope '#{scope}' does not follow the format: patient/[ resource | * ].[ read | * ]" scope_pieces = scope.split('/') - assert scope_pieces.count == 2, "Scope '#{scope}' does not follow the format: patient/[ resource | * ].[ read | * ]" - assert scope_pieces[0] == 'patient', "Scope '#{scope}' does not follow the format: patient/[ resource | * ].[ read | * ]" + + assert scope_pieces.count == 2, bad_format_message + assert scope_pieces[0] == 'patient', bad_format_message + resource_access = scope_pieces[1].split('.') - assert resource_access.count == 2, "Scope '#{scope}' does not follow the format: patient/[ resource | * ].[ read | * ]" - assert resource_access[0] == '*' || @@resource_types.include?(resource_access[0]), "'#{resource_access[0]}' must be either a valid resource type or '*'" - assert resource_access[1] =~ /^(\*|read)/, "Scope '#{scope}' does not follow the format: patient/[ resource | * ].[ read | * ]" + bad_resource_message = "'#{resource_access[0]}' must be either a valid resource type or '*'" + + assert resource_access.count == 2, bad_format_message + assert valid_resource_types.include?(resource_access[0]), bad_resource_message + assert resource_access[1] =~ /^(\*|read)/, bad_format_message patient_scope_found = true end diff --git a/test/sequence/onc_program/onc_ehr_launch_sequence_test.rb b/test/sequence/onc_program/onc_ehr_launch_sequence_test.rb index 9dfa56abf..638cf8929 100644 --- a/test/sequence/onc_program/onc_ehr_launch_sequence_test.rb +++ b/test/sequence/onc_program/onc_ehr_launch_sequence_test.rb @@ -7,7 +7,6 @@ @sequence_class = Inferno::Sequence::OncEHRLaunchSequence @client = FHIR::Client.new('http://www.example.com/fhir') @instance = Inferno::Models::TestingInstance.new - @required_scopes = ['openid', 'fhirUser', 'launch', 'offline_access'] end describe 'ONC scopes test' do @@ -17,17 +16,17 @@ end it 'fails when a required scope is missing' do - @required_scopes.each do |scope| - scopes = @required_scopes - [scope] + @sequence.required_scopes.each do |scope| + scopes = @sequence.required_scopes - [scope] @instance.instance_variable_set(:'@scopes', scopes.join(' ')) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal %(Scope did not include "#{scope}"), exception.message + assert_equal "Required scopes missing: #{scope}", exception.message end end it 'fails when there is no user-level scope' do - @instance.instance_variable_set(:'@scopes', @required_scopes.join(' ')) + @instance.instance_variable_set(:'@scopes', @sequence.required_scopes.join(' ')) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } assert_equal 'Must contain a user-level scope in the format: user/[ resource | * ].[ read | *].', exception.message @@ -36,21 +35,21 @@ it 'fails when there is a badly formatted scope' do bad_scopes = ['user/*/*', 'patient/*.read', 'user/*.*.*', 'user/*.write'] bad_scopes.each do |scope| - @instance.instance_variable_set(:'@scopes', (@required_scopes + [scope]).join(' ')) + @instance.instance_variable_set(:'@scopes', (@sequence.required_scopes + [scope]).join(' ')) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } assert_equal "Scope '#{scope}' does not follow the format: user/[ resource | * ].[ read | * ]", exception.message end bad_resource_type = 'ValueSet' - @instance.instance_variable_set(:'@scopes', (@required_scopes + ["user/#{bad_resource_type}.*"]).join(' ')) + @instance.instance_variable_set(:'@scopes', (@sequence.required_scopes + ["user/#{bad_resource_type}.*"]).join(' ')) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } assert_equal "'#{bad_resource_type}' must be either a valid resource type or '*'", exception.message end it 'succeeds when the required scopes and a user-level scope are present' do - @instance.instance_variable_set(:'@scopes', (@required_scopes + ['user/*.*']).join(' ')) + @instance.instance_variable_set(:'@scopes', (@sequence.required_scopes + ['user/*.*']).join(' ')) @sequence.run_test(@test) end diff --git a/test/sequence/onc_program/onc_standalone_launch_sequence_test.rb b/test/sequence/onc_program/onc_standalone_launch_sequence_test.rb index 247b6bd11..003f50184 100644 --- a/test/sequence/onc_program/onc_standalone_launch_sequence_test.rb +++ b/test/sequence/onc_program/onc_standalone_launch_sequence_test.rb @@ -7,7 +7,6 @@ @sequence_class = Inferno::Sequence::OncStandaloneLaunchSequence @client = FHIR::Client.new('http://www.example.com/fhir') @instance = Inferno::Models::TestingInstance.new - @required_scopes = ['openid', 'fhirUser', 'launch/patient', 'offline_access'] end describe 'ONC scopes test' do @@ -17,17 +16,17 @@ end it 'fails when a required scope is missing' do - @required_scopes.each do |scope| - scopes = @required_scopes - [scope] + @sequence.required_scopes.each do |scope| + scopes = @sequence.required_scopes - [scope] @instance.instance_variable_set(:'@scopes', scopes.join(' ')) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal %(Scope did not include "#{scope}"), exception.message + assert_equal "Required scopes missing: #{scope}", exception.message end end it 'fails when there is no patient-level scope' do - @instance.instance_variable_set(:'@scopes', @required_scopes.join(' ')) + @instance.instance_variable_set(:'@scopes', @sequence.required_scopes.join(' ')) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } assert_equal 'Must contain a patient-level scope in the format: patient/[ resource | * ].[ read | *].', exception.message @@ -36,21 +35,21 @@ it 'fails when there is a badly formatted scope' do bad_scopes = ['patient/*/*', 'user/*.read', 'patient/*.*.*', 'patient/*.write'] bad_scopes.each do |scope| - @instance.instance_variable_set(:'@scopes', (@required_scopes + [scope]).join(' ')) + @instance.instance_variable_set(:'@scopes', (@sequence.required_scopes + [scope]).join(' ')) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } assert_equal "Scope '#{scope}' does not follow the format: patient/[ resource | * ].[ read | * ]", exception.message end bad_resource_type = 'ValueSet' - @instance.instance_variable_set(:'@scopes', (@required_scopes + ["patient/#{bad_resource_type}.*"]).join(' ')) + @instance.instance_variable_set(:'@scopes', (@sequence.required_scopes + ["patient/#{bad_resource_type}.*"]).join(' ')) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } assert_equal "'#{bad_resource_type}' must be either a valid resource type or '*'", exception.message end it 'succeeds when the required scopes and a patient-level scope are present' do - @instance.instance_variable_set(:'@scopes', (@required_scopes + ['patient/*.*']).join(' ')) + @instance.instance_variable_set(:'@scopes', (@sequence.required_scopes + ['patient/*.*']).join(' ')) @sequence.run_test(@test) end From 41c78f0d0e2c8293d0d7bc86938e92286542962d Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 12 Nov 2019 10:56:47 -0500 Subject: [PATCH 082/173] add missing US Core resources --- lib/modules/onc_program/onc_ehr_launch_sequence.rb | 11 +++++++---- .../onc_program/onc_standalone_launch_sequence.rb | 13 ++++++++----- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lib/modules/onc_program/onc_ehr_launch_sequence.rb b/lib/modules/onc_program/onc_ehr_launch_sequence.rb index 295a88eb7..232fdfad3 100644 --- a/lib/modules/onc_program/onc_ehr_launch_sequence.rb +++ b/lib/modules/onc_program/onc_ehr_launch_sequence.rb @@ -23,21 +23,24 @@ def valid_resource_types 'Patient', 'AllergyIntolerance', 'CarePlan', + 'CareTeam', 'Condition', 'Device', 'DiagnosticReport', 'DocumentReference', 'Encounter', - 'ExplanationOfBenefit', 'Goal', 'Immunization', + 'Location', 'Medication', - 'MedicationDispense', - 'MedicationStatement', 'MedicationOrder', + 'MedicationRequest', + 'MedicationStatement', 'Observation', + 'Organization', + 'Practitioner', + 'PractitionerRole', 'Procedure', - 'DocumentReference', 'Provenance' ] end diff --git a/lib/modules/onc_program/onc_standalone_launch_sequence.rb b/lib/modules/onc_program/onc_standalone_launch_sequence.rb index 463f5e370..276fc43c2 100644 --- a/lib/modules/onc_program/onc_standalone_launch_sequence.rb +++ b/lib/modules/onc_program/onc_standalone_launch_sequence.rb @@ -22,22 +22,25 @@ def valid_resource_types '*', 'Patient', 'AllergyIntolerance', - 'Encounter', 'CarePlan', + 'CareTeam', 'Condition', 'Device', 'DiagnosticReport', 'DocumentReference', - 'ExplanationOfBenefit', + 'Encounter', 'Goal', 'Immunization', + 'Location', 'Medication', - 'MedicationDispense', - 'MedicationStatement', 'MedicationOrder', + 'MedicationRequest', + 'MedicationStatement', 'Observation', + 'Organization', + 'Practitioner', + 'PractitionerRole', 'Procedure', - 'DocumentReference', 'Provenance' ] end From e75e33a87c8afb0e997591723fe40656c08421c8 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 13 Nov 2019 12:03:18 -0500 Subject: [PATCH 083/173] move sequence tests to new location --- .../argonaut/argonaut_patient_read_only_sequence_unit_test.rb | 0 .../modules}/onc_program/onc_ehr_launch_sequence_test.rb | 0 .../modules}/onc_program/onc_standalone_launch_sequence_test.rb | 0 .../us_core_r4_patient_read_only_sequence_test.rb | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {test/sequence => lib/modules}/argonaut/argonaut_patient_read_only_sequence_unit_test.rb (100%) rename {test/sequence => lib/modules}/onc_program/onc_ehr_launch_sequence_test.rb (100%) rename {test/sequence => lib/modules}/onc_program/onc_standalone_launch_sequence_test.rb (100%) rename {test/sequence => lib/modules}/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb (100%) diff --git a/test/sequence/argonaut/argonaut_patient_read_only_sequence_unit_test.rb b/lib/modules/argonaut/argonaut_patient_read_only_sequence_unit_test.rb similarity index 100% rename from test/sequence/argonaut/argonaut_patient_read_only_sequence_unit_test.rb rename to lib/modules/argonaut/argonaut_patient_read_only_sequence_unit_test.rb diff --git a/test/sequence/onc_program/onc_ehr_launch_sequence_test.rb b/lib/modules/onc_program/onc_ehr_launch_sequence_test.rb similarity index 100% rename from test/sequence/onc_program/onc_ehr_launch_sequence_test.rb rename to lib/modules/onc_program/onc_ehr_launch_sequence_test.rb diff --git a/test/sequence/onc_program/onc_standalone_launch_sequence_test.rb b/lib/modules/onc_program/onc_standalone_launch_sequence_test.rb similarity index 100% rename from test/sequence/onc_program/onc_standalone_launch_sequence_test.rb rename to lib/modules/onc_program/onc_standalone_launch_sequence_test.rb diff --git a/test/sequence/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb b/lib/modules/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb similarity index 100% rename from test/sequence/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb rename to lib/modules/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb From 7303127dc3b3cd8e7cce4092b0d749434bdc4079 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 14 Nov 2019 10:16:04 -0500 Subject: [PATCH 084/173] move tests to test subdirectory --- ...ut_patient_read_only_sequence_unit_test.rb | 91 ------------------- ...rgonaut_patient_read_only_sequence_test.rb | 89 ++++++++++++++++++ .../onc_ehr_launch_sequence_test.rb | 2 +- .../onc_standalone_launch_sequence_test.rb | 2 +- ...core_r4_patient_read_only_sequence_test.rb | 2 +- 5 files changed, 92 insertions(+), 94 deletions(-) delete mode 100644 lib/modules/argonaut/argonaut_patient_read_only_sequence_unit_test.rb rename lib/modules/onc_program/{ => test}/onc_ehr_launch_sequence_test.rb (97%) rename lib/modules/onc_program/{ => test}/onc_standalone_launch_sequence_test.rb (97%) rename lib/modules/us_core_guidance/{ => test}/us_core_r4_patient_read_only_sequence_test.rb (98%) diff --git a/lib/modules/argonaut/argonaut_patient_read_only_sequence_unit_test.rb b/lib/modules/argonaut/argonaut_patient_read_only_sequence_unit_test.rb deleted file mode 100644 index f30727918..000000000 --- a/lib/modules/argonaut/argonaut_patient_read_only_sequence_unit_test.rb +++ /dev/null @@ -1,91 +0,0 @@ -# frozen_string_literal: true - -require_relative '../../test_helper' - -describe Inferno::Sequence::ArgonautPatientReadOnlySequence do - before do - @base_url = 'http://www.example.com/fhir' - @token = 'ABC' - @patient_id = '123' - @sequence_class = Inferno::Sequence::ArgonautPatientReadOnlySequence - @client = FHIR::Client.new(@base_url) - @client.set_bearer_token(@token) - @instance = Inferno::Models::TestingInstance.create - @instance.patient_id = @patient_id - end - - describe 'unauthenticated read test' do - before do - @test = @sequence_class[:unauthenticated_read] - @sequence = @sequence_class.new(@instance, @client) - end - - it 'skips if no token is set' do - assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } - end - - it 'fails when the server does not return a 401' do - @instance.token = 'ABC' - stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") - .to_return(status: 200) - - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - assert_equal exception.message, 'Bad response code: expected 401, but found 200' - end - - it 'succeeds when the server returns a 401' do - @instance.token = @token - stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") - .to_return(status: 401) - - @sequence.run_test(@test) - end - end - - describe 'authenticated read test' do - before do - @test = @sequence_class[:authenticated_read] - @sequence = @sequence_class.new(@instance, @client) - @instance.token = @token - end - - it 'fails when the server does not return a 200' do - stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") - .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) - .to_return(status: 202) - - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - assert_equal exception.message, 'Bad response code: expected 200, 201, but found 202. ' - end - - it 'fails when the server does not return a FHIR resource' do - stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") - .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) - .to_return(status: 200) - - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - assert_equal exception.message, 'Expected response to be a Patient resource' - end - - it 'fails when the server does not return a Patient Resource' do - stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") - .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) - .to_return(status: 200, body: FHIR::DSTU2::Condition.new.to_json) - - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - assert_equal exception.message, 'Expected response to be a Patient resource' - end - - it 'succeeds when the server returns a Patient Resource' do - stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") - .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) - .to_return(status: 200, body: FHIR::DSTU2::Patient.new.to_json) - - @sequence.run_test(@test) - end - end -end diff --git a/lib/modules/argonaut/test/argonaut_patient_read_only_sequence_test.rb b/lib/modules/argonaut/test/argonaut_patient_read_only_sequence_test.rb index dd3b84599..508b42fff 100644 --- a/lib/modules/argonaut/test/argonaut_patient_read_only_sequence_test.rb +++ b/lib/modules/argonaut/test/argonaut_patient_read_only_sequence_test.rb @@ -1,6 +1,95 @@ # frozen_string_literal: true require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::ArgonautPatientReadOnlySequence do + before do + @base_url = 'http://www.example.com/fhir' + @token = 'ABC' + @patient_id = '123' + @sequence_class = Inferno::Sequence::ArgonautPatientReadOnlySequence + @client = FHIR::Client.new(@base_url) + @client.set_bearer_token(@token) + @instance = Inferno::Models::TestingInstance.create + @instance.patient_id = @patient_id + end + + describe 'unauthenticated read test' do + before do + @test = @sequence_class[:unauthenticated_read] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips if no token is set' do + assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + end + + it 'fails when the server does not return a 401' do + @instance.token = 'ABC' + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Bad response code: expected 401, but found 200' + end + + it 'succeeds when the server returns a 401' do + @instance.token = @token + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .to_return(status: 401) + + @sequence.run_test(@test) + end + end + + describe 'authenticated read test' do + before do + @test = @sequence_class[:authenticated_read] + @sequence = @sequence_class.new(@instance, @client) + @instance.token = @token + end + + it 'fails when the server does not return a 200' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 202) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Bad response code: expected 200, 201, but found 202. ' + end + + it 'fails when the server does not return a FHIR resource' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Expected response to be a Patient resource' + end + + it 'fails when the server does not return a Patient Resource' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 200, body: FHIR::DSTU2::Condition.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal exception.message, 'Expected response to be a Patient resource' + end + + it 'succeeds when the server returns a Patient Resource' do + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(headers: { 'Authorization' => "Bearer #{@instance.token}" }) + .to_return(status: 200, body: FHIR::DSTU2::Patient.new.to_json) + + @sequence.run_test(@test) + end + end +end + class ArgonautPatientReadOnlySequenceTest < MiniTest::Test def setup @instance = get_test_instance diff --git a/lib/modules/onc_program/onc_ehr_launch_sequence_test.rb b/lib/modules/onc_program/test/onc_ehr_launch_sequence_test.rb similarity index 97% rename from lib/modules/onc_program/onc_ehr_launch_sequence_test.rb rename to lib/modules/onc_program/test/onc_ehr_launch_sequence_test.rb index 638cf8929..685b9ddab 100644 --- a/lib/modules/onc_program/onc_ehr_launch_sequence_test.rb +++ b/lib/modules/onc_program/test/onc_ehr_launch_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' describe Inferno::Sequence::OncEHRLaunchSequence do before do diff --git a/lib/modules/onc_program/onc_standalone_launch_sequence_test.rb b/lib/modules/onc_program/test/onc_standalone_launch_sequence_test.rb similarity index 97% rename from lib/modules/onc_program/onc_standalone_launch_sequence_test.rb rename to lib/modules/onc_program/test/onc_standalone_launch_sequence_test.rb index 003f50184..0e0282a9e 100644 --- a/lib/modules/onc_program/onc_standalone_launch_sequence_test.rb +++ b/lib/modules/onc_program/test/onc_standalone_launch_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' describe Inferno::Sequence::OncStandaloneLaunchSequence do before do diff --git a/lib/modules/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb b/lib/modules/us_core_guidance/test/us_core_r4_patient_read_only_sequence_test.rb similarity index 98% rename from lib/modules/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb rename to lib/modules/us_core_guidance/test/us_core_r4_patient_read_only_sequence_test.rb index 3e3fc0234..deac48d80 100644 --- a/lib/modules/us_core_guidance/us_core_r4_patient_read_only_sequence_test.rb +++ b/lib/modules/us_core_guidance/test/us_core_r4_patient_read_only_sequence_test.rb @@ -1,6 +1,6 @@ # frozen_string_literal: true -require_relative '../../test_helper' +require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCoreR4PatientReadOnlySequence do before do From 50fe4522d745d693b2199f0a52d09a32c9b170de Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Mon, 4 Nov 2019 13:33:21 -0500 Subject: [PATCH 085/173] misc fixes --- lib/app/sequence_base.rb | 3 +-- lib/app/utils/assertions.rb | 15 +++------------ test/support/sequence_coverage_reporting.rb | 4 ++-- 3 files changed, 6 insertions(+), 16 deletions(-) diff --git a/lib/app/sequence_base.rb b/lib/app/sequence_base.rb index f86fbef30..c54443c47 100644 --- a/lib/app/sequence_base.rb +++ b/lib/app/sequence_base.rb @@ -453,8 +453,7 @@ def warning @test_warnings << e.message end - def get_resource_by_params(klass, params = {}) - assert !params.empty?, 'No params for search' + def get_resource_by_params(klass, params) options = { search: { flag: false, diff --git a/lib/app/utils/assertions.rb b/lib/app/utils/assertions.rb index 704d884bd..eeefd402d 100644 --- a/lib/app/utils/assertions.rb +++ b/lib/app/utils/assertions.rb @@ -49,18 +49,9 @@ def assert_response_bad(response) end def assert_bundle_response(response) - message = "Expected FHIR Bundle but found: #{resource_class(response)}" - assert response.resource.class.name.demodulize == 'Bundle', message - end - - def resource_class(response) - resource = - begin - resource_from_contents(response.body) - rescue StandardError - nil - end - resource.class.name.demodulize + class_name = response.resource.class.name.demodulize + message = "Expected FHIR Bundle but found: #{class_name}" + assert class_name == 'Bundle', message end def base_header(header) diff --git a/test/support/sequence_coverage_reporting.rb b/test/support/sequence_coverage_reporting.rb index 64b1c5ec6..f8108e3ee 100644 --- a/test/support/sequence_coverage_reporting.rb +++ b/test/support/sequence_coverage_reporting.rb @@ -75,8 +75,8 @@ def add_assertion_call(result) end class AssertionCallLocationFormatter - SEQUENCE_LINE_REGEX = %r{inferno/lib/(modules/\w+/\w+\.rb:\d+)}.freeze - LINE_REGEX = %r{inferno/lib/((?:\w+/?)+\.rb:\d+)}.freeze + SEQUENCE_LINE_REGEX = %r{inferno/lib/(modules/[\w\.]+/\w+\.rb:\d+)}.freeze + LINE_REGEX = %r{inferno/lib/((?:[\w\.]+/?)+\.rb:\d+)}.freeze ASSERTION_CALL_REGEX = %r{inferno/lib/app/utils/assertions.rb:\d+}.freeze CALL_SEPARATOR = ' => ' From 0cc393ee00d475ff83b52a871ccdc10f333e27b2 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Mon, 4 Nov 2019 13:33:48 -0500 Subject: [PATCH 086/173] make unit tests for first two US Core Patient Sequence tests --- .../uscore_v3.1.0/us_core_patient_sequence.rb | 6 +- .../sequence/us_core_patient_sequence_test.rb | 120 ++++++++++++++++++ 2 files changed, 124 insertions(+), 2 deletions(-) create mode 100644 test/sequence/us_core_patient_sequence_test.rb diff --git a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb index 6a51582d3..375f19970 100644 --- a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb @@ -63,9 +63,10 @@ def validate_resource_item(resource, property, value) @resources_found = false - test 'Server rejects Patient search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Patient search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -80,9 +81,10 @@ def validate_resource_item(resource, property, value) assert_response_unauthorized reply end - test 'Server returns expected results from Patient search by _id' do + test :id_search do metadata do id '02' + name 'Server returns expected results from Patient search by _id' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) diff --git a/test/sequence/us_core_patient_sequence_test.rb b/test/sequence/us_core_patient_sequence_test.rb new file mode 100644 index 000000000..e080e3da4 --- /dev/null +++ b/test/sequence/us_core_patient_sequence_test.rb @@ -0,0 +1,120 @@ +# frozen_string_literal: true + +require_relative '../test_helper' + +describe Inferno::Sequence::USCore301PatientSequence do + before do + @sequence_class = Inferno::Sequence::USCore301PatientSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: { _id: @patient_id }) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "Bad response code: expected 401 or 406, but found 200", exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: { _id: @patient_id }) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end + + describe 'id search test' do + before do + @test = @sequence_class[:id_search] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'fails when the search response has a status other than 200' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message + end + + it 'fails when a resource other than a bundle is returned' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "Expected FHIR Bundle but found: Patient", exception.message + end + + it 'skips the test if no results are found' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + .to_return(status: 200, body: FHIR::Bundle.new.to_json) + + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No resources appear to be available for this patient. Please use patients with more information.', exception.message + end + + # TODO: fix non-determinism of TestingInstance#patient_id + # + # it 'fails when the patient id does not match the requested id' do + # @instance.patient_id = @patient_id + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + # .to_return(status: 200, body: wrap_resources_in_bundle(FHIR::Patient.new(id: 'ID')).to_json) + + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + # assert_equal 'Server returned nil patient', exception.message + # end + + it 'fails when the Patient resource is invalid' do + bad_patient = FHIR::Patient.new(id: @patient_id) + bad_patient.gender = 'BAD_GENDER' + stub_request(:get, "#{@base_url}/Patient") + .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + .to_return(status: 200, body: wrap_resources_in_bundle(bad_patient).to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert exception.message.start_with? 'Invalid Patient:' + end + + it 'succeeds whan a patient with the correct ID is returned' do + patient = FHIR::Patient.new(id: @patient_id) + @sequence.instance_variable_set(:'@patient', patient) + stub_request(:get, "#{@base_url}/Patient") + .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + .to_return(status: 200, body: wrap_resources_in_bundle(patient).to_json) + + @sequence.run_test(@test) + end + end +end From 78c1d32134b5b45051a5a226a506991b8f54856b Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Mon, 4 Nov 2019 15:46:25 -0500 Subject: [PATCH 087/173] make unit tests for third US Core Patient Sequence test --- .../uscore_v3.1.0/us_core_patient_sequence.rb | 3 +- .../sequence/us_core_patient_sequence_test.rb | 126 ++++++++++++++++-- 2 files changed, 119 insertions(+), 10 deletions(-) diff --git a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb index 375f19970..bcd9783ac 100644 --- a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb @@ -109,9 +109,10 @@ def validate_resource_item(resource, property, value) validate_search_reply(versioned_resource_class('Patient'), reply, search_params) end - test 'Server returns expected results from Patient search by identifier' do + test :identifier_search do metadata do id '03' + name 'Server returns expected results from Patient search by identifier' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) diff --git a/test/sequence/us_core_patient_sequence_test.rb b/test/sequence/us_core_patient_sequence_test.rb index e080e3da4..2653946fb 100644 --- a/test/sequence/us_core_patient_sequence_test.rb +++ b/test/sequence/us_core_patient_sequence_test.rb @@ -11,17 +11,19 @@ @instance = Inferno::Models::TestingInstance.create(token: @token) @patient_id = '123' @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } end describe 'unauthorized search test' do before do @test = @sequence_class[:unauthorized_search] @sequence = @sequence_class.new(@instance, @client) + @query = { _id: @patient_id } end it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Patient") - .with(query: { _id: @patient_id }) + .with(query: @query) .to_return(status: 200) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } @@ -31,7 +33,7 @@ it 'succeeds when the token refresh response has an error status' do stub_request(:get, "#{@base_url}/Patient") - .with(query: { _id: @patient_id }) + .with(query: @query) .to_return(status: 401) @sequence.run_test(@test) @@ -50,11 +52,12 @@ before do @test = @sequence_class[:id_search] @sequence = @sequence_class.new(@instance, @client) + @query = { _id: @patient_id } end it 'fails when the search response has a status other than 200' do stub_request(:get, "#{@base_url}/Patient") - .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + .with(query: @query, headers: @auth_header) .to_return(status: 401) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } @@ -64,7 +67,7 @@ it 'fails when a resource other than a bundle is returned' do stub_request(:get, "#{@base_url}/Patient") - .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + .with(query: @query, headers: @auth_header) .to_return(status: 200, body: FHIR::Patient.new.to_json) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } @@ -74,7 +77,7 @@ it 'skips the test if no results are found' do stub_request(:get, "#{@base_url}/Patient") - .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + .with(query: @query, headers: @auth_header) .to_return(status: 200, body: FHIR::Bundle.new.to_json) exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } @@ -84,10 +87,10 @@ # TODO: fix non-determinism of TestingInstance#patient_id # - # it 'fails when the patient id does not match the requested id' do + # it 'fails when the Patient id does not match the requested id' do # @instance.patient_id = @patient_id # stub_request(:get, "#{@base_url}/Patient") - # .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + # .with(query: @query, headers: @auth_header) # .to_return(status: 200, body: wrap_resources_in_bundle(FHIR::Patient.new(id: 'ID')).to_json) # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } @@ -99,7 +102,7 @@ bad_patient = FHIR::Patient.new(id: @patient_id) bad_patient.gender = 'BAD_GENDER' stub_request(:get, "#{@base_url}/Patient") - .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + .with(query: @query, headers: @auth_header) .to_return(status: 200, body: wrap_resources_in_bundle(bad_patient).to_json) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } @@ -111,10 +114,115 @@ patient = FHIR::Patient.new(id: @patient_id) @sequence.instance_variable_set(:'@patient', patient) stub_request(:get, "#{@base_url}/Patient") - .with(query: { _id: @patient_id }, headers: { authorization: "Bearer #{@token}"}) + .with(query: @query, headers: @auth_header) .to_return(status: 200, body: wrap_resources_in_bundle(patient).to_json) @sequence.run_test(@test) end end + + describe 'identifier search test' do + before do + @test = @sequence_class[:identifier_search] + @sequence = @sequence_class.new(@instance, @client) + @identifier_value = 'ABC' + @identifier_system = 'http://www.example.com' + @patient = FHIR::Patient.new( + id: @patient_id, + identifier: [{ system: @identifier_system, value: @identifier_value }] + ) + @query = { identifier: @identifier_value } + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@patient', @patient) + @sequence.instance_variable_set(:'@patient_ary', [@patient]) + end + + it 'skips when no resources have been found' do + @sequence.instance_variable_set(:'@resources_found', false) + + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No resources appear to be available for this patient. Please use patients with more information.', exception.message + end + + it 'skips when none of the resources have an identifier' do + @sequence.instance_variable_set(:'@patient_ary', [FHIR::Patient.new]) + + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'Could not resolve identifier in given resource', exception.message + end + + it 'fails when no Patient resource has been found' do + @sequence.instance_variable_set(:'@patient', nil) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected valid Patient resource to be present', exception.message + end + + it 'fails when the search response has a status other than 200' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message + end + + it 'fails when a resource other than a bundle is returned' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "Expected FHIR Bundle but found: Patient", exception.message + end + + it 'fails when no results are found' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Bundle.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'No resources of this type were returned', exception.message + end + + it 'fails when a Patient identifier does not match the requested identifier' do + # @instance.patient_id = @patient_id + patient = FHIR::Patient.new( + id: '456', + identifier: [{ system: @identifier_system, value: 'DEF' }] + ) + stub_request(:get, "#{@base_url}/Patient") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: wrap_resources_in_bundle([@patient, patient]).to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'identifier on resource does not match identifier requested', exception.message + end + + it 'fails when the Patient resource is invalid' do + @patient.gender = 'BAD_GENDER' + stub_request(:get, "#{@base_url}/Patient") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: wrap_resources_in_bundle(@patient).to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert exception.message.start_with? 'Invalid Patient:' + end + + it 'succeeds whan a Patient with the correct identifier is returned' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: wrap_resources_in_bundle(@patient).to_json) + + @sequence.run_test(@test) + end + end end From 0dc3f6a2c5a21d6d07b60a90fa8d7fa6bd869f37 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 12 Nov 2019 15:01:06 -0500 Subject: [PATCH 088/173] update tests based on changes in development branch --- .../sequence/us_core_patient_sequence_test.rb | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/test/sequence/us_core_patient_sequence_test.rb b/test/sequence/us_core_patient_sequence_test.rb index 2653946fb..4920b79b6 100644 --- a/test/sequence/us_core_patient_sequence_test.rb +++ b/test/sequence/us_core_patient_sequence_test.rb @@ -28,7 +28,7 @@ exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Bad response code: expected 401 or 406, but found 200", exception.message + assert_equal "Bad response code: expected 401, but found 200", exception.message end it 'succeeds when the token refresh response has an error status' do @@ -85,18 +85,16 @@ assert_equal 'No resources appear to be available for this patient. Please use patients with more information.', exception.message end - # TODO: fix non-determinism of TestingInstance#patient_id - # - # it 'fails when the Patient id does not match the requested id' do - # @instance.patient_id = @patient_id - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: wrap_resources_in_bundle(FHIR::Patient.new(id: 'ID')).to_json) + it 'fails when the Patient id does not match the requested id' do + @instance.patient_id = @patient_id + stub_request(:get, "#{@base_url}/Patient") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: wrap_resources_in_bundle(FHIR::Patient.new(id: 'ID')).to_json) - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - # assert_equal 'Server returned nil patient', exception.message - # end + assert_equal '_id on resource does not match _id requested', exception.message + end it 'fails when the Patient resource is invalid' do bad_patient = FHIR::Patient.new(id: @patient_id) From 8c02aff205d0df75ac52a09965271f6f4c037de5 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 13 Nov 2019 08:38:23 -0500 Subject: [PATCH 089/173] refactor generator search param generation --- generator/uscore/templates/sequence.rb.erb | 13 +- generator/uscore/uscore_generator.rb | 67 ++- .../us_core_allergyintolerance_sequence.rb | 213 +++++++++ .../us_core_careplan_sequence.rb | 288 ++++++++++++ .../us_core_careteam_sequence.rb | 187 ++++++++ .../us_core_condition_sequence.rb | 305 ++++++++++++ .../uscore_v3.0.0/us_core_device_sequence.rb | 214 +++++++++ .../us_core_documentreference_sequence.rb | 383 +++++++++++++++ .../us_core_encounter_sequence.rb | 367 +++++++++++++++ .../uscore_v3.0.0/us_core_goal_sequence.rb | 252 ++++++++++ .../us_core_immunization_sequence.rb | 253 ++++++++++ .../us_core_location_sequence.rb | 302 ++++++++++++ .../us_core_medication_sequence.rb | 124 +++++ .../us_core_medicationrequest_sequence.rb | 264 +++++++++++ .../us_core_medicationstatement_sequence.rb | 275 +++++++++++ .../us_core_organization_sequence.rb | 227 +++++++++ .../uscore_v3.0.0/us_core_patient_sequence.rb | 375 +++++++++++++++ .../us_core_practitioner_sequence.rb | 223 +++++++++ .../us_core_practitionerrole_sequence.rb | 246 ++++++++++ .../pediatric_bmi_for_age_sequence.rb | 350 ++++++++++++++ .../pediatric_weight_for_height_sequence.rb | 350 ++++++++++++++ .../us_core_diagnosticreport_lab_sequence.rb | 440 ++++++++++++++++++ .../us_core_diagnosticreport_note_sequence.rb | 439 +++++++++++++++++ .../us_core_observation_lab_sequence.rb | 340 ++++++++++++++ .../us_core_procedure_sequence.rb | 294 ++++++++++++ .../us_core_smokingstatus_sequence.rb | 326 +++++++++++++ .../pediatric_bmi_for_age_sequence.rb | 78 ++-- .../pediatric_weight_for_height_sequence.rb | 78 ++-- .../us_core_allergyintolerance_sequence.rb | 24 +- .../us_core_careplan_sequence.rb | 73 +-- .../us_core_careteam_sequence.rb | 44 +- .../us_core_condition_sequence.rb | 45 +- .../us_core_diagnosticreport_lab_sequence.rb | 57 +-- .../us_core_diagnosticreport_note_sequence.rb | 57 +-- .../us_core_documentreference_sequence.rb | 61 +-- .../us_core_encounter_sequence.rb | 55 ++- .../uscore_v3.1.0/us_core_goal_sequence.rb | 31 +- .../us_core_immunization_sequence.rb | 31 +- .../us_core_implantable_device_sequence.rb | 24 +- .../us_core_location_sequence.rb | 35 +- .../us_core_medication_sequence.rb | 2 - .../us_core_medicationrequest_sequence.rb | 46 +- .../us_core_observation_lab_sequence.rb | 78 ++-- .../us_core_organization_sequence.rb | 20 +- .../uscore_v3.1.0/us_core_patient_sequence.rb | 54 ++- .../us_core_practitioner_sequence.rb | 20 +- .../us_core_practitionerrole_sequence.rb | 25 +- .../us_core_procedure_sequence.rb | 40 +- .../us_core_provenance_sequence.rb | 2 - .../us_core_pulse_oximetry_sequence.rb | 78 ++-- .../us_core_smokingstatus_sequence.rb | 78 ++-- .../sequence/us_core_patient_sequence_test.rb | 4 +- 52 files changed, 7685 insertions(+), 572 deletions(-) create mode 100644 lib/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_careplan_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_careteam_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_condition_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_device_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_encounter_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_goal_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_immunization_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_location_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_medication_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_organization_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_patient_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb create mode 100644 lib/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb create mode 100644 lib/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb create mode 100644 lib/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb create mode 100644 lib/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb create mode 100644 lib/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb create mode 100644 lib/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb create mode 100644 lib/modules/uscore_v3.0.1/us_core_procedure_sequence.rb create mode 100644 lib/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb diff --git a/generator/uscore/templates/sequence.rb.erb b/generator/uscore/templates/sequence.rb.erb index 472d3ae26..06d63a17a 100644 --- a/generator/uscore/templates/sequence.rb.erb +++ b/generator/uscore/templates/sequence.rb.erb @@ -14,16 +14,19 @@ module Inferno delayed_sequence" if delayed_sequence%> <%=search_validator%> details %( - - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. ) @resources_found = false<% tests.each do |test|%> - test '<%=test[:tests_that]%>' do +<% if test[:key].present? %> + test :<%= test[:key] %> do +<% else %> + test '<%= test[:tests_that] %>' do +<% end %> metadata do - id '<%=format('%02d', test[:index])%>' + id '<%=format('%02d', test[:index])%>'<% if test[:key].present? %> + name '<%= test[:tests_that] %>'<% end %> link '<%=test[:link]%>'<%if test[:optional]%> optional<%end%> description %( diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 34988be4c..957ca2906 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -114,8 +114,10 @@ def create_read_test(sequence) end def create_authorization_test(sequence) + key = :unauthorized_search authorization_test = { tests_that: "Server rejects #{sequence[:resource]} search without authorization", + key: key, index: sequence[:tests].length + 1, link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' } @@ -132,6 +134,12 @@ def create_authorization_test(sequence) assert_response_unauthorized reply) sequence[:tests] << authorization_test + # unit_test_generator.generate_authorization_test( + { + key: key, + resourceType: sequence[:resource], + search_param: first_search[:names] + }# ) end def create_include_test(sequence) @@ -414,34 +422,40 @@ def get_first_search_with_fixed_values(sequence, search_parameters, save_resourc end def get_search_params(search_parameters, sequence) - unless search_param_constants(search_parameters, sequence).nil? - return %( - search_params = { #{search_param_constants(search_parameters, sequence)} }\n) + search_params = get_search_param_hash(search_parameters, sequence) + search_param_string = %( + search_params = { + #{search_params.map { |param, value| search_param_to_string(param, value) }.join(",\n")} + } + ) + + if search_param_string.include? 'get_value_for_search_param' + search_param_value_check = + %(search_params.each { |param, value| skip "Could not resolve \#{param} in given resource" if value.nil? }\n) + return [search_param_string, search_param_value_check].join('') end - search_values = [] - search_assignments = [] - search_parameters.each do |param| - variable_name = param_value_name(param) - variable_value = + + search_param_string + end + + def search_param_to_string(param, value) + value_string = "'#{value}'" unless value.start_with?('@') || + value.start_with?('get_value_for_search_param') + "'#{param}': #{value_string || value}" + end + + def get_search_param_hash(search_parameters, sequence) + search_params = search_param_constants(search_parameters, sequence) + return search_params if search_params.present? + + search_parameters.each_with_object({}) do |param, params| + params[param] = if param == 'patient' '@instance.patient_id' else resolve_element_path(sequence[:search_param_descriptions][param.to_sym]) end - search_values << "#{variable_name} = #{variable_value}" - search_assignments << "'#{param}': #{variable_name}" - end - - search_code = '' - search_values.each do |value| - search_code += %( - #{value}) end - search_code += %( - search_params = { #{search_assignments.join(', ')} } - search_params.each { |param, value| skip "Could not resolve \#{param} in given resource" if value.nil? } - ) - search_code end def get_comparator_searches(search_params, sequence) @@ -473,7 +487,16 @@ def get_comparator_searches(search_params, sequence) end def search_param_constants(search_parameters, sequence) - return "'_id': @instance.patient_id" if search_parameters == ['_id'] && sequence[:resource] == 'Patient' + return { patient: '@instance.patient_id', category: 'assess-plan'} if search_parameters == ['patient', 'category'] && sequence[:resource] == 'CarePlan' + return { patient: '@instance.patient_id', status: 'active' } if search_parameters == ['patient', 'status'] && sequence[:resource] == 'CareTeam' + return { '_id': '@instance.patient_id' } if search_parameters == ['_id'] && sequence[:resource] == 'Patient' + return { patient: '@instance.patient_id', code: '72166-2' } if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:smoking_status] + return { patient: '@instance.patient_id', category: 'laboratory' } if search_parameters == ['patient', 'category'] && sequence[:profile] == PROFILE_URIS[:lab_results] + return { patient: '@instance.patient_id', code: '77606-2' } if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:pediatric_weight_height] + return { patient: '@instance.patient_id', code: '59576-9' } if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:pediatric_bmi_age] + return { patient: '@instance.patient_id', category: 'LAB' } if search_parameters == ['patient', 'category'] && sequence[:profile] == PROFILE_URIS[:diagnostic_report_lab] + return { patient: '@instance.patient_id', code: 'LP29684-5' } if search_parameters == ['patient', 'category'] && sequence[:profile] == PROFILE_URIS[:diagnostic_report_note] + return { patient: '@instance.patient_id', code: '59408-5' } if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:pulse_oximetry] end def create_search_validation(sequence) diff --git a/lib/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb new file mode 100644 index 000000000..b885ad027 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb @@ -0,0 +1,213 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300AllergyintoleranceSequence < SequenceBase + title 'AllergyIntolerance Tests' + + description 'Verify that AllergyIntolerance resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCAI' + + requires :token, :patient_id + conformance_supports :AllergyIntolerance + + def validate_resource_item(resource, property, value) + case property + + when 'clinical-status' + value_found = can_resolve_path(resource, 'clinicalStatus.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'clinical-status on resource does not match clinical-status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects AllergyIntolerance search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from AllergyIntolerance search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @allergyintolerance = reply&.resource&.entry&.first&.resource + @allergyintolerance_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('AllergyIntolerance'), reply) + save_delayed_sequence_references(@allergyintolerance_ary) + validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) + end + + test 'Server returns expected results from AllergyIntolerance search by patient+clinical-status' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@allergyintolerance.nil?, 'Expected valid AllergyIntolerance resource to be present' + + patient_val = @instance.patient_id + clinical_status_val = get_value_for_search_param(resolve_element_from_path(@allergyintolerance_ary, 'clinicalStatus')) + search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) + validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) + assert_response_ok(reply) + end + + test 'AllergyIntolerance read resource supported' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:AllergyIntolerance, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) + end + + test 'AllergyIntolerance vread resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:AllergyIntolerance, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) + end + + test 'AllergyIntolerance history resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:AllergyIntolerance, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) + end + + test 'AllergyIntolerance resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '07' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('AllergyIntolerance') + end + + test 'At least one of every must support element is provided in any AllergyIntolerance for this patient.' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @allergyintolerance_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'AllergyIntolerance.clinicalStatus', + 'AllergyIntolerance.verificationStatus', + 'AllergyIntolerance.code', + 'AllergyIntolerance.patient' + ] + must_support_elements.each do |path| + @allergyintolerance_ary&.each do |resource| + truncated_path = path.gsub('AllergyIntolerance.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @allergyintolerance_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided AllergyIntolerance resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '09' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:AllergyIntolerance, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@allergyintolerance) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_careplan_sequence.rb new file mode 100644 index 000000000..4b7c9d1f8 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_careplan_sequence.rb @@ -0,0 +1,288 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300CareplanSequence < SequenceBase + title 'CarePlan Tests' + + description 'Verify that CarePlan resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCCP' + + requires :token, :patient_id + conformance_supports :CarePlan + + def validate_resource_item(resource, property, value) + case property + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'date' + value_found = can_resolve_path(resource, 'period') do |period| + validate_period_search(value, period) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects CarePlan search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, category: 'assess-plan' } + + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from CarePlan search by patient+category' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, category: 'assess-plan' } + + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @careplan = reply&.resource&.entry&.first&.resource + @careplan_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) + save_delayed_sequence_references(@careplan_ary) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) + end + + test 'Server returns expected results from CarePlan search by patient+category+status' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from CarePlan search by patient+category+status+date' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) + status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) + date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) + search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from CarePlan search by patient+category+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) + validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'CarePlan read resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CarePlan, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@careplan, versioned_resource_class('CarePlan')) + end + + test 'CarePlan vread resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CarePlan, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@careplan, versioned_resource_class('CarePlan')) + end + + test 'CarePlan history resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CarePlan, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@careplan, versioned_resource_class('CarePlan')) + end + + test 'CarePlan resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '09' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('CarePlan') + end + + test 'At least one of every must support element is provided in any CarePlan for this patient.' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careplan_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'CarePlan.text', + 'CarePlan.text.status', + 'CarePlan.status', + 'CarePlan.intent', + 'CarePlan.category', + 'CarePlan.category', + 'CarePlan.subject' + ] + must_support_elements.each do |path| + @careplan_ary&.each do |resource| + truncated_path = path.gsub('CarePlan.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @careplan_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided CarePlan resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '11' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CarePlan, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@careplan) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_careteam_sequence.rb new file mode 100644 index 000000000..5fe0e096c --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_careteam_sequence.rb @@ -0,0 +1,187 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300CareteamSequence < SequenceBase + title 'CareTeam Tests' + + description 'Verify that CareTeam resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCCT' + + requires :token, :patient_id + conformance_supports :CareTeam + + def validate_resource_item(resource, property, value) + case property + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects CareTeam search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { patient: @instance.patient_id, status: 'active' } + + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from CareTeam search by patient+status' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { patient: @instance.patient_id, status: 'active' } + + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @careteam = reply&.resource&.entry&.first&.resource + @careteam_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) + save_delayed_sequence_references(@careteam_ary) + validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) + end + + test 'CareTeam read resource supported' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CareTeam, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@careteam, versioned_resource_class('CareTeam')) + end + + test 'CareTeam vread resource supported' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CareTeam, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@careteam, versioned_resource_class('CareTeam')) + end + + test 'CareTeam history resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CareTeam, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@careteam, versioned_resource_class('CareTeam')) + end + + test 'CareTeam resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '06' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('CareTeam') + end + + test 'At least one of every must support element is provided in any CareTeam for this patient.' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careteam_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'CareTeam.status', + 'CareTeam.subject', + 'CareTeam.participant', + 'CareTeam.participant.role', + 'CareTeam.participant.member' + ] + must_support_elements.each do |path| + @careteam_ary&.each do |resource| + truncated_path = path.gsub('CareTeam.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @careteam_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided CareTeam resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '08' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:CareTeam, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@careteam) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_condition_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_condition_sequence.rb new file mode 100644 index 000000000..3bf3e5aa8 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_condition_sequence.rb @@ -0,0 +1,305 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300ConditionSequence < SequenceBase + title 'Condition Tests' + + description 'Verify that Condition resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCC' + + requires :token, :patient_id + conformance_supports :Condition + + def validate_resource_item(resource, property, value) + case property + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'clinical-status' + value_found = can_resolve_path(resource, 'clinicalStatus.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'clinical-status on resource does not match clinical-status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'onset-date' + value_found = can_resolve_path(resource, 'onsetDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'onset-date on resource does not match onset-date requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Condition search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Condition search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @condition = reply&.resource&.entry&.first&.resource + @condition_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Condition'), reply) + save_delayed_sequence_references(@condition_ary) + validate_search_reply(versioned_resource_class('Condition'), reply, search_params) + end + + test 'Server returns expected results from Condition search by patient+onset-date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@condition.nil?, 'Expected valid Condition resource to be present' + + patient_val = @instance.patient_id + onset_date_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'onsetDateTime')) + search_params = { 'patient': patient_val, 'onset-date': onset_date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + validate_search_reply(versioned_resource_class('Condition'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, onset_date_val) + comparator_search_params = { 'patient': patient_val, 'onset-date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Condition'), comparator_search_params) + validate_search_reply(versioned_resource_class('Condition'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Condition search by patient+category' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@condition.nil?, 'Expected valid Condition resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + validate_search_reply(versioned_resource_class('Condition'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Condition search by patient+code' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@condition.nil?, 'Expected valid Condition resource to be present' + + patient_val = @instance.patient_id + code_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'code')) + search_params = { 'patient': patient_val, 'code': code_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + validate_search_reply(versioned_resource_class('Condition'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Condition search by patient+clinical-status' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@condition.nil?, 'Expected valid Condition resource to be present' + + patient_val = @instance.patient_id + clinical_status_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'clinicalStatus')) + search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) + validate_search_reply(versioned_resource_class('Condition'), reply, search_params) + assert_response_ok(reply) + end + + test 'Condition read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Condition, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@condition, versioned_resource_class('Condition')) + end + + test 'Condition vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Condition, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@condition, versioned_resource_class('Condition')) + end + + test 'Condition history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Condition, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@condition, versioned_resource_class('Condition')) + end + + test 'Condition resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '10' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Condition') + end + + test 'At least one of every must support element is provided in any Condition for this patient.' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @condition_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Condition.clinicalStatus', + 'Condition.verificationStatus', + 'Condition.category', + 'Condition.code', + 'Condition.subject' + ] + must_support_elements.each do |path| + @condition_ary&.each do |resource| + truncated_path = path.gsub('Condition.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @condition_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Condition resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '12' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Condition, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@condition) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_device_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_device_sequence.rb new file mode 100644 index 000000000..5a0c8a3d7 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_device_sequence.rb @@ -0,0 +1,214 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300DeviceSequence < SequenceBase + title 'Device Tests' + + description 'Verify that Device resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCD' + + requires :token, :patient_id + conformance_supports :Device + + def validate_resource_item(resource, property, value) + case property + + when 'patient' + value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'type' + value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'type on resource does not match type requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Device search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Device'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Device search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Device'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @device = reply&.resource&.entry&.first&.resource + @device_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Device'), reply) + save_delayed_sequence_references(@device_ary) + validate_search_reply(versioned_resource_class('Device'), reply, search_params) + end + + test 'Server returns expected results from Device search by patient+type' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@device.nil?, 'Expected valid Device resource to be present' + + patient_val = @instance.patient_id + type_val = get_value_for_search_param(resolve_element_from_path(@device_ary, 'type')) + search_params = { 'patient': patient_val, 'type': type_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Device'), search_params) + validate_search_reply(versioned_resource_class('Device'), reply, search_params) + assert_response_ok(reply) + end + + test 'Device read resource supported' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Device, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@device, versioned_resource_class('Device')) + end + + test 'Device vread resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Device, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@device, versioned_resource_class('Device')) + end + + test 'Device history resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Device, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@device, versioned_resource_class('Device')) + end + + test 'Device resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '07' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-device' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Device') + end + + test 'At least one of every must support element is provided in any Device for this patient.' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @device_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Device.udiCarrier', + 'Device.udiCarrier.carrierAIDC', + 'Device.udiCarrier.carrierHRF', + 'Device.type', + 'Device.patient' + ] + must_support_elements.each do |path| + @device_ary&.each do |resource| + truncated_path = path.gsub('Device.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @device_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Device resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '09' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Device, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@device) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb new file mode 100644 index 000000000..4afa18d4e --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb @@ -0,0 +1,383 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300DocumentreferenceSequence < SequenceBase + title 'DocumentReference Tests' + + description 'Verify that DocumentReference resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCDR' + + requires :token, :patient_id + conformance_supports :DocumentReference + + def validate_resource_item(resource, property, value) + case property + + when '_id' + value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } + assert value_found, '_id on resource does not match _id requested' + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'type' + value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'type on resource does not match type requested' + + when 'date' + value_found = can_resolve_path(resource, 'date') { |value_in_resource| value_in_resource == value } + assert value_found, 'date on resource does not match date requested' + + when 'period' + value_found = can_resolve_path(resource, 'context.period') do |period| + validate_period_search(value, period) + end + assert value_found, 'period on resource does not match period requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects DocumentReference search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from DocumentReference search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @documentreference = reply&.resource&.entry&.first&.resource + @documentreference_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('DocumentReference'), reply) + save_delayed_sequence_references(@documentreference_ary) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + end + + test 'Server returns expected results from DocumentReference search by _id' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + id_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'id')) + search_params = { '_id': id_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DocumentReference search by patient+category' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) + search_params = { 'patient': patient_val, 'category': category_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DocumentReference search by patient+category+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + patient_val = @instance.patient_id + category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) + date_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'date')) + search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DocumentReference search by patient+type' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + patient_val = @instance.patient_id + type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) + search_params = { 'patient': patient_val, 'type': type_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DocumentReference search by patient+status' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DocumentReference search by patient+type+period' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + + patient_val = @instance.patient_id + type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) + period_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'context.period')) + search_params = { 'patient': patient_val, 'type': type_val, 'period': period_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, period_val) + comparator_search_params = { 'patient': patient_val, 'type': type_val, 'period': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), comparator_search_params) + validate_search_reply(versioned_resource_class('DocumentReference'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'DocumentReference create resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DocumentReference, [:create]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_create_reply(@documentreference, versioned_resource_class('DocumentReference')) + end + + test 'DocumentReference read resource supported' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DocumentReference, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@documentreference, versioned_resource_class('DocumentReference')) + end + + test 'DocumentReference vread resource supported' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DocumentReference, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@documentreference, versioned_resource_class('DocumentReference')) + end + + test 'DocumentReference history resource supported' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DocumentReference, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@documentreference, versioned_resource_class('DocumentReference')) + end + + test 'DocumentReference resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '13' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('DocumentReference') + end + + test 'At least one of every must support element is provided in any DocumentReference for this patient.' do + metadata do + id '14' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @documentreference_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'DocumentReference.identifier', + 'DocumentReference.status', + 'DocumentReference.type', + 'DocumentReference.category', + 'DocumentReference.subject', + 'DocumentReference.date', + 'DocumentReference.author', + 'DocumentReference.custodian', + 'DocumentReference.content', + 'DocumentReference.content.attachment', + 'DocumentReference.content.attachment.contentType', + 'DocumentReference.content.attachment.data', + 'DocumentReference.content.attachment.url', + 'DocumentReference.content.format', + 'DocumentReference.context', + 'DocumentReference.context.encounter', + 'DocumentReference.context.period' + ] + must_support_elements.each do |path| + @documentreference_ary&.each do |resource| + truncated_path = path.gsub('DocumentReference.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @documentreference_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided DocumentReference resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '15' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DocumentReference, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@documentreference) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_encounter_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_encounter_sequence.rb new file mode 100644 index 000000000..dfc021227 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_encounter_sequence.rb @@ -0,0 +1,367 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300EncounterSequence < SequenceBase + title 'Encounter Tests' + + description 'Verify that Encounter resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCE' + + requires :token, :patient_id + conformance_supports :Encounter + + def validate_resource_item(resource, property, value) + case property + + when '_id' + value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } + assert value_found, '_id on resource does not match _id requested' + + when 'class' + value_found = can_resolve_path(resource, 'local_class.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'class on resource does not match class requested' + + when 'date' + value_found = can_resolve_path(resource, 'period') do |period| + validate_period_search(value, period) + end + assert value_found, 'date on resource does not match date requested' + + when 'identifier' + value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } + assert value_found, 'identifier on resource does not match identifier requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'type' + value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'type on resource does not match type requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Encounter search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Encounter search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @encounter = reply&.resource&.entry&.first&.resource + @encounter_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Encounter'), reply) + save_delayed_sequence_references(@encounter_ary) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + end + + test 'Server returns expected results from Encounter search by _id' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + id_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'id')) + search_params = { '_id': id_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Encounter search by date+patient' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + date_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'period')) + patient_val = @instance.patient_id + search_params = { 'date': date_val, 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'date': comparator_val, 'patient': patient_val } + reply = get_resource_by_params(versioned_resource_class('Encounter'), comparator_search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Encounter search by identifier' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + identifier_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'identifier')) + search_params = { 'identifier': identifier_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Encounter search by patient+status' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Encounter search by class+patient' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + class_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'local_class')) + patient_val = @instance.patient_id + search_params = { 'class': class_val, 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Encounter search by patient+type' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@encounter.nil?, 'Expected valid Encounter resource to be present' + + patient_val = @instance.patient_id + type_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'type')) + search_params = { 'patient': patient_val, 'type': type_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) + validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) + assert_response_ok(reply) + end + + test 'Encounter read resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Encounter, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@encounter, versioned_resource_class('Encounter')) + end + + test 'Encounter vread resource supported' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Encounter, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@encounter, versioned_resource_class('Encounter')) + end + + test 'Encounter history resource supported' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Encounter, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@encounter, versioned_resource_class('Encounter')) + end + + test 'Encounter resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '12' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Encounter') + end + + test 'At least one of every must support element is provided in any Encounter for this patient.' do + metadata do + id '13' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @encounter_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Encounter.identifier', + 'Encounter.identifier.system', + 'Encounter.identifier.value', + 'Encounter.status', + 'Encounter.local_class', + 'Encounter.type', + 'Encounter.subject', + 'Encounter.participant', + 'Encounter.participant.type', + 'Encounter.participant.period', + 'Encounter.participant.individual', + 'Encounter.period', + 'Encounter.reasonCode', + 'Encounter.hospitalization', + 'Encounter.hospitalization.dischargeDisposition', + 'Encounter.location', + 'Encounter.location.location' + ] + must_support_elements.each do |path| + @encounter_ary&.each do |resource| + truncated_path = path.gsub('Encounter.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @encounter_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Encounter resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '14' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Encounter, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@encounter) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_goal_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_goal_sequence.rb new file mode 100644 index 000000000..549ea4387 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_goal_sequence.rb @@ -0,0 +1,252 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300GoalSequence < SequenceBase + title 'Goal Tests' + + description 'Verify that Goal resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCG' + + requires :token, :patient_id + conformance_supports :Goal + + def validate_resource_item(resource, property, value) + case property + + when 'lifecycle-status' + value_found = can_resolve_path(resource, 'lifecycleStatus') { |value_in_resource| value_in_resource == value } + assert value_found, 'lifecycle-status on resource does not match lifecycle-status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'target-date' + value_found = can_resolve_path(resource, 'target.dueDate') do |date| + validate_date_search(value, date) + end + assert value_found, 'target-date on resource does not match target-date requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Goal search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Goal search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @goal = reply&.resource&.entry&.first&.resource + @goal_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Goal'), reply) + save_delayed_sequence_references(@goal_ary) + validate_search_reply(versioned_resource_class('Goal'), reply, search_params) + end + + test 'Server returns expected results from Goal search by patient+target-date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@goal.nil?, 'Expected valid Goal resource to be present' + + patient_val = @instance.patient_id + target_date_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'target.dueDate')) + search_params = { 'patient': patient_val, 'target-date': target_date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) + validate_search_reply(versioned_resource_class('Goal'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, target_date_val) + comparator_search_params = { 'patient': patient_val, 'target-date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Goal'), comparator_search_params) + validate_search_reply(versioned_resource_class('Goal'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Goal search by patient+lifecycle-status' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@goal.nil?, 'Expected valid Goal resource to be present' + + patient_val = @instance.patient_id + lifecycle_status_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'lifecycleStatus')) + search_params = { 'patient': patient_val, 'lifecycle-status': lifecycle_status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) + validate_search_reply(versioned_resource_class('Goal'), reply, search_params) + assert_response_ok(reply) + end + + test 'Goal read resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Goal, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@goal, versioned_resource_class('Goal')) + end + + test 'Goal vread resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Goal, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@goal, versioned_resource_class('Goal')) + end + + test 'Goal history resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Goal, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@goal, versioned_resource_class('Goal')) + end + + test 'Goal resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Goal') + end + + test 'At least one of every must support element is provided in any Goal for this patient.' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @goal_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Goal.lifecycleStatus', + 'Goal.description', + 'Goal.subject', + 'Goal.target', + 'Goal.target.dueDate', + 'Goal.target.dueDuration' + ] + must_support_elements.each do |path| + @goal_ary&.each do |resource| + truncated_path = path.gsub('Goal.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @goal_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Goal resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Goal, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@goal) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_immunization_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_immunization_sequence.rb new file mode 100644 index 000000000..b9eab8272 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_immunization_sequence.rb @@ -0,0 +1,253 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300ImmunizationSequence < SequenceBase + title 'Immunization Tests' + + description 'Verify that Immunization resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCI' + + requires :token, :patient_id + conformance_supports :Immunization + + def validate_resource_item(resource, property, value) + case property + + when 'patient' + value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'date' + value_found = can_resolve_path(resource, 'occurrenceDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Immunization search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Immunization search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @immunization = reply&.resource&.entry&.first&.resource + @immunization_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Immunization'), reply) + save_delayed_sequence_references(@immunization_ary) + validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) + end + + test 'Server returns expected results from Immunization search by patient+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@immunization.nil?, 'Expected valid Immunization resource to be present' + + patient_val = @instance.patient_id + date_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'occurrenceDateTime')) + search_params = { 'patient': patient_val, 'date': date_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) + validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('Immunization'), comparator_search_params) + validate_search_reply(versioned_resource_class('Immunization'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from Immunization search by patient+status' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@immunization.nil?, 'Expected valid Immunization resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) + validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) + assert_response_ok(reply) + end + + test 'Immunization read resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Immunization, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@immunization, versioned_resource_class('Immunization')) + end + + test 'Immunization vread resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Immunization, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@immunization, versioned_resource_class('Immunization')) + end + + test 'Immunization history resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Immunization, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@immunization, versioned_resource_class('Immunization')) + end + + test 'Immunization resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Immunization') + end + + test 'At least one of every must support element is provided in any Immunization for this patient.' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @immunization_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Immunization.status', + 'Immunization.statusReason', + 'Immunization.vaccineCode', + 'Immunization.patient', + 'Immunization.occurrenceDateTime', + 'Immunization.occurrenceString', + 'Immunization.primarySource' + ] + must_support_elements.each do |path| + @immunization_ary&.each do |resource| + truncated_path = path.gsub('Immunization.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @immunization_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Immunization resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Immunization, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@immunization) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_location_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_location_sequence.rb new file mode 100644 index 000000000..37199f88c --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_location_sequence.rb @@ -0,0 +1,302 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300LocationSequence < SequenceBase + title 'Location Tests' + + description 'Verify that Location resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCL' + + requires :token + conformance_supports :Location + delayed_sequence + + def validate_resource_item(resource, property, value) + case property + + when 'name' + value_found = can_resolve_path(resource, 'name') { |value_in_resource| value_in_resource == value } + assert value_found, 'name on resource does not match name requested' + + when 'address' + value_found = can_resolve_path(resource, 'address') do |address| + address&.text&.start_with?(value) || + address&.city&.start_with?(value) || + address&.state&.start_with?(value) || + address&.postalCode&.start_with?(value) || + address&.country&.start_with?(value) + end + assert value_found, 'address on resource does not match address requested' + + when 'address-city' + value_found = can_resolve_path(resource, 'address.city') { |value_in_resource| value_in_resource == value } + assert value_found, 'address-city on resource does not match address-city requested' + + when 'address-state' + value_found = can_resolve_path(resource, 'address.state') { |value_in_resource| value_in_resource == value } + assert value_found, 'address-state on resource does not match address-state requested' + + when 'address-postalcode' + value_found = can_resolve_path(resource, 'address.postalCode') { |value_in_resource| value_in_resource == value } + assert value_found, 'address-postalcode on resource does not match address-postalcode requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test 'Can read Location from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + location_id = @instance.resource_references.find { |reference| reference.resource_type == 'Location' }&.resource_id + skip 'No Location references found from the prior searches' if location_id.nil? + @location = fetch_resource('Location', location_id) + @location_ary = Array.wrap(@location) + @resources_found = !@location.nil? + end + + test :unauthorized_search do + metadata do + id '02' + name 'Server rejects Location search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Location search by name' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @location = reply&.resource&.entry&.first&.resource + @location_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Location'), reply) + save_delayed_sequence_references(@location_ary) + validate_search_reply(versioned_resource_class('Location'), reply, search_params) + end + + test 'Server returns expected results from Location search by address' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@location.nil?, 'Expected valid Location resource to be present' + + address_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address')) + search_params = { 'address': address_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + validate_search_reply(versioned_resource_class('Location'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Location search by address-city' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@location.nil?, 'Expected valid Location resource to be present' + + address_city_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.city')) + search_params = { 'address-city': address_city_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + validate_search_reply(versioned_resource_class('Location'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Location search by address-state' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@location.nil?, 'Expected valid Location resource to be present' + + address_state_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.state')) + search_params = { 'address-state': address_state_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + validate_search_reply(versioned_resource_class('Location'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Location search by address-postalcode' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@location.nil?, 'Expected valid Location resource to be present' + + address_postalcode_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.postalCode')) + search_params = { 'address-postalcode': address_postalcode_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) + validate_search_reply(versioned_resource_class('Location'), reply, search_params) + assert_response_ok(reply) + end + + test 'Location vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Location, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@location, versioned_resource_class('Location')) + end + + test 'Location history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Location, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@location, versioned_resource_class('Location')) + end + + test 'Location resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '10' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-location' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Location') + end + + test 'At least one of every must support element is provided in any Location for this patient.' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @location_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Location.status', + 'Location.name', + 'Location.telecom', + 'Location.address', + 'Location.address.line', + 'Location.address.city', + 'Location.address.state', + 'Location.address.postalCode', + 'Location.managingOrganization' + ] + must_support_elements.each do |path| + @location_ary&.each do |resource| + truncated_path = path.gsub('Location.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @location_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Location resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '12' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Location, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@location) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_medication_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_medication_sequence.rb new file mode 100644 index 000000000..a910ca121 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_medication_sequence.rb @@ -0,0 +1,124 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300MedicationSequence < SequenceBase + title 'Medication Tests' + + description 'Verify that Medication resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCM' + + requires :token + conformance_supports :Medication + delayed_sequence + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test 'Can read Medication from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + medication_id = @instance.resource_references.find { |reference| reference.resource_type == 'Medication' }&.resource_id + skip 'No Medication references found from the prior searches' if medication_id.nil? + @medication = fetch_resource('Medication', medication_id) + @medication_ary = Array.wrap(@medication) + @resources_found = !@medication.nil? + end + + test 'Medication vread resource supported' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Medication, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@medication, versioned_resource_class('Medication')) + end + + test 'Medication history resource supported' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Medication, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@medication, versioned_resource_class('Medication')) + end + + test 'Medication resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '04' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Medication') + end + + test 'At least one of every must support element is provided in any Medication for this patient.' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medication_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Medication.code' + ] + must_support_elements.each do |path| + @medication_ary&.each do |resource| + truncated_path = path.gsub('Medication.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @medication_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Medication resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '06' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Medication, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@medication) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb new file mode 100644 index 000000000..8e754a4ef --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb @@ -0,0 +1,264 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300MedicationrequestSequence < SequenceBase + title 'MedicationRequest Tests' + + description 'Verify that MedicationRequest resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCMR' + + requires :token, :patient_id + conformance_supports :MedicationRequest + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'authoredon' + value_found = can_resolve_path(resource, 'authoredOn') { |value_in_resource| value_in_resource == value } + assert value_found, 'authoredon on resource does not match authoredon requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects MedicationRequest search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from MedicationRequest search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @medicationrequest = reply&.resource&.entry&.first&.resource + @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) + save_delayed_sequence_references(@medicationrequest_ary) + validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) + end + + test 'Server returns expected results from MedicationRequest search by patient+status' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from MedicationRequest search by patient+authoredon' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' + + patient_val = @instance.patient_id + authoredon_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'authoredOn')) + search_params = { 'patient': patient_val, 'authoredon': authoredon_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) + assert_response_ok(reply) + end + + test 'MedicationRequest read resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationRequest, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) + end + + test 'MedicationRequest vread resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationRequest, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) + end + + test 'MedicationRequest history resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationRequest, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) + end + + test 'Server returns the appropriate resource from the following _includes: MedicationRequest:medication' do + metadata do + id '08' + link 'https://www.hl7.org/fhir/search.html#include' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_include'] = 'MedicationRequest:medication' + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } + assert medication_results, 'No Medication resources were returned from this search' + end + + test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '09' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('MedicationRequest') + end + + test 'At least one of every must support element is provided in any MedicationRequest for this patient.' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medicationrequest_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'MedicationRequest.status', + 'MedicationRequest.medicationCodeableConcept', + 'MedicationRequest.medicationReference', + 'MedicationRequest.subject', + 'MedicationRequest.authoredOn', + 'MedicationRequest.requester', + 'MedicationRequest.dosageInstruction', + 'MedicationRequest.dosageInstruction.text' + ] + must_support_elements.each do |path| + @medicationrequest_ary&.each do |resource| + truncated_path = path.gsub('MedicationRequest.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @medicationrequest_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided MedicationRequest resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '11' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationRequest, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@medicationrequest) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb new file mode 100644 index 000000000..f366877d8 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb @@ -0,0 +1,275 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300MedicationstatementSequence < SequenceBase + title 'MedicationStatement Tests' + + description 'Verify that MedicationStatement resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCMS' + + requires :token, :patient_id + conformance_supports :MedicationStatement + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'effective' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'effective on resource does not match effective requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects MedicationStatement search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from MedicationStatement search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @medicationstatement = reply&.resource&.entry&.first&.resource + @medicationstatement_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('MedicationStatement'), reply) + save_delayed_sequence_references(@medicationstatement_ary) + validate_search_reply(versioned_resource_class('MedicationStatement'), reply, search_params) + end + + test 'Server returns expected results from MedicationStatement search by patient+effective' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@medicationstatement.nil?, 'Expected valid MedicationStatement resource to be present' + + patient_val = @instance.patient_id + effective_val = get_value_for_search_param(resolve_element_from_path(@medicationstatement_ary, 'effectiveDateTime')) + search_params = { 'patient': patient_val, 'effective': effective_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) + validate_search_reply(versioned_resource_class('MedicationStatement'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, effective_val) + comparator_search_params = { 'patient': patient_val, 'effective': comparator_val } + reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), comparator_search_params) + validate_search_reply(versioned_resource_class('MedicationStatement'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from MedicationStatement search by patient+status' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@medicationstatement.nil?, 'Expected valid MedicationStatement resource to be present' + + patient_val = @instance.patient_id + status_val = get_value_for_search_param(resolve_element_from_path(@medicationstatement_ary, 'status')) + search_params = { 'patient': patient_val, 'status': status_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) + validate_search_reply(versioned_resource_class('MedicationStatement'), reply, search_params) + assert_response_ok(reply) + end + + test 'MedicationStatement read resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationStatement, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) + end + + test 'MedicationStatement vread resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationStatement, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) + end + + test 'MedicationStatement history resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationStatement, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) + end + + test 'Server returns the appropriate resource from the following _includes: MedicationStatement:medication' do + metadata do + id '08' + link 'https://www.hl7.org/fhir/search.html#include' + description %( + ) + versions :r4 + end + + patient_val = @instance.patient_id + search_params = { 'patient': patient_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_include'] = 'MedicationStatement:medication' + reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } + assert medication_results, 'No Medication resources were returned from this search' + end + + test 'MedicationStatement resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '09' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationstatement' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('MedicationStatement') + end + + test 'At least one of every must support element is provided in any MedicationStatement for this patient.' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medicationstatement_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'MedicationStatement.status', + 'MedicationStatement.medicationCodeableConcept', + 'MedicationStatement.medicationReference', + 'MedicationStatement.subject', + 'MedicationStatement.effectiveDateTime', + 'MedicationStatement.effectivePeriod', + 'MedicationStatement.dateAsserted', + 'MedicationStatement.derivedFrom' + ] + must_support_elements.each do |path| + @medicationstatement_ary&.each do |resource| + truncated_path = path.gsub('MedicationStatement.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @medicationstatement_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided MedicationStatement resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '11' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:MedicationStatement, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@medicationstatement) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_organization_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_organization_sequence.rb new file mode 100644 index 000000000..4ff8e3803 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_organization_sequence.rb @@ -0,0 +1,227 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300OrganizationSequence < SequenceBase + title 'Organization Tests' + + description 'Verify that Organization resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCO' + + requires :token + conformance_supports :Organization + delayed_sequence + + def validate_resource_item(resource, property, value) + case property + + when 'name' + value_found = can_resolve_path(resource, 'name') { |value_in_resource| value_in_resource == value } + assert value_found, 'name on resource does not match name requested' + + when 'address' + value_found = can_resolve_path(resource, 'address') do |address| + address&.text&.start_with?(value) || + address&.city&.start_with?(value) || + address&.state&.start_with?(value) || + address&.postalCode&.start_with?(value) || + address&.country&.start_with?(value) + end + assert value_found, 'address on resource does not match address requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test 'Can read Organization from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + organization_id = @instance.resource_references.find { |reference| reference.resource_type == 'Organization' }&.resource_id + skip 'No Organization references found from the prior searches' if organization_id.nil? + @organization = fetch_resource('Organization', organization_id) + @organization_ary = Array.wrap(@organization) + @resources_found = !@organization.nil? + end + + test :unauthorized_search do + metadata do + id '02' + name 'Server rejects Organization search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Organization search by name' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @organization = reply&.resource&.entry&.first&.resource + @organization_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Organization'), reply) + save_delayed_sequence_references(@organization_ary) + validate_search_reply(versioned_resource_class('Organization'), reply, search_params) + end + + test 'Server returns expected results from Organization search by address' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@organization.nil?, 'Expected valid Organization resource to be present' + + address_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'address')) + search_params = { 'address': address_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) + validate_search_reply(versioned_resource_class('Organization'), reply, search_params) + assert_response_ok(reply) + end + + test 'Organization vread resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Organization, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@organization, versioned_resource_class('Organization')) + end + + test 'Organization history resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Organization, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@organization, versioned_resource_class('Organization')) + end + + test 'Organization resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '07' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Organization') + end + + test 'At least one of every must support element is provided in any Organization for this patient.' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @organization_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Organization.identifier', + 'Organization.identifier.system', + 'Organization.active', + 'Organization.name', + 'Organization.telecom', + 'Organization.address', + 'Organization.address.line', + 'Organization.address.city', + 'Organization.address.state', + 'Organization.address.postalCode', + 'Organization.address.country', + 'Organization.endpoint' + ] + must_support_elements.each do |path| + @organization_ary&.each do |resource| + truncated_path = path.gsub('Organization.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @organization_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Organization resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '09' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Organization, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@organization) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_patient_sequence.rb new file mode 100644 index 000000000..e3267e558 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_patient_sequence.rb @@ -0,0 +1,375 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300PatientSequence < SequenceBase + title 'Patient Tests' + + description 'Verify that Patient resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCP' + + requires :token, :patient_id + conformance_supports :Patient + + def validate_resource_item(resource, property, value) + case property + + when '_id' + value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } + assert value_found, '_id on resource does not match _id requested' + + when 'birthdate' + value_found = can_resolve_path(resource, 'birthDate') do |date| + validate_date_search(value, date) + end + assert value_found, 'birthdate on resource does not match birthdate requested' + + when 'family' + value_found = can_resolve_path(resource, 'name.family') { |value_in_resource| value_in_resource == value } + assert value_found, 'family on resource does not match family requested' + + when 'gender' + value_found = can_resolve_path(resource, 'gender') { |value_in_resource| value_in_resource == value } + assert value_found, 'gender on resource does not match gender requested' + + when 'given' + value_found = can_resolve_path(resource, 'name.given') { |value_in_resource| value_in_resource == value } + assert value_found, 'given on resource does not match given requested' + + when 'identifier' + value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } + assert value_found, 'identifier on resource does not match identifier requested' + + when 'name' + value = value.downcase + value_found = can_resolve_path(resource, 'name') do |name| + name&.text&.start_with?(value) || + name&.family&.downcase&.include?(value) || + name&.given&.any? { |given| given.downcase.start_with?(value) } || + name&.prefix&.any? { |prefix| prefix.downcase.start_with?(value) } || + name&.suffix&.any? { |suffix| suffix.downcase.start_with?(value) } + end + assert value_found, 'name on resource does not match name requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Patient search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { '_id': @instance.patient_id } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Patient search by _id' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { '_id': @instance.patient_id } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @patient = reply&.resource&.entry&.first&.resource + @patient_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Patient'), reply) + save_delayed_sequence_references(@patient_ary) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + end + + test 'Server returns expected results from Patient search by identifier' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + identifier_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'identifier')) + search_params = { 'identifier': identifier_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Patient search by name' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Patient search by birthdate+name' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) + name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) + search_params = { 'birthdate': birthdate_val, 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Patient search by gender+name' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) + name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) + search_params = { 'gender': gender_val, 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Patient search by family+gender' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) + gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) + search_params = { 'family': family_val, 'gender': gender_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Patient search by birthdate+family' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@patient.nil?, 'Expected valid Patient resource to be present' + + birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) + family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) + search_params = { 'birthdate': birthdate_val, 'family': family_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) + validate_search_reply(versioned_resource_class('Patient'), reply, search_params) + assert_response_ok(reply) + end + + test 'Patient read resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Patient, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@patient, versioned_resource_class('Patient')) + end + + test 'Patient vread resource supported' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Patient, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@patient, versioned_resource_class('Patient')) + end + + test 'Patient history resource supported' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Patient, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@patient, versioned_resource_class('Patient')) + end + + test 'Patient resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '12' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Patient') + end + + test 'At least one of every must support element is provided in any Patient for this patient.' do + metadata do + id '13' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @patient_ary&.any? + must_support_confirmed = {} + extensions_list = { + 'Patient.extension:race': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race', + 'Patient.extension:ethnicity': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity', + 'Patient.extension:birthsex': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex' + } + extensions_list.each do |id, url| + @patient_ary&.each do |resource| + must_support_confirmed[id] = true if resource.extension.any? { |extension| extension.url == url } + break if must_support_confirmed[id] + end + skip_notification = "Could not find #{id} in any of the #{@patient_ary.length} provided Patient resource(s)" + skip skip_notification unless must_support_confirmed[id] + end + + must_support_elements = [ + 'Patient.identifier', + 'Patient.identifier.system', + 'Patient.identifier.value', + 'Patient.name', + 'Patient.name.family', + 'Patient.name.given', + 'Patient.telecom', + 'Patient.telecom.system', + 'Patient.telecom.value', + 'Patient.gender', + 'Patient.birthDate', + 'Patient.address', + 'Patient.address.line', + 'Patient.address.city', + 'Patient.address.state', + 'Patient.address.postalCode', + 'Patient.communication', + 'Patient.communication.language' + ] + must_support_elements.each do |path| + @patient_ary&.each do |resource| + truncated_path = path.gsub('Patient.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @patient_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Patient resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '14' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Patient, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@patient) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb new file mode 100644 index 000000000..d929e007e --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb @@ -0,0 +1,223 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300PractitionerSequence < SequenceBase + title 'Practitioner Tests' + + description 'Verify that Practitioner resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPR' + + requires :token + conformance_supports :Practitioner + delayed_sequence + + def validate_resource_item(resource, property, value) + case property + + when 'name' + value = value.downcase + value_found = can_resolve_path(resource, 'name') do |name| + name&.text&.start_with?(value) || + name&.family&.downcase&.include?(value) || + name&.given&.any? { |given| given.downcase.start_with?(value) } || + name&.prefix&.any? { |prefix| prefix.downcase.start_with?(value) } || + name&.suffix&.any? { |suffix| suffix.downcase.start_with?(value) } + end + assert value_found, 'name on resource does not match name requested' + + when 'identifier' + value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } + assert value_found, 'identifier on resource does not match identifier requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test 'Can read Practitioner from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + practitioner_id = @instance.resource_references.find { |reference| reference.resource_type == 'Practitioner' }&.resource_id + skip 'No Practitioner references found from the prior searches' if practitioner_id.nil? + @practitioner = fetch_resource('Practitioner', practitioner_id) + @practitioner_ary = Array.wrap(@practitioner) + @resources_found = !@practitioner.nil? + end + + test :unauthorized_search do + metadata do + id '02' + name 'Server rejects Practitioner search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Practitioner search by name' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) + search_params = { 'name': name_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @practitioner = reply&.resource&.entry&.first&.resource + @practitioner_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Practitioner'), reply) + save_delayed_sequence_references(@practitioner_ary) + validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) + end + + test 'Server returns expected results from Practitioner search by identifier' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@practitioner.nil?, 'Expected valid Practitioner resource to be present' + + identifier_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'identifier')) + search_params = { 'identifier': identifier_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) + validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) + assert_response_ok(reply) + end + + test 'Practitioner vread resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Practitioner, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@practitioner, versioned_resource_class('Practitioner')) + end + + test 'Practitioner history resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Practitioner, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@practitioner, versioned_resource_class('Practitioner')) + end + + test 'Practitioner resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '07' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Practitioner') + end + + test 'At least one of every must support element is provided in any Practitioner for this patient.' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitioner_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Practitioner.identifier', + 'Practitioner.identifier.system', + 'Practitioner.identifier.value', + 'Practitioner.identifier', + 'Practitioner.identifier.system', + 'Practitioner.name', + 'Practitioner.name.family' + ] + must_support_elements.each do |path| + @practitioner_ary&.each do |resource| + truncated_path = path.gsub('Practitioner.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @practitioner_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Practitioner resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '09' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Practitioner, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@practitioner) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb new file mode 100644 index 000000000..486aa35e5 --- /dev/null +++ b/lib/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb @@ -0,0 +1,246 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore300PractitionerroleSequence < SequenceBase + title 'PractitionerRole Tests' + + description 'Verify that PractitionerRole resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPRO' + + requires :token + conformance_supports :PractitionerRole + delayed_sequence + + def validate_resource_item(resource, property, value) + case property + + when 'specialty' + value_found = can_resolve_path(resource, 'specialty.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'specialty on resource does not match specialty requested' + + when 'practitioner' + value_found = can_resolve_path(resource, 'practitioner.reference') { |value_in_resource| value_in_resource == value } + assert value_found, 'practitioner on resource does not match practitioner requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test 'Can read PractitionerRole from the server' do + metadata do + id '01' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + practitionerrole_id = @instance.resource_references.find { |reference| reference.resource_type == 'PractitionerRole' }&.resource_id + skip 'No PractitionerRole references found from the prior searches' if practitionerrole_id.nil? + @practitionerrole = fetch_resource('PractitionerRole', practitionerrole_id) + @practitionerrole_ary = Array.wrap(@practitionerrole) + @resources_found = !@practitionerrole.nil? + end + + test :unauthorized_search do + metadata do + id '02' + name 'Server rejects PractitionerRole search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + search_params = { 'specialty': specialty_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from PractitionerRole search by specialty' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + search_params = { 'specialty': specialty_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @practitionerrole = reply&.resource&.entry&.first&.resource + @practitionerrole_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('PractitionerRole'), reply) + save_delayed_sequence_references(@practitionerrole_ary) + validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) + end + + test 'Server returns expected results from PractitionerRole search by practitioner' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@practitionerrole.nil?, 'Expected valid PractitionerRole resource to be present' + + practitioner_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'practitioner')) + search_params = { 'practitioner': practitioner_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) + assert_response_ok(reply) + end + + test 'PractitionerRole vread resource supported' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:PractitionerRole, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) + end + + test 'PractitionerRole history resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:PractitionerRole, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) + end + + test 'Server returns the appropriate resource from the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do + metadata do + id '07' + link 'https://www.hl7.org/fhir/search.html#include' + description %( + ) + versions :r4 + end + + specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + search_params = { 'specialty': specialty_val } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + search_params['_include'] = 'PractitionerRole:endpoint' + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + endpoint_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Endpoint' } + assert endpoint_results, 'No Endpoint resources were returned from this search' + + search_params['_include'] = 'PractitionerRole:practitioner' + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + practitioner_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Practitioner' } + assert practitioner_results, 'No Practitioner resources were returned from this search' + end + + test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '08' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('PractitionerRole') + end + + test 'At least one of every must support element is provided in any PractitionerRole for this patient.' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitionerrole_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'PractitionerRole.practitioner', + 'PractitionerRole.organization', + 'PractitionerRole.code', + 'PractitionerRole.specialty', + 'PractitionerRole.location', + 'PractitionerRole.telecom', + 'PractitionerRole.telecom.system', + 'PractitionerRole.telecom.value', + 'PractitionerRole.endpoint' + ] + must_support_elements.each do |path| + @practitionerrole_ary&.each do |resource| + truncated_path = path.gsub('PractitionerRole.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @practitionerrole_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided PractitionerRole resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:PractitionerRole, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@practitionerrole) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb new file mode 100644 index 000000000..106fbc882 --- /dev/null +++ b/lib/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb @@ -0,0 +1,350 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore301PediatricBmiForAgeSequence < SequenceBase + title 'Pediatric BMI for Age Observation Tests' + + description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPBMIAO' + + requires :token, :patient_id + conformance_supports :Observation + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Observation search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { + 'patient': @instance.patient_id, + 'code': '59576-9' + } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Observation search by patient+code' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'code': '59576-9' + } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + end + + test 'Server returns expected results from Observation search by patient+category+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+category' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+category+status' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+code+date' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Observation read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'code': '59576-9' + } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) + end + + test 'At least one of every must support element is provided in any Observation for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Observation.status', + 'Observation.category', + 'Observation.category', + 'Observation.category.coding', + 'Observation.category.coding.system', + 'Observation.category.coding.code', + 'Observation.subject', + 'Observation.effectiveDateTime', + 'Observation.effectivePeriod', + 'Observation.valueQuantity', + 'Observation.valueQuantity.value', + 'Observation.valueQuantity.unit', + 'Observation.valueQuantity.system', + 'Observation.valueQuantity.code', + 'Observation.dataAbsentReason', + 'Observation.component', + 'Observation.component.code', + 'Observation.component.valueQuantity', + 'Observation.component.valueCodeableConcept', + 'Observation.component.valueString', + 'Observation.component.valueBoolean', + 'Observation.component.valueInteger', + 'Observation.component.valueRange', + 'Observation.component.valueRatio', + 'Observation.component.valueSampledData', + 'Observation.component.valueTime', + 'Observation.component.valueDateTime', + 'Observation.component.valuePeriod', + 'Observation.component.dataAbsentReason' + ] + must_support_elements.each do |path| + @observation_ary&.each do |resource| + truncated_path = path.gsub('Observation.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @observation_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@observation) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb new file mode 100644 index 000000000..180d303e6 --- /dev/null +++ b/lib/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb @@ -0,0 +1,350 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore301PediatricWeightForHeightSequence < SequenceBase + title 'Pediatric Weight for Height Observation Tests' + + description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPWHO' + + requires :token, :patient_id + conformance_supports :Observation + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Observation search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { + 'patient': @instance.patient_id, + 'code': '77606-2' + } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Observation search by patient+code' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'code': '77606-2' + } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + end + + test 'Server returns expected results from Observation search by patient+category+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+category' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+category+status' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+code+date' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Observation read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'code': '77606-2' + } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) + end + + test 'At least one of every must support element is provided in any Observation for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Observation.status', + 'Observation.category', + 'Observation.category', + 'Observation.category.coding', + 'Observation.category.coding.system', + 'Observation.category.coding.code', + 'Observation.subject', + 'Observation.effectiveDateTime', + 'Observation.effectivePeriod', + 'Observation.valueQuantity', + 'Observation.valueQuantity.value', + 'Observation.valueQuantity.unit', + 'Observation.valueQuantity.system', + 'Observation.valueQuantity.code', + 'Observation.dataAbsentReason', + 'Observation.component', + 'Observation.component.code', + 'Observation.component.valueQuantity', + 'Observation.component.valueCodeableConcept', + 'Observation.component.valueString', + 'Observation.component.valueBoolean', + 'Observation.component.valueInteger', + 'Observation.component.valueRange', + 'Observation.component.valueRatio', + 'Observation.component.valueSampledData', + 'Observation.component.valueTime', + 'Observation.component.valueDateTime', + 'Observation.component.valuePeriod', + 'Observation.component.dataAbsentReason' + ] + must_support_elements.each do |path| + @observation_ary&.each do |resource| + truncated_path = path.gsub('Observation.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @observation_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@observation) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb new file mode 100644 index 000000000..6e4612ed6 --- /dev/null +++ b/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb @@ -0,0 +1,440 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore301DiagnosticreportLabSequence < SequenceBase + title 'DiagnosticReport for Laboratory Results Reporting Tests' + + description 'Verify that DiagnosticReport resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCDRLRR' + + requires :token, :patient_id + conformance_supports :DiagnosticReport + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects DiagnosticReport search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { + 'patient': @instance.patient_id, + 'category': 'LAB' + } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from DiagnosticReport search by patient+category' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'category': 'LAB' + } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @diagnosticreport = reply&.resource&.entry&.first&.resource + @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) + save_delayed_sequence_references(@diagnosticreport_ary) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + end + + test 'Server returns expected results from DiagnosticReport search by patient' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id + } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+code' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+category+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from DiagnosticReport search by patient+code+date' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from DiagnosticReport search by patient+status' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'status': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+category' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': 'LAB' + } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+category+date' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'DiagnosticReport create resource supported' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:create]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport read resource supported' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport vread resource supported' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport history resource supported' do + metadata do + id '13' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '14' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'category': 'LAB' + } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '15' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('DiagnosticReport', Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) + end + + test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do + metadata do + id '16' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'DiagnosticReport.status', + 'DiagnosticReport.category', + 'DiagnosticReport.category', + 'DiagnosticReport.code', + 'DiagnosticReport.subject', + 'DiagnosticReport.effectiveDateTime', + 'DiagnosticReport.effectivePeriod', + 'DiagnosticReport.issued', + 'DiagnosticReport.performer', + 'DiagnosticReport.result', + 'DiagnosticReport.media', + 'DiagnosticReport.presentedForm' + ] + must_support_elements.each do |path| + @diagnosticreport_ary&.each do |resource| + truncated_path = path.gsub('DiagnosticReport.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @diagnosticreport_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '17' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@diagnosticreport) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb new file mode 100644 index 000000000..bba37171f --- /dev/null +++ b/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb @@ -0,0 +1,439 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore301DiagnosticreportNoteSequence < SequenceBase + title 'DiagnosticReport for Report and Note exchange Tests' + + description 'Verify that DiagnosticReport resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCDRRN' + + requires :token, :patient_id + conformance_supports :DiagnosticReport + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects DiagnosticReport search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { + 'patient': @instance.patient_id, + 'code': 'LP29684-5' + } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from DiagnosticReport search by patient+category' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'code': 'LP29684-5' + } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @diagnosticreport = reply&.resource&.entry&.first&.resource + @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) + save_delayed_sequence_references(@diagnosticreport_ary) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + end + + test 'Server returns expected results from DiagnosticReport search by patient' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id + } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+code' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+category+date' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from DiagnosticReport search by patient+code+date' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'Server returns expected results from DiagnosticReport search by patient+status' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'status': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+category' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': 'LP29684-5' + } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from DiagnosticReport search by patient+category+date' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, date_val) + comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end + end + + test 'DiagnosticReport create resource supported' do + metadata do + id '10' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:create]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport read resource supported' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport vread resource supported' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'DiagnosticReport history resource supported' do + metadata do + id '13' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '14' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'code': 'LP29684-5' + } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '15' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('DiagnosticReport', Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) + end + + test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do + metadata do + id '16' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'DiagnosticReport.status', + 'DiagnosticReport.category', + 'DiagnosticReport.code', + 'DiagnosticReport.subject', + 'DiagnosticReport.encounter', + 'DiagnosticReport.effectiveDateTime', + 'DiagnosticReport.effectivePeriod', + 'DiagnosticReport.issued', + 'DiagnosticReport.performer', + 'DiagnosticReport.media', + 'DiagnosticReport.presentedForm' + ] + must_support_elements.each do |path| + @diagnosticreport_ary&.each do |resource| + truncated_path = path.gsub('DiagnosticReport.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @diagnosticreport_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '17' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:DiagnosticReport, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@diagnosticreport) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb new file mode 100644 index 000000000..d3f43745d --- /dev/null +++ b/lib/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb @@ -0,0 +1,340 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore301ObservationLabSequence < SequenceBase + title 'Laboratory Result Observation Tests' + + description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCLRO' + + requires :token, :patient_id + conformance_supports :Observation + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Observation search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { + 'patient': @instance.patient_id, + 'category': 'laboratory' + } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Observation search by patient+category' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'category': 'laboratory' + } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + end + + test 'Server returns expected results from Observation search by patient+code' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+category+date' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+category+status' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+code+date' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Observation read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'category': 'laboratory' + } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) + end + + test 'At least one of every must support element is provided in any Observation for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Observation.status', + 'Observation.category', + 'Observation.category', + 'Observation.code', + 'Observation.subject', + 'Observation.effectiveDateTime', + 'Observation.effectivePeriod', + 'Observation.valueQuantity', + 'Observation.valueCodeableConcept', + 'Observation.valueString', + 'Observation.valueBoolean', + 'Observation.valueInteger', + 'Observation.valueRange', + 'Observation.valueRatio', + 'Observation.valueSampledData', + 'Observation.valueTime', + 'Observation.valueDateTime', + 'Observation.valuePeriod', + 'Observation.dataAbsentReason' + ] + must_support_elements.each do |path| + @observation_ary&.each do |resource| + truncated_path = path.gsub('Observation.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @observation_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@observation) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.1/us_core_procedure_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_procedure_sequence.rb new file mode 100644 index 000000000..8d989e879 --- /dev/null +++ b/lib/modules/uscore_v3.0.1/us_core_procedure_sequence.rb @@ -0,0 +1,294 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore301ProcedureSequence < SequenceBase + title 'Procedure Tests' + + description 'Verify that Procedure resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCPROC' + + requires :token, :patient_id + conformance_supports :Procedure + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + when 'date' + value_found = can_resolve_path(resource, 'occurrenceDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Procedure search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { + 'patient': @instance.patient_id + } + + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Procedure search by patient' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id + } + + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @procedure = reply&.resource&.entry&.first&.resource + @procedure_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Procedure'), reply) + save_delayed_sequence_references(@procedure_ary) + validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) + end + + test 'Server returns expected results from Procedure search by patient+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@procedure.nil?, 'Expected valid Procedure resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'date': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Procedure search by patient+code+date' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@procedure.nil?, 'Expected valid Procedure resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Procedure search by patient+status' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@procedure.nil?, 'Expected valid Procedure resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'status': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'status')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) + assert_response_ok(reply) + end + + test 'Procedure read resource supported' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Procedure, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@procedure, versioned_resource_class('Procedure')) + end + + test 'Procedure vread resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Procedure, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@procedure, versioned_resource_class('Procedure')) + end + + test 'Procedure history resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Procedure, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@procedure, versioned_resource_class('Procedure')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '09' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id + } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Procedure resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '10' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Procedure') + end + + test 'At least one of every must support element is provided in any Procedure for this patient.' do + metadata do + id '11' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @procedure_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Procedure.status', + 'Procedure.code', + 'Procedure.subject', + 'Procedure.performedDateTime', + 'Procedure.performedPeriod' + ] + must_support_elements.each do |path| + @procedure_ary&.each do |resource| + truncated_path = path.gsub('Procedure.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @procedure_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Procedure resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '12' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Procedure, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@procedure) + end + end + end +end diff --git a/lib/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb new file mode 100644 index 000000000..0ed23346c --- /dev/null +++ b/lib/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb @@ -0,0 +1,326 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class USCore301SmokingstatusSequence < SequenceBase + title 'Smoking Status Observation Tests' + + description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' + + test_id_prefix 'USCSSO' + + requires :token, :patient_id + conformance_supports :Observation + + def validate_resource_item(resource, property, value) + case property + + when 'status' + value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } + assert value_found, 'status on resource does not match status requested' + + when 'category' + value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'category on resource does not match category requested' + + when 'code' + value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } + assert value_found, 'code on resource does not match code requested' + + when 'date' + value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| + validate_date_search(value, date) + end + assert value_found, 'date on resource does not match date requested' + + when 'patient' + value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } + assert value_found, 'patient on resource does not match patient requested' + + end + end + + details %( + The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. + ) + + @resources_found = false + + test :unauthorized_search do + metadata do + id '01' + name 'Server rejects Observation search without authorization' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + description %( + ) + versions :r4 + end + + @client.set_no_auth + omit 'Do not test if no bearer token set' if @instance.token.blank? + + search_params = { + 'patient': @instance.patient_id, + 'code': '72166-2' + } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + @client.set_bearer_token(@instance.token) + assert_response_unauthorized reply + end + + test 'Server returns expected results from Observation search by patient+code' do + metadata do + id '02' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'code': '72166-2' + } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + end + + test 'Server returns expected results from Observation search by patient+category+date' do + metadata do + id '03' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+category' do + metadata do + id '04' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+category+status' do + metadata do + id '05' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Server returns expected results from Observation search by patient+code+date' do + metadata do + id '06' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + optional + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + assert !@observation.nil?, 'Expected valid Observation resource to be present' + + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + assert_response_ok(reply) + end + + test 'Observation read resource supported' do + metadata do + id '07' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_read_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation vread resource supported' do + metadata do + id '08' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:vread]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_vread_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Observation history resource supported' do + metadata do + id '09' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:history]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_history_reply(@observation, versioned_resource_class('Observation')) + end + + test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do + metadata do + id '10' + link 'https://www.hl7.org/fhir/search.html#revinclude' + description %( + ) + versions :r4 + end + + search_params = { + 'patient': @instance.patient_id, + 'code': '72166-2' + } + + search_params['_revinclude'] = 'Provenance:target' + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } + assert provenance_results, 'No Provenance resources were returned from this search' + end + + test 'Observation resources associated with Patient conform to US Core R4 profiles' do + metadata do + id '11' + link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) + end + + test 'At least one of every must support element is provided in any Observation for this patient.' do + metadata do + id '12' + link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + description %( + ) + versions :r4 + end + + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? + must_support_confirmed = {} + must_support_elements = [ + 'Observation.status', + 'Observation.code', + 'Observation.subject', + 'Observation.issued', + 'Observation.valueCodeableConcept' + ] + must_support_elements.each do |path| + @observation_ary&.each do |resource| + truncated_path = path.gsub('Observation.', '') + must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) + break if must_support_confirmed[path] + end + resource_count = @observation_ary.length + + skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] + end + @instance.save! + end + + test 'All references can be resolved' do + metadata do + id '13' + link 'https://www.hl7.org/fhir/DSTU2/references.html' + description %( + ) + versions :r4 + end + + skip_if_not_supported(:Observation, [:search, :read]) + skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + validate_reference_resolutions(@observation) + end + end + end +end diff --git a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb index ab783f3aa..80ab04788 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb @@ -41,16 +41,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Observation search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Observation search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -74,26 +73,25 @@ def validate_resource_item(resource, property, value) versions :r4 end - code_val = ['59576-9'] - code_val.each do |val| - search_params = { 'patient': @instance.patient_id, 'code': val } - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + search_params = { + 'patient': @instance.patient_id, + 'code': '59576-9' + } - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - next unless @resources_found + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - break - end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do @@ -108,10 +106,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -139,9 +138,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -162,10 +162,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -194,10 +195,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -259,10 +261,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id, + 'code': '59576-9' + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb index e57dc486f..f1632d446 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb @@ -41,16 +41,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Observation search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Observation search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -74,26 +73,25 @@ def validate_resource_item(resource, property, value) versions :r4 end - code_val = ['77606-2'] - code_val.each do |val| - search_params = { 'patient': @instance.patient_id, 'code': val } - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + search_params = { + 'patient': @instance.patient_id, + 'code': '77606-2' + } - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - next unless @resources_found + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - break - end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do @@ -108,10 +106,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -139,9 +138,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -162,10 +162,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -194,10 +195,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -259,10 +261,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id, + 'code': '77606-2' + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb index 5c0ca27ce..9e44b4a1f 100644 --- a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb @@ -27,16 +27,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects AllergyIntolerance search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects AllergyIntolerance search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -60,9 +59,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) assert_response_ok(reply) @@ -93,9 +92,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@allergyintolerance.nil?, 'Expected valid AllergyIntolerance resource to be present' - patient_val = @instance.patient_id - clinical_status_val = get_value_for_search_param(resolve_element_from_path(@allergyintolerance_ary, 'clinicalStatus')) - search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } + search_params = { + 'patient': @instance.patient_id, + 'clinical-status': get_value_for_search_param(resolve_element_from_path(@allergyintolerance_ary, 'clinicalStatus')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) @@ -157,9 +157,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb index 7c4ebbcc7..236305364 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -37,16 +37,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects CarePlan search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects CarePlan search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -70,26 +69,25 @@ def validate_resource_item(resource, property, value) versions :r4 end - category_val = ['assess-plan'] - category_val.each do |val| - search_params = { 'patient': @instance.patient_id, 'category': val } - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + search_params = { + 'patient': @instance.patient_id, + 'category': 'assess-plan' + } - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - next unless @resources_found + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - @careplan = reply&.resource&.entry&.first&.resource - @careplan_ary = fetch_all_bundled_resources(reply&.resource) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? - save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) - save_delayed_sequence_references(@careplan_ary) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - break - end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @careplan = reply&.resource&.entry&.first&.resource + @careplan_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) + save_delayed_sequence_references(@careplan_ary) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) end test 'Server returns expected results from CarePlan search by patient+category+date' do @@ -105,10 +103,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) @@ -137,11 +136,12 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) - date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')), + 'date': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) @@ -170,10 +170,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) @@ -235,10 +236,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id, + 'category': 'assess-plan' + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb index 34c06c95a..3c47e51e4 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb @@ -27,16 +27,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects CareTeam search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects CareTeam search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -60,26 +59,25 @@ def validate_resource_item(resource, property, value) versions :r4 end - status_val = ['proposed', 'active', 'suspended', 'inactive', 'entered-in-error'] - status_val.each do |val| - search_params = { 'patient': @instance.patient_id, 'status': val } - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + search_params = { + 'patient': @instance.patient_id, + 'status': 'active' + } - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - next unless @resources_found + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - @careteam = reply&.resource&.entry&.first&.resource - @careteam_ary = fetch_all_bundled_resources(reply&.resource) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? - save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) - save_delayed_sequence_references(@careteam_ary) - validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) - break - end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @careteam = reply&.resource&.entry&.first&.resource + @careteam_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) + save_delayed_sequence_references(@careteam_ary) + validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) end test 'CareTeam read resource supported' do @@ -136,10 +134,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@careteam_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id, + 'status': 'active' + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb index 5e32fba47..45749085b 100644 --- a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb @@ -41,16 +41,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Condition search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Condition search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -74,9 +73,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) assert_response_ok(reply) @@ -107,9 +106,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@condition.nil?, 'Expected valid Condition resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@condition_ary, 'category')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) @@ -130,9 +130,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@condition.nil?, 'Expected valid Condition resource to be present' - patient_val = @instance.patient_id - onset_date_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'onsetDateTime')) - search_params = { 'patient': patient_val, 'onset-date': onset_date_val } + search_params = { + 'patient': @instance.patient_id, + 'onset-date': get_value_for_search_param(resolve_element_from_path(@condition_ary, 'onsetDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) @@ -161,9 +162,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@condition.nil?, 'Expected valid Condition resource to be present' - patient_val = @instance.patient_id - clinical_status_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'clinicalStatus')) - search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } + search_params = { + 'patient': @instance.patient_id, + 'clinical-status': get_value_for_search_param(resolve_element_from_path(@condition_ary, 'clinicalStatus')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) @@ -184,9 +186,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@condition.nil?, 'Expected valid Condition resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@condition_ary, 'code')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) @@ -248,9 +251,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb index c71550ff7..e1cff48ae 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -41,16 +41,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects DiagnosticReport search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects DiagnosticReport search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -74,9 +73,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) assert_response_ok(reply) @@ -106,9 +105,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -128,10 +128,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -159,10 +160,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id, + 'category': 'LAB' + } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) @@ -182,9 +183,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'status': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -205,10 +207,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -293,9 +296,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb index 0c23c8346..8e9039b33 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -41,16 +41,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects DiagnosticReport search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects DiagnosticReport search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -74,9 +73,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) assert_response_ok(reply) @@ -106,9 +105,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -128,10 +128,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -159,10 +160,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id, + 'code': 'LP29684-5' + } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) @@ -182,9 +183,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'status': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -205,10 +207,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -293,9 +296,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb index fa7ee9fd6..4aca8c177 100644 --- a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb @@ -49,16 +49,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects DocumentReference search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects DocumentReference search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -82,9 +81,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) assert_response_ok(reply) @@ -114,8 +113,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - id_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'id')) - search_params = { '_id': id_val } + search_params = { + '_id': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'id')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @@ -135,9 +135,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } + search_params = { + 'patient': @instance.patient_id, + 'type': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @@ -157,10 +158,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'date')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'date')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @@ -180,9 +182,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @@ -203,10 +206,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) - period_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'context.period')) - search_params = { 'patient': patient_val, 'type': type_val, 'period': period_val } + search_params = { + 'patient': @instance.patient_id, + 'type': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')), + 'period': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'context.period')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @@ -235,9 +239,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'status': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @@ -314,9 +319,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb index 8a8eb6dd3..6ca76b8b4 100644 --- a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb @@ -49,16 +49,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Encounter search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Encounter search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -82,9 +81,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) assert_response_ok(reply) @@ -114,8 +113,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - id_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'id')) - search_params = { '_id': id_val } + search_params = { + '_id': get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'id')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @@ -135,9 +135,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - date_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'period')) - patient_val = @instance.patient_id - search_params = { 'date': date_val, 'patient': patient_val } + search_params = { + 'date': get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'period')), + 'patient': @instance.patient_id + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @@ -166,8 +167,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - identifier_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'identifier')) - search_params = { 'identifier': identifier_val } + search_params = { + 'identifier': get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'identifier')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @@ -188,9 +190,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'status': get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @@ -211,9 +214,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - class_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'local_class')) - patient_val = @instance.patient_id - search_params = { 'class': class_val, 'patient': patient_val } + search_params = { + 'class': get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'local_class')), + 'patient': @instance.patient_id + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @@ -234,9 +238,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } + search_params = { + 'patient': @instance.patient_id, + 'type': get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'type')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @@ -298,9 +303,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb index 9e25ddd0f..cb4e5732a 100644 --- a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb @@ -33,16 +33,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Goal search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Goal search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -66,9 +65,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) assert_response_ok(reply) @@ -99,9 +98,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@goal.nil?, 'Expected valid Goal resource to be present' - patient_val = @instance.patient_id - target_date_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'target.dueDate')) - search_params = { 'patient': patient_val, 'target-date': target_date_val } + search_params = { + 'patient': @instance.patient_id, + 'target-date': get_value_for_search_param(resolve_element_from_path(@goal_ary, 'target.dueDate')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) @@ -130,9 +130,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@goal.nil?, 'Expected valid Goal resource to be present' - patient_val = @instance.patient_id - lifecycle_status_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'lifecycleStatus')) - search_params = { 'patient': patient_val, 'lifecycle-status': lifecycle_status_val } + search_params = { + 'patient': @instance.patient_id, + 'lifecycle-status': get_value_for_search_param(resolve_element_from_path(@goal_ary, 'lifecycleStatus')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) @@ -194,9 +195,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb index f40ec870f..9f30834c5 100644 --- a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb @@ -33,16 +33,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Immunization search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Immunization search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -66,9 +65,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) assert_response_ok(reply) @@ -99,9 +98,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@immunization.nil?, 'Expected valid Immunization resource to be present' - patient_val = @instance.patient_id - date_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'date': get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'occurrenceDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) @@ -130,9 +130,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@immunization.nil?, 'Expected valid Immunization resource to be present' - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'status': get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) @@ -194,9 +195,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb index 6adca2e71..7a813a48c 100644 --- a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb @@ -27,16 +27,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Device search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Device search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -60,9 +59,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('Device'), search_params) assert_response_ok(reply) @@ -93,9 +92,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@device.nil?, 'Expected valid Device resource to be present' - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@device_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } + search_params = { + 'patient': @instance.patient_id, + 'type': get_value_for_search_param(resolve_element_from_path(@device_ary, 'type')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Device'), search_params) @@ -157,9 +157,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Device'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb index 166e80939..a4c7c7392 100644 --- a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb @@ -46,9 +46,7 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false @@ -69,9 +67,10 @@ def validate_resource_item(resource, property, value) @resources_found = !@location.nil? end - test 'Server rejects Location search without authorization' do + test :unauthorized_search do metadata do id '02' + name 'Server rejects Location search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -95,8 +94,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } + search_params = { + 'name': get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Location'), search_params) @@ -127,8 +127,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@location.nil?, 'Expected valid Location resource to be present' - address_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address')) - search_params = { 'address': address_val } + search_params = { + 'address': get_value_for_search_param(resolve_element_from_path(@location_ary, 'address')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Location'), search_params) @@ -149,8 +150,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@location.nil?, 'Expected valid Location resource to be present' - address_city_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.city')) - search_params = { 'address-city': address_city_val } + search_params = { + 'address-city': get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.city')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Location'), search_params) @@ -171,8 +173,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@location.nil?, 'Expected valid Location resource to be present' - address_state_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.state')) - search_params = { 'address-state': address_state_val } + search_params = { + 'address-state': get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.state')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Location'), search_params) @@ -193,8 +196,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@location.nil?, 'Expected valid Location resource to be present' - address_postalcode_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.postalCode')) - search_params = { 'address-postalcode': address_postalcode_val } + search_params = { + 'address-postalcode': get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.postalCode')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Location'), search_params) @@ -241,8 +245,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } + search_params = { + 'name': get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' diff --git a/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb index 6ecc85d2c..33772a059 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb @@ -14,9 +14,7 @@ class USCore310MedicationSequence < SequenceBase delayed_sequence details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false diff --git a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb index 318954231..092621806 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb @@ -39,16 +39,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects MedicationRequest search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects MedicationRequest search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -106,10 +105,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - status_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) - search_params = { 'patient': patient_val, 'intent': intent_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'intent': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')), + 'status': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) @@ -130,10 +130,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - encounter_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'encounter')) - search_params = { 'patient': patient_val, 'intent': intent_val, 'encounter': encounter_val } + search_params = { + 'patient': @instance.patient_id, + 'intent': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')), + 'encounter': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'encounter')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) @@ -154,10 +155,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - authoredon_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'authoredOn')) - search_params = { 'patient': patient_val, 'intent': intent_val, 'authoredon': authoredon_val } + search_params = { + 'patient': @instance.patient_id, + 'intent': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')), + 'authoredon': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'authoredOn')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) @@ -219,9 +221,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - search_params = { 'patient': patient_val, 'intent': intent_val } + search_params = { + 'patient': @instance.patient_id, + 'intent': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_include'] = 'MedicationRequest:medication' @@ -241,9 +244,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - intent_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) - search_params = { 'patient': patient_val, 'intent': intent_val } + search_params = { + 'patient': @instance.patient_id, + 'intent': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' diff --git a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb index 7e5d6bb1f..4c860f5c8 100644 --- a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb @@ -41,16 +41,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Observation search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Observation search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -74,26 +73,25 @@ def validate_resource_item(resource, property, value) versions :r4 end - category_val = ['laboratory'] - category_val.each do |val| - search_params = { 'patient': @instance.patient_id, 'category': val } - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + search_params = { + 'patient': @instance.patient_id, + 'category': 'laboratory' + } - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - next unless @resources_found + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - break - end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+code' do @@ -108,9 +106,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -130,10 +129,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -162,10 +162,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -194,10 +195,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -259,10 +261,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id, + 'category': 'laboratory' + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb index 205d2e73b..5428551c3 100644 --- a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb @@ -34,9 +34,7 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false @@ -57,9 +55,10 @@ def validate_resource_item(resource, property, value) @resources_found = !@organization.nil? end - test 'Server rejects Organization search without authorization' do + test :unauthorized_search do metadata do id '02' + name 'Server rejects Organization search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -83,8 +82,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } + search_params = { + 'name': get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) @@ -115,8 +115,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@organization.nil?, 'Expected valid Organization resource to be present' - address_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'address')) - search_params = { 'address': address_val } + search_params = { + 'address': get_value_for_search_param(resolve_element_from_path(@organization_ary, 'address')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) @@ -163,8 +164,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } + search_params = { + 'name': get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' diff --git a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb index bcd9783ac..182430d92 100644 --- a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb @@ -56,9 +56,7 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false @@ -81,17 +79,18 @@ def validate_resource_item(resource, property, value) assert_response_unauthorized reply end - test :id_search do + test 'Server returns expected results from Patient search by _id' do metadata do id '02' - name 'Server returns expected results from Patient search by _id' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) versions :r4 end - search_params = { '_id': @instance.patient_id } + search_params = { + '_id': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) assert_response_ok(reply) @@ -109,10 +108,9 @@ def validate_resource_item(resource, property, value) validate_search_reply(versioned_resource_class('Patient'), reply, search_params) end - test :identifier_search do + test 'Server returns expected results from Patient search by identifier' do metadata do id '03' - name 'Server returns expected results from Patient search by identifier' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -122,8 +120,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@patient.nil?, 'Expected valid Patient resource to be present' - identifier_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'identifier')) - search_params = { 'identifier': identifier_val } + search_params = { + 'identifier': get_value_for_search_param(resolve_element_from_path(@patient_ary, 'identifier')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @@ -143,8 +142,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@patient.nil?, 'Expected valid Patient resource to be present' - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'name': name_val } + search_params = { + 'name': get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @@ -164,9 +164,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@patient.nil?, 'Expected valid Patient resource to be present' - gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'gender': gender_val, 'name': name_val } + search_params = { + 'gender': get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')), + 'name': get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @@ -186,9 +187,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@patient.nil?, 'Expected valid Patient resource to be present' - birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'birthdate': birthdate_val, 'name': name_val } + search_params = { + 'birthdate': get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')), + 'name': get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @@ -209,9 +211,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@patient.nil?, 'Expected valid Patient resource to be present' - birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) - family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) - search_params = { 'birthdate': birthdate_val, 'family': family_val } + search_params = { + 'birthdate': get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')), + 'family': get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @@ -232,9 +235,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@patient.nil?, 'Expected valid Patient resource to be present' - family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) - gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) - search_params = { 'family': family_val, 'gender': gender_val } + search_params = { + 'family': get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')), + 'gender': get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @@ -296,7 +300,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { '_id': @instance.patient_id } + search_params = { + '_id': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb index 2b8f44ac7..e2616ad26 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb @@ -35,9 +35,7 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false @@ -58,9 +56,10 @@ def validate_resource_item(resource, property, value) @resources_found = !@practitioner.nil? end - test 'Server rejects Practitioner search without authorization' do + test :unauthorized_search do metadata do id '02' + name 'Server rejects Practitioner search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -84,8 +83,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } + search_params = { + 'name': get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) @@ -116,8 +116,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@practitioner.nil?, 'Expected valid Practitioner resource to be present' - identifier_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'identifier')) - search_params = { 'identifier': identifier_val } + search_params = { + 'identifier': get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'identifier')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) @@ -164,8 +165,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } + search_params = { + 'name': get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' diff --git a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb index 9a3a36053..37a1577a4 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb @@ -28,9 +28,7 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false @@ -51,9 +49,10 @@ def validate_resource_item(resource, property, value) @resources_found = !@practitionerrole.nil? end - test 'Server rejects PractitionerRole search without authorization' do + test :unauthorized_search do metadata do id '02' + name 'Server rejects PractitionerRole search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -77,8 +76,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } + search_params = { + 'specialty': get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) @@ -109,8 +109,9 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@practitionerrole.nil?, 'Expected valid PractitionerRole resource to be present' - practitioner_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'practitioner')) - search_params = { 'practitioner': practitioner_val } + search_params = { + 'practitioner': get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'practitioner')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) @@ -157,8 +158,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } + search_params = { + 'specialty': get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_include'] = 'PractitionerRole:endpoint' @@ -185,8 +187,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } + search_params = { + 'specialty': get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' diff --git a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb index e87e16c92..62492e5f7 100644 --- a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb @@ -37,16 +37,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Procedure search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Procedure search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -70,9 +69,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) assert_response_ok(reply) @@ -102,9 +101,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - patient_val = @instance.patient_id - date_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'date': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) @@ -133,10 +133,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) @@ -165,9 +166,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'status': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) @@ -229,9 +231,9 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb index ce92f5f4b..33d51999d 100644 --- a/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb @@ -14,9 +14,7 @@ class USCore310ProvenanceSequence < SequenceBase delayed_sequence details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false diff --git a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb index 16c0be7f6..25c4c4d46 100644 --- a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb @@ -41,16 +41,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Observation search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Observation search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -74,26 +73,25 @@ def validate_resource_item(resource, property, value) versions :r4 end - code_val = ['2708-6', '59408-5'] - code_val.each do |val| - search_params = { 'patient': @instance.patient_id, 'code': val } - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + search_params = { + 'patient': @instance.patient_id, + 'code': '59408-5' + } - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - next unless @resources_found + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - break - end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do @@ -108,10 +106,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -139,9 +138,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -162,10 +162,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -194,10 +195,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -259,10 +261,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id, + 'code': '59408-5' + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb index a2b757a24..b26d51446 100644 --- a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb @@ -41,16 +41,15 @@ def validate_resource_item(resource, property, value) end details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) @resources_found = false - test 'Server rejects Observation search without authorization' do + test :unauthorized_search do metadata do id '01' + name 'Server rejects Observation search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( ) @@ -74,26 +73,25 @@ def validate_resource_item(resource, property, value) versions :r4 end - code_val = ['72166-2'] - code_val.each do |val| - search_params = { 'patient': @instance.patient_id, 'code': val } - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + search_params = { + 'patient': @instance.patient_id, + 'code': '72166-2' + } - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - next unless @resources_found + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - break - end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do @@ -108,10 +106,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -139,9 +138,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -162,10 +162,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - date_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'code': code_val, 'date': date_val } + search_params = { + 'patient': @instance.patient_id, + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -194,10 +195,11 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found assert !@observation.nil?, 'Expected valid Observation resource to be present' - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } + search_params = { + 'patient': @instance.patient_id, + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) + } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @@ -259,10 +261,10 @@ def validate_resource_item(resource, property, value) versions :r4 end - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + search_params = { + 'patient': @instance.patient_id, + 'code': '72166-2' + } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/test/sequence/us_core_patient_sequence_test.rb b/test/sequence/us_core_patient_sequence_test.rb index 4920b79b6..526cf0f2b 100644 --- a/test/sequence/us_core_patient_sequence_test.rb +++ b/test/sequence/us_core_patient_sequence_test.rb @@ -2,9 +2,9 @@ require_relative '../test_helper' -describe Inferno::Sequence::USCore301PatientSequence do +describe Inferno::Sequence::USCore310PatientSequence do before do - @sequence_class = Inferno::Sequence::USCore301PatientSequence + @sequence_class = Inferno::Sequence::USCore310PatientSequence @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' From bfc542e70a4fc12f8a0277ee24d1f36fc60517ca Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 13 Nov 2019 10:19:14 -0500 Subject: [PATCH 090/173] initial unit test generation --- .../unit_tests/authorization_unit_test.rb.erb | 35 +++ .../templates/unit_tests/unit_test.rb.erb | 21 ++ .../uscore/us_core_unit_test_generator.rb | 50 ++++ generator/uscore/uscore_generator.rb | 16 +- .../sequence/us_core_patient_sequence_test.rb | 262 +++++++++--------- 5 files changed, 248 insertions(+), 136 deletions(-) create mode 100644 generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb create mode 100644 generator/uscore/templates/unit_tests/unit_test.rb.erb create mode 100644 generator/uscore/us_core_unit_test_generator.rb diff --git a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb new file mode 100644 index 000000000..8c47fcf69 --- /dev/null +++ b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb @@ -0,0 +1,35 @@ + describe 'unauthorized search test' do + before do + @test = @sequence_class[:<%= key %>] + @sequence = @sequence_class.new(@instance, @client) + @query = { + <%= search_param_string %> + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/<%= resource_type %>") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "Bad response code: expected 401, but found 200", exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/<%= resource_type %>") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end diff --git a/generator/uscore/templates/unit_tests/unit_test.rb.erb b/generator/uscore/templates/unit_tests/unit_test.rb.erb new file mode 100644 index 000000000..9054d7246 --- /dev/null +++ b/generator/uscore/templates/unit_tests/unit_test.rb.erb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::<%= class_name %> do + before do + @sequence_class = Inferno::Sequence::<%= class_name %> + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + +<% tests.each do |test| %> + <%= test %> +<% end %> + +end diff --git a/generator/uscore/us_core_unit_test_generator.rb b/generator/uscore/us_core_unit_test_generator.rb new file mode 100644 index 000000000..67e0d0348 --- /dev/null +++ b/generator/uscore/us_core_unit_test_generator.rb @@ -0,0 +1,50 @@ +# frozen_string_literal: true + +module Inferno + module Generator + class USCoreUnitTestGenerator + def tests + @tests ||= Hash.new { |hash, key| hash[key] = [] } + end + + def generate(sequence, path) + template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'unit_test.rb.erb'))) + class_name = sequence[:class_name] + unit_tests = template.result_with_hash( + class_name: class_name, + tests: tests[class_name] + ) + + test_path = File.join(path, 'test') + FileUtils.mkdir_p(test_path) unless File.directory?(test_path) + + file_name = File.join(test_path, "#{sequence[:name].downcase}_test.rb") + File.write(file_name, unit_tests) + end + + def generate_authorization_test(key:, resource_type:, search_params:, class_name:) + template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'authorization_unit_test.rb.erb'))) + test = template.result_with_hash( + key: key, + resource_type: resource_type, + search_param_string: search_params_to_string(search_params) + ) + tests[class_name] << test + end + + def search_params_to_string(search_params) + search_params.map do |param, value| + if value.start_with? 'get_value_for_search_param' + path = value.match(/'(\w+)'/)[1] + variable_name = value.match(/(@\w+)/)[1] + "'#{param}': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(#{variable_name}, '#{path}'))" + elsif value.start_with? '@' + "'#{param}': #{value}" + else + "'#{param}': '#{value}'" + end + end.join(",\n") + end + end + end +end diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 957ca2906..a8018c842 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -3,6 +3,7 @@ require_relative './metadata_extractor' require_relative '../../lib/app/utils/validation' require_relative '../generator_base' +require_relative './us_core_unit_test_generator' module Inferno module Generator @@ -11,6 +12,10 @@ class USCoreGenerator < Generator::Base PROFILE_URIS = Inferno::ValidationUtil::US_CORE_R4_URIS + def unit_test_generator + @unit_test_generator ||= USCoreUnitTestGenerator.new + end + def validation_profile_uri(sequence) profile_uri = PROFILE_URIS.key(sequence[:profile]) "Inferno::ValidationUtil::US_CORE_R4_URIS[:#{profile_uri}]" if profile_uri @@ -22,6 +27,7 @@ def generate generate_search_validators(metadata) metadata[:sequences].each do |sequence| generate_sequence(sequence) + unit_test_generator.generate(sequence, sequence_out_path) end generate_module(metadata) end @@ -134,12 +140,12 @@ def create_authorization_test(sequence) assert_response_unauthorized reply) sequence[:tests] << authorization_test - # unit_test_generator.generate_authorization_test( - { + unit_test_generator.generate_authorization_test( key: key, - resourceType: sequence[:resource], - search_param: first_search[:names] - }# ) + resource_type: sequence[:resource], + search_params: get_search_param_hash(first_search[:names], sequence), + class_name: sequence[:class_name] + ) end def create_include_test(sequence) diff --git a/test/sequence/us_core_patient_sequence_test.rb b/test/sequence/us_core_patient_sequence_test.rb index 526cf0f2b..0c0cf6c40 100644 --- a/test/sequence/us_core_patient_sequence_test.rb +++ b/test/sequence/us_core_patient_sequence_test.rb @@ -48,179 +48,179 @@ end end - describe 'id search test' do - before do - @test = @sequence_class[:id_search] - @sequence = @sequence_class.new(@instance, @client) - @query = { _id: @patient_id } - end + # describe 'id search test' do + # before do + # @test = @sequence_class[:id_search] + # @sequence = @sequence_class.new(@instance, @client) + # @query = { _id: @patient_id } + # end - it 'fails when the search response has a status other than 200' do - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 401) + # it 'fails when the search response has a status other than 200' do + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 401) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message - end + # assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message + # end - it 'fails when a resource other than a bundle is returned' do - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: FHIR::Patient.new.to_json) + # it 'fails when a resource other than a bundle is returned' do + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 200, body: FHIR::Patient.new.to_json) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Expected FHIR Bundle but found: Patient", exception.message - end + # assert_equal "Expected FHIR Bundle but found: Patient", exception.message + # end - it 'skips the test if no results are found' do - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: FHIR::Bundle.new.to_json) + # it 'skips the test if no results are found' do + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 200, body: FHIR::Bundle.new.to_json) - exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } - assert_equal 'No resources appear to be available for this patient. Please use patients with more information.', exception.message - end + # assert_equal 'No resources appear to be available for this patient. Please use patients with more information.', exception.message + # end - it 'fails when the Patient id does not match the requested id' do - @instance.patient_id = @patient_id - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: wrap_resources_in_bundle(FHIR::Patient.new(id: 'ID')).to_json) + # it 'fails when the Patient id does not match the requested id' do + # @instance.patient_id = @patient_id + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 200, body: wrap_resources_in_bundle(FHIR::Patient.new(id: 'ID')).to_json) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal '_id on resource does not match _id requested', exception.message - end + # assert_equal '_id on resource does not match _id requested', exception.message + # end - it 'fails when the Patient resource is invalid' do - bad_patient = FHIR::Patient.new(id: @patient_id) - bad_patient.gender = 'BAD_GENDER' - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: wrap_resources_in_bundle(bad_patient).to_json) + # it 'fails when the Patient resource is invalid' do + # bad_patient = FHIR::Patient.new(id: @patient_id) + # bad_patient.gender = 'BAD_GENDER' + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 200, body: wrap_resources_in_bundle(bad_patient).to_json) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert exception.message.start_with? 'Invalid Patient:' - end + # assert exception.message.start_with? 'Invalid Patient:' + # end - it 'succeeds whan a patient with the correct ID is returned' do - patient = FHIR::Patient.new(id: @patient_id) - @sequence.instance_variable_set(:'@patient', patient) - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: wrap_resources_in_bundle(patient).to_json) + # it 'succeeds whan a patient with the correct ID is returned' do + # patient = FHIR::Patient.new(id: @patient_id) + # @sequence.instance_variable_set(:'@patient', patient) + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 200, body: wrap_resources_in_bundle(patient).to_json) - @sequence.run_test(@test) - end - end + # @sequence.run_test(@test) + # end + # end - describe 'identifier search test' do - before do - @test = @sequence_class[:identifier_search] - @sequence = @sequence_class.new(@instance, @client) - @identifier_value = 'ABC' - @identifier_system = 'http://www.example.com' - @patient = FHIR::Patient.new( - id: @patient_id, - identifier: [{ system: @identifier_system, value: @identifier_value }] - ) - @query = { identifier: @identifier_value } - @sequence.instance_variable_set(:'@resources_found', true) - @sequence.instance_variable_set(:'@patient', @patient) - @sequence.instance_variable_set(:'@patient_ary', [@patient]) - end + # describe 'identifier search test' do + # before do + # @test = @sequence_class[:identifier_search] + # @sequence = @sequence_class.new(@instance, @client) + # @identifier_value = 'ABC' + # @identifier_system = 'http://www.example.com' + # @patient = FHIR::Patient.new( + # id: @patient_id, + # identifier: [{ system: @identifier_system, value: @identifier_value }] + # ) + # @query = { identifier: @identifier_value } + # @sequence.instance_variable_set(:'@resources_found', true) + # @sequence.instance_variable_set(:'@patient', @patient) + # @sequence.instance_variable_set(:'@patient_ary', [@patient]) + # end - it 'skips when no resources have been found' do - @sequence.instance_variable_set(:'@resources_found', false) + # it 'skips when no resources have been found' do + # @sequence.instance_variable_set(:'@resources_found', false) - exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } - assert_equal 'No resources appear to be available for this patient. Please use patients with more information.', exception.message - end + # assert_equal 'No resources appear to be available for this patient. Please use patients with more information.', exception.message + # end - it 'skips when none of the resources have an identifier' do - @sequence.instance_variable_set(:'@patient_ary', [FHIR::Patient.new]) + # it 'skips when none of the resources have an identifier' do + # @sequence.instance_variable_set(:'@patient_ary', [FHIR::Patient.new]) - exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } - assert_equal 'Could not resolve identifier in given resource', exception.message - end + # assert_equal 'Could not resolve identifier in given resource', exception.message + # end - it 'fails when no Patient resource has been found' do - @sequence.instance_variable_set(:'@patient', nil) + # it 'fails when no Patient resource has been found' do + # @sequence.instance_variable_set(:'@patient', nil) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal 'Expected valid Patient resource to be present', exception.message - end + # assert_equal 'Expected valid Patient resource to be present', exception.message + # end - it 'fails when the search response has a status other than 200' do - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 401) + # it 'fails when the search response has a status other than 200' do + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 401) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message - end + # assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message + # end - it 'fails when a resource other than a bundle is returned' do - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: FHIR::Patient.new.to_json) + # it 'fails when a resource other than a bundle is returned' do + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 200, body: FHIR::Patient.new.to_json) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Expected FHIR Bundle but found: Patient", exception.message - end + # assert_equal "Expected FHIR Bundle but found: Patient", exception.message + # end - it 'fails when no results are found' do - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: FHIR::Bundle.new.to_json) + # it 'fails when no results are found' do + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 200, body: FHIR::Bundle.new.to_json) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal 'No resources of this type were returned', exception.message - end + # assert_equal 'No resources of this type were returned', exception.message + # end - it 'fails when a Patient identifier does not match the requested identifier' do - # @instance.patient_id = @patient_id - patient = FHIR::Patient.new( - id: '456', - identifier: [{ system: @identifier_system, value: 'DEF' }] - ) - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: wrap_resources_in_bundle([@patient, patient]).to_json) + # it 'fails when a Patient identifier does not match the requested identifier' do + # # @instance.patient_id = @patient_id + # patient = FHIR::Patient.new( + # id: '456', + # identifier: [{ system: @identifier_system, value: 'DEF' }] + # ) + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 200, body: wrap_resources_in_bundle([@patient, patient]).to_json) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal 'identifier on resource does not match identifier requested', exception.message - end + # assert_equal 'identifier on resource does not match identifier requested', exception.message + # end - it 'fails when the Patient resource is invalid' do - @patient.gender = 'BAD_GENDER' - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: wrap_resources_in_bundle(@patient).to_json) + # it 'fails when the Patient resource is invalid' do + # @patient.gender = 'BAD_GENDER' + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 200, body: wrap_resources_in_bundle(@patient).to_json) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert exception.message.start_with? 'Invalid Patient:' - end + # assert exception.message.start_with? 'Invalid Patient:' + # end - it 'succeeds whan a Patient with the correct identifier is returned' do - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: wrap_resources_in_bundle(@patient).to_json) + # it 'succeeds whan a Patient with the correct identifier is returned' do + # stub_request(:get, "#{@base_url}/Patient") + # .with(query: @query, headers: @auth_header) + # .to_return(status: 200, body: wrap_resources_in_bundle(@patient).to_json) - @sequence.run_test(@test) - end - end + # @sequence.run_test(@test) + # end + # end end From c93b384e6712f8417188520c723429150d35eb85 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 13 Nov 2019 14:53:44 -0500 Subject: [PATCH 091/173] WIP --- .../unit_tests/authorization_unit_test.rb.erb | 56 ++++++++++--------- .../uscore/us_core_unit_test_generator.rb | 39 +++++++++++-- 2 files changed, 64 insertions(+), 31 deletions(-) diff --git a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb index 8c47fcf69..01f1e0de6 100644 --- a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb @@ -1,35 +1,39 @@ - describe 'unauthorized search test' do - before do - @test = @sequence_class[:<%= key %>] - @sequence = @sequence_class.new(@instance, @client) - @query = { - <%= search_param_string %> - } - end +describe 'unauthorized search test' do + before do + @test = @sequence_class[:<%= key %>] + @sequence = @sequence_class.new(@instance, @client) + @query = { + <%= search_param_string %> + } +<% if dynamic_search_params.present? %> + <% dynamic_search_params.each do %> + @sequence.instance_variable_set('<%= %>') +<% end %> + end - it 'fails when the token refresh response has a success status' do - stub_request(:get, "#{@base_url}/<%= resource_type %>") - .with(query: @query) - .to_return(status: 200) + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/<%= resource_type %>") + .with(query: @query) + .to_return(status: 200) - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Bad response code: expected 401, but found 200", exception.message - end + assert_equal "Bad response code: expected 401, but found 200", exception.message + end - it 'succeeds when the token refresh response has an error status' do - stub_request(:get, "#{@base_url}/<%= resource_type %>") - .with(query: @query) - .to_return(status: 401) + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/<%= resource_type %>") + .with(query: @query) + .to_return(status: 401) - @sequence.run_test(@test) - end + @sequence.run_test(@test) + end - it 'is omitted when no token is set' do - @instance.token = '' + it 'is omitted when no token is set' do + @instance.token = '' - exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } - assert_equal 'Do not test if no bearer token set', exception.message - end + assert_equal 'Do not test if no bearer token set', exception.message end +end diff --git a/generator/uscore/us_core_unit_test_generator.rb b/generator/uscore/us_core_unit_test_generator.rb index 67e0d0348..ff19cb17a 100644 --- a/generator/uscore/us_core_unit_test_generator.rb +++ b/generator/uscore/us_core_unit_test_generator.rb @@ -27,17 +27,16 @@ def generate_authorization_test(key:, resource_type:, search_params:, class_name test = template.result_with_hash( key: key, resource_type: resource_type, - search_param_string: search_params_to_string(search_params) + search_param_string: search_params_to_string(search_params), + dynamic_search_params: dynamic_search_params(search_params) ) tests[class_name] << test end def search_params_to_string(search_params) search_params.map do |param, value| - if value.start_with? 'get_value_for_search_param' - path = value.match(/'(\w+)'/)[1] - variable_name = value.match(/(@\w+)/)[1] - "'#{param}': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(#{variable_name}, '#{path}'))" + if dynamic_search_param? value + dynamic_search_param_string(param, value) elsif value.start_with? '@' "'#{param}': #{value}" else @@ -45,6 +44,36 @@ def search_params_to_string(search_params) end end.join(",\n") end + + def dynamic_search_param_string(param, value) + param_info = dynamic_search_param(value) + path = param_info[:path] + variable_name = param_info[:variable_name] + variable_name = value.match(/(@\w+)/)[1] + "'#{param}': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(#{variable_name}, '#{path}'))" + end + + # def dynamic_search_params?(search_params) + # search_params.any? { |_param, value| dynamic_search_param? value } + # end + + def dynamic_search_param?(param_value) + param_value.start_with? 'get_value_for_search_param' + end + + def dynamic_search_params(search_params) + search_params + .select { |_param, value| dynamic_search_param?(value) } + .transform_value { |value| dynamic_search_param(value) } + end + + def dynamic_search_param(param_value) + match = value.match(/(@\w+).*'([\w\.]+)'/) + { + variable_name: match[1], + resource_path: match[2] + } + end end end end From d7cfb487c7ca0d48761bcff2d9ee4546447d6c7b Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Wed, 13 Nov 2019 16:09:29 -0500 Subject: [PATCH 092/173] add fixtures and fix generation --- .../unit_tests/authorization_unit_test.rb.erb | 13 +- .../uscore/us_core_unit_test_generator.rb | 14 +- generator/uscore/uscore_generator.rb | 28 +- .../us_core_allergyintolerance_sequence.rb | 213 --------- .../us_core_careplan_sequence.rb | 288 ------------ .../us_core_careteam_sequence.rb | 187 -------- .../us_core_condition_sequence.rb | 305 ------------ .../uscore_v3.0.0/us_core_device_sequence.rb | 214 --------- .../us_core_documentreference_sequence.rb | 383 --------------- .../us_core_encounter_sequence.rb | 367 --------------- .../uscore_v3.0.0/us_core_goal_sequence.rb | 252 ---------- .../us_core_immunization_sequence.rb | 253 ---------- .../us_core_location_sequence.rb | 302 ------------ .../us_core_medication_sequence.rb | 124 ----- .../us_core_medicationrequest_sequence.rb | 264 ----------- .../us_core_medicationstatement_sequence.rb | 275 ----------- .../us_core_organization_sequence.rb | 227 --------- .../uscore_v3.0.0/us_core_patient_sequence.rb | 375 --------------- .../us_core_practitioner_sequence.rb | 223 --------- .../us_core_practitionerrole_sequence.rb | 246 ---------- .../pediatric_bmi_for_age_sequence.rb | 350 -------------- .../pediatric_weight_for_height_sequence.rb | 350 -------------- .../us_core_diagnosticreport_lab_sequence.rb | 440 ------------------ .../us_core_diagnosticreport_note_sequence.rb | 439 ----------------- .../us_core_observation_lab_sequence.rb | 340 -------------- .../us_core_procedure_sequence.rb | 294 ------------ .../us_core_smokingstatus_sequence.rb | 326 ------------- .../us_core_location_location_ary.json | 6 + ...dicationrequest_medicationrequest_ary.json | 7 + ...us_core_organization_organization_ary.json | 6 + ...us_core_practitioner_practitioner_ary.json | 12 + ...practitionerrole_practitionerrole_ary.json | 14 + .../test/pediatric_bmi_for_age_test.rb | 54 +++ .../test/pediatric_weight_for_height_test.rb | 54 +++ .../test/us_core_allergyintolerance_test.rb | 53 +++ .../test/us_core_careplan_test.rb | 54 +++ .../test/us_core_careteam_test.rb | 54 +++ .../test/us_core_condition_test.rb | 53 +++ .../test/us_core_diagnosticreport_lab_test.rb | 54 +++ .../us_core_diagnosticreport_note_test.rb | 54 +++ .../test/us_core_documentreference_test.rb | 53 +++ .../test/us_core_encounter_test.rb | 53 +++ .../uscore_v3.1.0/test/us_core_goal_test.rb | 53 +++ .../test/us_core_immunization_test.rb | 53 +++ .../test/us_core_implantable_device_test.rb | 53 +++ .../test/us_core_location_test.rb | 57 +++ .../test/us_core_medicationrequest_test.rb | 63 +++ .../test/us_core_observation_lab_test.rb | 54 +++ .../test/us_core_organization_test.rb | 57 +++ .../test/us_core_patient_test.rb | 53 +++ .../test/us_core_practitioner_test.rb | 57 +++ .../test/us_core_practitionerrole_test.rb | 57 +++ .../test/us_core_procedure_test.rb | 53 +++ .../test/us_core_pulse_oximetry_test.rb | 54 +++ .../test/us_core_smokingstatus_test.rb | 54 +++ .../sequence/us_core_patient_sequence_test.rb | 2 +- 56 files changed, 1332 insertions(+), 7061 deletions(-) delete mode 100644 lib/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_careplan_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_careteam_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_condition_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_device_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_encounter_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_goal_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_immunization_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_location_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_medication_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_organization_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_patient_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.1/us_core_procedure_sequence.rb delete mode 100644 lib/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb create mode 100644 lib/modules/uscore_v3.1.0/test/fixtures/us_core_location_location_ary.json create mode 100644 lib/modules/uscore_v3.1.0/test/fixtures/us_core_medicationrequest_medicationrequest_ary.json create mode 100644 lib/modules/uscore_v3.1.0/test/fixtures/us_core_organization_organization_ary.json create mode 100644 lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitioner_practitioner_ary.json create mode 100644 lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitionerrole_practitionerrole_ary.json create mode 100644 lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_location_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb diff --git a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb index 01f1e0de6..3b69d3c50 100644 --- a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb @@ -2,13 +2,16 @@ describe 'unauthorized search test' do before do @test = @sequence_class[:<%= key %>] @sequence = @sequence_class.new(@instance, @client) +<% if dynamic_search_params.present? %> + <% dynamic_search_params.each do |_param, search_param| %> + <%= search_param[:variable_name] %> = load_json_fixture(:<%= "#{name}_#{search_param[:variable_name][1..-1]}" %>) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'<%= search_param[:variable_name] %>', <%= search_param[:variable_name] %>) + <% end %> +<% end %> @query = { <%= search_param_string %> } -<% if dynamic_search_params.present? %> - <% dynamic_search_params.each do %> - @sequence.instance_variable_set('<%= %>') -<% end %> end it 'fails when the token refresh response has a success status' do @@ -18,7 +21,7 @@ describe 'unauthorized search test' do exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Bad response code: expected 401, but found 200", exception.message + assert_equal 'Bad response code: expected 401, but found 200', exception.message end it 'succeeds when the token refresh response has an error status' do diff --git a/generator/uscore/us_core_unit_test_generator.rb b/generator/uscore/us_core_unit_test_generator.rb index ff19cb17a..0c44fb844 100644 --- a/generator/uscore/us_core_unit_test_generator.rb +++ b/generator/uscore/us_core_unit_test_generator.rb @@ -22,10 +22,11 @@ def generate(sequence, path) File.write(file_name, unit_tests) end - def generate_authorization_test(key:, resource_type:, search_params:, class_name:) + def generate_authorization_test(key:, name:, resource_type:, search_params:, class_name:) template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'authorization_unit_test.rb.erb'))) test = template.result_with_hash( key: key, + name: name, resource_type: resource_type, search_param_string: search_params_to_string(search_params), dynamic_search_params: dynamic_search_params(search_params) @@ -47,16 +48,11 @@ def search_params_to_string(search_params) def dynamic_search_param_string(param, value) param_info = dynamic_search_param(value) - path = param_info[:path] + path = param_info[:resource_path] variable_name = param_info[:variable_name] - variable_name = value.match(/(@\w+)/)[1] "'#{param}': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(#{variable_name}, '#{path}'))" end - # def dynamic_search_params?(search_params) - # search_params.any? { |_param, value| dynamic_search_param? value } - # end - def dynamic_search_param?(param_value) param_value.start_with? 'get_value_for_search_param' end @@ -64,11 +60,11 @@ def dynamic_search_param?(param_value) def dynamic_search_params(search_params) search_params .select { |_param, value| dynamic_search_param?(value) } - .transform_value { |value| dynamic_search_param(value) } + .transform_values { |value| dynamic_search_param(value) } end def dynamic_search_param(param_value) - match = value.match(/(@\w+).*'([\w\.]+)'/) + match = param_value.match(/(@\w+).*'([\w\.]+)'/) { variable_name: match[1], resource_path: match[2] diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index a8018c842..94525f10f 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -142,6 +142,7 @@ def create_authorization_test(sequence) sequence[:tests] << authorization_test unit_test_generator.generate_authorization_test( key: key, + name: sequence[:name], resource_type: sequence[:resource], search_params: get_search_param_hash(first_search[:names], sequence), class_name: sequence[:class_name] @@ -493,16 +494,25 @@ def get_comparator_searches(search_params, sequence) end def search_param_constants(search_parameters, sequence) - return { patient: '@instance.patient_id', category: 'assess-plan'} if search_parameters == ['patient', 'category'] && sequence[:resource] == 'CarePlan' - return { patient: '@instance.patient_id', status: 'active' } if search_parameters == ['patient', 'status'] && sequence[:resource] == 'CareTeam' + return { patient: '@instance.patient_id', category: 'assess-plan' } if search_parameters == ['patient', 'category'] && + sequence[:resource] == 'CarePlan' + return { patient: '@instance.patient_id', status: 'active' } if search_parameters == ['patient', 'status'] && + sequence[:resource] == 'CareTeam' return { '_id': '@instance.patient_id' } if search_parameters == ['_id'] && sequence[:resource] == 'Patient' - return { patient: '@instance.patient_id', code: '72166-2' } if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:smoking_status] - return { patient: '@instance.patient_id', category: 'laboratory' } if search_parameters == ['patient', 'category'] && sequence[:profile] == PROFILE_URIS[:lab_results] - return { patient: '@instance.patient_id', code: '77606-2' } if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:pediatric_weight_height] - return { patient: '@instance.patient_id', code: '59576-9' } if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:pediatric_bmi_age] - return { patient: '@instance.patient_id', category: 'LAB' } if search_parameters == ['patient', 'category'] && sequence[:profile] == PROFILE_URIS[:diagnostic_report_lab] - return { patient: '@instance.patient_id', code: 'LP29684-5' } if search_parameters == ['patient', 'category'] && sequence[:profile] == PROFILE_URIS[:diagnostic_report_note] - return { patient: '@instance.patient_id', code: '59408-5' } if search_parameters == ['patient', 'code'] && sequence[:profile] == PROFILE_URIS[:pulse_oximetry] + return { patient: '@instance.patient_id', code: '72166-2' } if search_parameters == ['patient', 'code'] && + sequence[:profile] == PROFILE_URIS[:smoking_status] + return { patient: '@instance.patient_id', category: 'laboratory' } if search_parameters == ['patient', 'category'] && + sequence[:profile] == PROFILE_URIS[:lab_results] + return { patient: '@instance.patient_id', code: '77606-2' } if search_parameters == ['patient', 'code'] && + sequence[:profile] == PROFILE_URIS[:pediatric_weight_height] + return { patient: '@instance.patient_id', code: '59576-9' } if search_parameters == ['patient', 'code'] && + sequence[:profile] == PROFILE_URIS[:pediatric_bmi_age] + return { patient: '@instance.patient_id', category: 'LAB' } if search_parameters == ['patient', 'category'] && + sequence[:profile] == PROFILE_URIS[:diagnostic_report_lab] + return { patient: '@instance.patient_id', code: 'LP29684-5' } if search_parameters == ['patient', 'category'] && + sequence[:profile] == PROFILE_URIS[:diagnostic_report_note] + return { patient: '@instance.patient_id', code: '59408-5' } if search_parameters == ['patient', 'code'] && + sequence[:profile] == PROFILE_URIS[:pulse_oximetry] end def create_search_validation(sequence) diff --git a/lib/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb deleted file mode 100644 index b885ad027..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_allergyintolerance_sequence.rb +++ /dev/null @@ -1,213 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300AllergyintoleranceSequence < SequenceBase - title 'AllergyIntolerance Tests' - - description 'Verify that AllergyIntolerance resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCAI' - - requires :token, :patient_id - conformance_supports :AllergyIntolerance - - def validate_resource_item(resource, property, value) - case property - - when 'clinical-status' - value_found = can_resolve_path(resource, 'clinicalStatus.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'clinical-status on resource does not match clinical-status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects AllergyIntolerance search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from AllergyIntolerance search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @allergyintolerance = reply&.resource&.entry&.first&.resource - @allergyintolerance_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('AllergyIntolerance'), reply) - save_delayed_sequence_references(@allergyintolerance_ary) - validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) - end - - test 'Server returns expected results from AllergyIntolerance search by patient+clinical-status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@allergyintolerance.nil?, 'Expected valid AllergyIntolerance resource to be present' - - patient_val = @instance.patient_id - clinical_status_val = get_value_for_search_param(resolve_element_from_path(@allergyintolerance_ary, 'clinicalStatus')) - search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) - validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) - assert_response_ok(reply) - end - - test 'AllergyIntolerance read resource supported' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) - end - - test 'AllergyIntolerance vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) - end - - test 'AllergyIntolerance history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) - end - - test 'AllergyIntolerance resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '07' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('AllergyIntolerance') - end - - test 'At least one of every must support element is provided in any AllergyIntolerance for this patient.' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @allergyintolerance_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'AllergyIntolerance.clinicalStatus', - 'AllergyIntolerance.verificationStatus', - 'AllergyIntolerance.code', - 'AllergyIntolerance.patient' - ] - must_support_elements.each do |path| - @allergyintolerance_ary&.each do |resource| - truncated_path = path.gsub('AllergyIntolerance.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @allergyintolerance_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided AllergyIntolerance resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:AllergyIntolerance, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@allergyintolerance) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_careplan_sequence.rb deleted file mode 100644 index 4b7c9d1f8..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_careplan_sequence.rb +++ /dev/null @@ -1,288 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300CareplanSequence < SequenceBase - title 'CarePlan Tests' - - description 'Verify that CarePlan resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCCP' - - requires :token, :patient_id - conformance_supports :CarePlan - - def validate_resource_item(resource, property, value) - case property - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'date' - value_found = can_resolve_path(resource, 'period') do |period| - validate_period_search(value, period) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects CarePlan search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, category: 'assess-plan' } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from CarePlan search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, category: 'assess-plan' } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @careplan = reply&.resource&.entry&.first&.resource - @careplan_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) - save_delayed_sequence_references(@careplan_ary) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - end - - test 'Server returns expected results from CarePlan search by patient+category+status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from CarePlan search by patient+category+status+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - status_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) - date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) - search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'status': status_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from CarePlan search by patient+category+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('CarePlan'), comparator_search_params) - validate_search_reply(versioned_resource_class('CarePlan'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'CarePlan read resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@careplan, versioned_resource_class('CarePlan')) - end - - test 'CarePlan vread resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@careplan, versioned_resource_class('CarePlan')) - end - - test 'CarePlan history resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@careplan, versioned_resource_class('CarePlan')) - end - - test 'CarePlan resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '09' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('CarePlan') - end - - test 'At least one of every must support element is provided in any CarePlan for this patient.' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careplan_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'CarePlan.text', - 'CarePlan.text.status', - 'CarePlan.status', - 'CarePlan.intent', - 'CarePlan.category', - 'CarePlan.category', - 'CarePlan.subject' - ] - must_support_elements.each do |path| - @careplan_ary&.each do |resource| - truncated_path = path.gsub('CarePlan.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @careplan_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided CarePlan resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CarePlan, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@careplan) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_careteam_sequence.rb deleted file mode 100644 index 5fe0e096c..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_careteam_sequence.rb +++ /dev/null @@ -1,187 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300CareteamSequence < SequenceBase - title 'CareTeam Tests' - - description 'Verify that CareTeam resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCCT' - - requires :token, :patient_id - conformance_supports :CareTeam - - def validate_resource_item(resource, property, value) - case property - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects CareTeam search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id, status: 'active' } - - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from CareTeam search by patient+status' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { patient: @instance.patient_id, status: 'active' } - - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @careteam = reply&.resource&.entry&.first&.resource - @careteam_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) - save_delayed_sequence_references(@careteam_ary) - validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) - end - - test 'CareTeam read resource supported' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@careteam, versioned_resource_class('CareTeam')) - end - - test 'CareTeam vread resource supported' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@careteam, versioned_resource_class('CareTeam')) - end - - test 'CareTeam history resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@careteam, versioned_resource_class('CareTeam')) - end - - test 'CareTeam resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '06' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('CareTeam') - end - - test 'At least one of every must support element is provided in any CareTeam for this patient.' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careteam_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'CareTeam.status', - 'CareTeam.subject', - 'CareTeam.participant', - 'CareTeam.participant.role', - 'CareTeam.participant.member' - ] - must_support_elements.each do |path| - @careteam_ary&.each do |resource| - truncated_path = path.gsub('CareTeam.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @careteam_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided CareTeam resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '08' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:CareTeam, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@careteam) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_condition_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_condition_sequence.rb deleted file mode 100644 index 3bf3e5aa8..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_condition_sequence.rb +++ /dev/null @@ -1,305 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300ConditionSequence < SequenceBase - title 'Condition Tests' - - description 'Verify that Condition resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCC' - - requires :token, :patient_id - conformance_supports :Condition - - def validate_resource_item(resource, property, value) - case property - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'clinical-status' - value_found = can_resolve_path(resource, 'clinicalStatus.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'clinical-status on resource does not match clinical-status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'onset-date' - value_found = can_resolve_path(resource, 'onsetDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'onset-date on resource does not match onset-date requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Condition search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Condition search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @condition = reply&.resource&.entry&.first&.resource - @condition_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Condition'), reply) - save_delayed_sequence_references(@condition_ary) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - end - - test 'Server returns expected results from Condition search by patient+onset-date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - onset_date_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'onsetDateTime')) - search_params = { 'patient': patient_val, 'onset-date': onset_date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, onset_date_val) - comparator_search_params = { 'patient': patient_val, 'onset-date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Condition'), comparator_search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Condition search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Condition search by patient+code' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - code_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'code')) - search_params = { 'patient': patient_val, 'code': code_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Condition search by patient+clinical-status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@condition.nil?, 'Expected valid Condition resource to be present' - - patient_val = @instance.patient_id - clinical_status_val = get_value_for_search_param(resolve_element_from_path(@condition_ary, 'clinicalStatus')) - search_params = { 'patient': patient_val, 'clinical-status': clinical_status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) - validate_search_reply(versioned_resource_class('Condition'), reply, search_params) - assert_response_ok(reply) - end - - test 'Condition read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@condition, versioned_resource_class('Condition')) - end - - test 'Condition vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@condition, versioned_resource_class('Condition')) - end - - test 'Condition history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@condition, versioned_resource_class('Condition')) - end - - test 'Condition resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Condition') - end - - test 'At least one of every must support element is provided in any Condition for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @condition_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Condition.clinicalStatus', - 'Condition.verificationStatus', - 'Condition.category', - 'Condition.code', - 'Condition.subject' - ] - must_support_elements.each do |path| - @condition_ary&.each do |resource| - truncated_path = path.gsub('Condition.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @condition_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Condition resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Condition, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@condition) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_device_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_device_sequence.rb deleted file mode 100644 index 5a0c8a3d7..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_device_sequence.rb +++ /dev/null @@ -1,214 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300DeviceSequence < SequenceBase - title 'Device Tests' - - description 'Verify that Device resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCD' - - requires :token, :patient_id - conformance_supports :Device - - def validate_resource_item(resource, property, value) - case property - - when 'patient' - value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'type' - value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'type on resource does not match type requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Device search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Device'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Device search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Device'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @device = reply&.resource&.entry&.first&.resource - @device_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Device'), reply) - save_delayed_sequence_references(@device_ary) - validate_search_reply(versioned_resource_class('Device'), reply, search_params) - end - - test 'Server returns expected results from Device search by patient+type' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@device.nil?, 'Expected valid Device resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@device_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Device'), search_params) - validate_search_reply(versioned_resource_class('Device'), reply, search_params) - assert_response_ok(reply) - end - - test 'Device read resource supported' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@device, versioned_resource_class('Device')) - end - - test 'Device vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@device, versioned_resource_class('Device')) - end - - test 'Device history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@device, versioned_resource_class('Device')) - end - - test 'Device resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '07' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-device' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Device') - end - - test 'At least one of every must support element is provided in any Device for this patient.' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @device_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Device.udiCarrier', - 'Device.udiCarrier.carrierAIDC', - 'Device.udiCarrier.carrierHRF', - 'Device.type', - 'Device.patient' - ] - must_support_elements.each do |path| - @device_ary&.each do |resource| - truncated_path = path.gsub('Device.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @device_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Device resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Device, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@device) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb deleted file mode 100644 index 4afa18d4e..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_documentreference_sequence.rb +++ /dev/null @@ -1,383 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300DocumentreferenceSequence < SequenceBase - title 'DocumentReference Tests' - - description 'Verify that DocumentReference resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCDR' - - requires :token, :patient_id - conformance_supports :DocumentReference - - def validate_resource_item(resource, property, value) - case property - - when '_id' - value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } - assert value_found, '_id on resource does not match _id requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'type' - value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'type on resource does not match type requested' - - when 'date' - value_found = can_resolve_path(resource, 'date') { |value_in_resource| value_in_resource == value } - assert value_found, 'date on resource does not match date requested' - - when 'period' - value_found = can_resolve_path(resource, 'context.period') do |period| - validate_period_search(value, period) - end - assert value_found, 'period on resource does not match period requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects DocumentReference search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from DocumentReference search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @documentreference = reply&.resource&.entry&.first&.resource - @documentreference_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DocumentReference'), reply) - save_delayed_sequence_references(@documentreference_ary) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - end - - test 'Server returns expected results from DocumentReference search by _id' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - id_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'id')) - search_params = { '_id': id_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) - search_params = { 'patient': patient_val, 'category': category_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+category+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - category_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) - date_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'date')) - search_params = { 'patient': patient_val, 'category': category_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+type' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+status' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DocumentReference search by patient+type+period' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) - period_val = get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'context.period')) - search_params = { 'patient': patient_val, 'type': type_val, 'period': period_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, period_val) - comparator_search_params = { 'patient': patient_val, 'type': type_val, 'period': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DocumentReference'), comparator_search_params) - validate_search_reply(versioned_resource_class('DocumentReference'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'DocumentReference create resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_create_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference read resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference vread resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference history resource supported' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@documentreference, versioned_resource_class('DocumentReference')) - end - - test 'DocumentReference resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '13' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('DocumentReference') - end - - test 'At least one of every must support element is provided in any DocumentReference for this patient.' do - metadata do - id '14' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @documentreference_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'DocumentReference.identifier', - 'DocumentReference.status', - 'DocumentReference.type', - 'DocumentReference.category', - 'DocumentReference.subject', - 'DocumentReference.date', - 'DocumentReference.author', - 'DocumentReference.custodian', - 'DocumentReference.content', - 'DocumentReference.content.attachment', - 'DocumentReference.content.attachment.contentType', - 'DocumentReference.content.attachment.data', - 'DocumentReference.content.attachment.url', - 'DocumentReference.content.format', - 'DocumentReference.context', - 'DocumentReference.context.encounter', - 'DocumentReference.context.period' - ] - must_support_elements.each do |path| - @documentreference_ary&.each do |resource| - truncated_path = path.gsub('DocumentReference.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @documentreference_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided DocumentReference resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '15' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DocumentReference, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@documentreference) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_encounter_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_encounter_sequence.rb deleted file mode 100644 index dfc021227..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_encounter_sequence.rb +++ /dev/null @@ -1,367 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300EncounterSequence < SequenceBase - title 'Encounter Tests' - - description 'Verify that Encounter resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCE' - - requires :token, :patient_id - conformance_supports :Encounter - - def validate_resource_item(resource, property, value) - case property - - when '_id' - value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } - assert value_found, '_id on resource does not match _id requested' - - when 'class' - value_found = can_resolve_path(resource, 'local_class.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'class on resource does not match class requested' - - when 'date' - value_found = can_resolve_path(resource, 'period') do |period| - validate_period_search(value, period) - end - assert value_found, 'date on resource does not match date requested' - - when 'identifier' - value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } - assert value_found, 'identifier on resource does not match identifier requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'type' - value_found = can_resolve_path(resource, 'type.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'type on resource does not match type requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Encounter search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Encounter search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @encounter = reply&.resource&.entry&.first&.resource - @encounter_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Encounter'), reply) - save_delayed_sequence_references(@encounter_ary) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - end - - test 'Server returns expected results from Encounter search by _id' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - id_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'id')) - search_params = { '_id': id_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by date+patient' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - date_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'period')) - patient_val = @instance.patient_id - search_params = { 'date': date_val, 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'date': comparator_val, 'patient': patient_val } - reply = get_resource_by_params(versioned_resource_class('Encounter'), comparator_search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Encounter search by identifier' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - identifier_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'identifier')) - search_params = { 'identifier': identifier_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by patient+status' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by class+patient' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - class_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'local_class')) - patient_val = @instance.patient_id - search_params = { 'class': class_val, 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Encounter search by patient+type' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@encounter.nil?, 'Expected valid Encounter resource to be present' - - patient_val = @instance.patient_id - type_val = get_value_for_search_param(resolve_element_from_path(@encounter_ary, 'type')) - search_params = { 'patient': patient_val, 'type': type_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) - validate_search_reply(versioned_resource_class('Encounter'), reply, search_params) - assert_response_ok(reply) - end - - test 'Encounter read resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@encounter, versioned_resource_class('Encounter')) - end - - test 'Encounter vread resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@encounter, versioned_resource_class('Encounter')) - end - - test 'Encounter history resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@encounter, versioned_resource_class('Encounter')) - end - - test 'Encounter resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '12' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Encounter') - end - - test 'At least one of every must support element is provided in any Encounter for this patient.' do - metadata do - id '13' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @encounter_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Encounter.identifier', - 'Encounter.identifier.system', - 'Encounter.identifier.value', - 'Encounter.status', - 'Encounter.local_class', - 'Encounter.type', - 'Encounter.subject', - 'Encounter.participant', - 'Encounter.participant.type', - 'Encounter.participant.period', - 'Encounter.participant.individual', - 'Encounter.period', - 'Encounter.reasonCode', - 'Encounter.hospitalization', - 'Encounter.hospitalization.dischargeDisposition', - 'Encounter.location', - 'Encounter.location.location' - ] - must_support_elements.each do |path| - @encounter_ary&.each do |resource| - truncated_path = path.gsub('Encounter.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @encounter_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Encounter resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '14' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Encounter, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@encounter) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_goal_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_goal_sequence.rb deleted file mode 100644 index 549ea4387..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_goal_sequence.rb +++ /dev/null @@ -1,252 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300GoalSequence < SequenceBase - title 'Goal Tests' - - description 'Verify that Goal resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCG' - - requires :token, :patient_id - conformance_supports :Goal - - def validate_resource_item(resource, property, value) - case property - - when 'lifecycle-status' - value_found = can_resolve_path(resource, 'lifecycleStatus') { |value_in_resource| value_in_resource == value } - assert value_found, 'lifecycle-status on resource does not match lifecycle-status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'target-date' - value_found = can_resolve_path(resource, 'target.dueDate') do |date| - validate_date_search(value, date) - end - assert value_found, 'target-date on resource does not match target-date requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Goal search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Goal search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @goal = reply&.resource&.entry&.first&.resource - @goal_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Goal'), reply) - save_delayed_sequence_references(@goal_ary) - validate_search_reply(versioned_resource_class('Goal'), reply, search_params) - end - - test 'Server returns expected results from Goal search by patient+target-date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@goal.nil?, 'Expected valid Goal resource to be present' - - patient_val = @instance.patient_id - target_date_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'target.dueDate')) - search_params = { 'patient': patient_val, 'target-date': target_date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - validate_search_reply(versioned_resource_class('Goal'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, target_date_val) - comparator_search_params = { 'patient': patient_val, 'target-date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Goal'), comparator_search_params) - validate_search_reply(versioned_resource_class('Goal'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Goal search by patient+lifecycle-status' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@goal.nil?, 'Expected valid Goal resource to be present' - - patient_val = @instance.patient_id - lifecycle_status_val = get_value_for_search_param(resolve_element_from_path(@goal_ary, 'lifecycleStatus')) - search_params = { 'patient': patient_val, 'lifecycle-status': lifecycle_status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) - validate_search_reply(versioned_resource_class('Goal'), reply, search_params) - assert_response_ok(reply) - end - - test 'Goal read resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@goal, versioned_resource_class('Goal')) - end - - test 'Goal vread resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@goal, versioned_resource_class('Goal')) - end - - test 'Goal history resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@goal, versioned_resource_class('Goal')) - end - - test 'Goal resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '08' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Goal') - end - - test 'At least one of every must support element is provided in any Goal for this patient.' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @goal_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Goal.lifecycleStatus', - 'Goal.description', - 'Goal.subject', - 'Goal.target', - 'Goal.target.dueDate', - 'Goal.target.dueDuration' - ] - must_support_elements.each do |path| - @goal_ary&.each do |resource| - truncated_path = path.gsub('Goal.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @goal_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Goal resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Goal, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@goal) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_immunization_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_immunization_sequence.rb deleted file mode 100644 index b9eab8272..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_immunization_sequence.rb +++ /dev/null @@ -1,253 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300ImmunizationSequence < SequenceBase - title 'Immunization Tests' - - description 'Verify that Immunization resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCI' - - requires :token, :patient_id - conformance_supports :Immunization - - def validate_resource_item(resource, property, value) - case property - - when 'patient' - value_found = can_resolve_path(resource, 'patient.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'date' - value_found = can_resolve_path(resource, 'occurrenceDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Immunization search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Immunization search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @immunization = reply&.resource&.entry&.first&.resource - @immunization_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Immunization'), reply) - save_delayed_sequence_references(@immunization_ary) - validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) - end - - test 'Server returns expected results from Immunization search by patient+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@immunization.nil?, 'Expected valid Immunization resource to be present' - - patient_val = @instance.patient_id - date_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'occurrenceDateTime')) - search_params = { 'patient': patient_val, 'date': date_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('Immunization'), comparator_search_params) - validate_search_reply(versioned_resource_class('Immunization'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from Immunization search by patient+status' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@immunization.nil?, 'Expected valid Immunization resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@immunization_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) - validate_search_reply(versioned_resource_class('Immunization'), reply, search_params) - assert_response_ok(reply) - end - - test 'Immunization read resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@immunization, versioned_resource_class('Immunization')) - end - - test 'Immunization vread resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@immunization, versioned_resource_class('Immunization')) - end - - test 'Immunization history resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@immunization, versioned_resource_class('Immunization')) - end - - test 'Immunization resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '08' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Immunization') - end - - test 'At least one of every must support element is provided in any Immunization for this patient.' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @immunization_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Immunization.status', - 'Immunization.statusReason', - 'Immunization.vaccineCode', - 'Immunization.patient', - 'Immunization.occurrenceDateTime', - 'Immunization.occurrenceString', - 'Immunization.primarySource' - ] - must_support_elements.each do |path| - @immunization_ary&.each do |resource| - truncated_path = path.gsub('Immunization.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @immunization_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Immunization resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Immunization, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@immunization) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_location_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_location_sequence.rb deleted file mode 100644 index 37199f88c..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_location_sequence.rb +++ /dev/null @@ -1,302 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300LocationSequence < SequenceBase - title 'Location Tests' - - description 'Verify that Location resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCL' - - requires :token - conformance_supports :Location - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'name' - value_found = can_resolve_path(resource, 'name') { |value_in_resource| value_in_resource == value } - assert value_found, 'name on resource does not match name requested' - - when 'address' - value_found = can_resolve_path(resource, 'address') do |address| - address&.text&.start_with?(value) || - address&.city&.start_with?(value) || - address&.state&.start_with?(value) || - address&.postalCode&.start_with?(value) || - address&.country&.start_with?(value) - end - assert value_found, 'address on resource does not match address requested' - - when 'address-city' - value_found = can_resolve_path(resource, 'address.city') { |value_in_resource| value_in_resource == value } - assert value_found, 'address-city on resource does not match address-city requested' - - when 'address-state' - value_found = can_resolve_path(resource, 'address.state') { |value_in_resource| value_in_resource == value } - assert value_found, 'address-state on resource does not match address-state requested' - - when 'address-postalcode' - value_found = can_resolve_path(resource, 'address.postalCode') { |value_in_resource| value_in_resource == value } - assert value_found, 'address-postalcode on resource does not match address-postalcode requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test 'Can read Location from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - location_id = @instance.resource_references.find { |reference| reference.resource_type == 'Location' }&.resource_id - skip 'No Location references found from the prior searches' if location_id.nil? - @location = fetch_resource('Location', location_id) - @location_ary = Array.wrap(@location) - @resources_found = !@location.nil? - end - - test :unauthorized_search do - metadata do - id '02' - name 'Server rejects Location search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Location search by name' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @location = reply&.resource&.entry&.first&.resource - @location_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Location'), reply) - save_delayed_sequence_references(@location_ary) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - end - - test 'Server returns expected results from Location search by address' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address')) - search_params = { 'address': address_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Location search by address-city' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_city_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.city')) - search_params = { 'address-city': address_city_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Location search by address-state' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_state_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.state')) - search_params = { 'address-state': address_state_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Location search by address-postalcode' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@location.nil?, 'Expected valid Location resource to be present' - - address_postalcode_val = get_value_for_search_param(resolve_element_from_path(@location_ary, 'address.postalCode')) - search_params = { 'address-postalcode': address_postalcode_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Location'), search_params) - validate_search_reply(versioned_resource_class('Location'), reply, search_params) - assert_response_ok(reply) - end - - test 'Location vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Location, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@location, versioned_resource_class('Location')) - end - - test 'Location history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Location, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@location, versioned_resource_class('Location')) - end - - test 'Location resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-location' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Location') - end - - test 'At least one of every must support element is provided in any Location for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @location_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Location.status', - 'Location.name', - 'Location.telecom', - 'Location.address', - 'Location.address.line', - 'Location.address.city', - 'Location.address.state', - 'Location.address.postalCode', - 'Location.managingOrganization' - ] - must_support_elements.each do |path| - @location_ary&.each do |resource| - truncated_path = path.gsub('Location.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @location_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Location resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Location, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@location) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_medication_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_medication_sequence.rb deleted file mode 100644 index a910ca121..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_medication_sequence.rb +++ /dev/null @@ -1,124 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300MedicationSequence < SequenceBase - title 'Medication Tests' - - description 'Verify that Medication resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCM' - - requires :token - conformance_supports :Medication - delayed_sequence - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test 'Can read Medication from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - medication_id = @instance.resource_references.find { |reference| reference.resource_type == 'Medication' }&.resource_id - skip 'No Medication references found from the prior searches' if medication_id.nil? - @medication = fetch_resource('Medication', medication_id) - @medication_ary = Array.wrap(@medication) - @resources_found = !@medication.nil? - end - - test 'Medication vread resource supported' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Medication, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@medication, versioned_resource_class('Medication')) - end - - test 'Medication history resource supported' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Medication, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@medication, versioned_resource_class('Medication')) - end - - test 'Medication resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '04' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Medication') - end - - test 'At least one of every must support element is provided in any Medication for this patient.' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medication_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Medication.code' - ] - must_support_elements.each do |path| - @medication_ary&.each do |resource| - truncated_path = path.gsub('Medication.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @medication_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Medication resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '06' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Medication, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@medication) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb deleted file mode 100644 index 8e754a4ef..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_medicationrequest_sequence.rb +++ /dev/null @@ -1,264 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300MedicationrequestSequence < SequenceBase - title 'MedicationRequest Tests' - - description 'Verify that MedicationRequest resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCMR' - - requires :token, :patient_id - conformance_supports :MedicationRequest - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'authoredon' - value_found = can_resolve_path(resource, 'authoredOn') { |value_in_resource| value_in_resource == value } - assert value_found, 'authoredon on resource does not match authoredon requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects MedicationRequest search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from MedicationRequest search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @medicationrequest = reply&.resource&.entry&.first&.resource - @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) - save_delayed_sequence_references(@medicationrequest_ary) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) - end - - test 'Server returns expected results from MedicationRequest search by patient+status' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from MedicationRequest search by patient+authoredon' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' - - patient_val = @instance.patient_id - authoredon_val = get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'authoredOn')) - search_params = { 'patient': patient_val, 'authoredon': authoredon_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) - assert_response_ok(reply) - end - - test 'MedicationRequest read resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) - end - - test 'MedicationRequest vread resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) - end - - test 'MedicationRequest history resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) - end - - test 'Server returns the appropriate resource from the following _includes: MedicationRequest:medication' do - metadata do - id '08' - link 'https://www.hl7.org/fhir/search.html#include' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_include'] = 'MedicationRequest:medication' - reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } - assert medication_results, 'No Medication resources were returned from this search' - end - - test 'MedicationRequest resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '09' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('MedicationRequest') - end - - test 'At least one of every must support element is provided in any MedicationRequest for this patient.' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medicationrequest_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'MedicationRequest.status', - 'MedicationRequest.medicationCodeableConcept', - 'MedicationRequest.medicationReference', - 'MedicationRequest.subject', - 'MedicationRequest.authoredOn', - 'MedicationRequest.requester', - 'MedicationRequest.dosageInstruction', - 'MedicationRequest.dosageInstruction.text' - ] - must_support_elements.each do |path| - @medicationrequest_ary&.each do |resource| - truncated_path = path.gsub('MedicationRequest.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @medicationrequest_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided MedicationRequest resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationRequest, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@medicationrequest) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb deleted file mode 100644 index f366877d8..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_medicationstatement_sequence.rb +++ /dev/null @@ -1,275 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300MedicationstatementSequence < SequenceBase - title 'MedicationStatement Tests' - - description 'Verify that MedicationStatement resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCMS' - - requires :token, :patient_id - conformance_supports :MedicationStatement - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'effective' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'effective on resource does not match effective requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects MedicationStatement search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from MedicationStatement search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @medicationstatement = reply&.resource&.entry&.first&.resource - @medicationstatement_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('MedicationStatement'), reply) - save_delayed_sequence_references(@medicationstatement_ary) - validate_search_reply(versioned_resource_class('MedicationStatement'), reply, search_params) - end - - test 'Server returns expected results from MedicationStatement search by patient+effective' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationstatement.nil?, 'Expected valid MedicationStatement resource to be present' - - patient_val = @instance.patient_id - effective_val = get_value_for_search_param(resolve_element_from_path(@medicationstatement_ary, 'effectiveDateTime')) - search_params = { 'patient': patient_val, 'effective': effective_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) - validate_search_reply(versioned_resource_class('MedicationStatement'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, effective_val) - comparator_search_params = { 'patient': patient_val, 'effective': comparator_val } - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), comparator_search_params) - validate_search_reply(versioned_resource_class('MedicationStatement'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from MedicationStatement search by patient+status' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationstatement.nil?, 'Expected valid MedicationStatement resource to be present' - - patient_val = @instance.patient_id - status_val = get_value_for_search_param(resolve_element_from_path(@medicationstatement_ary, 'status')) - search_params = { 'patient': patient_val, 'status': status_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) - validate_search_reply(versioned_resource_class('MedicationStatement'), reply, search_params) - assert_response_ok(reply) - end - - test 'MedicationStatement read resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationStatement, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) - end - - test 'MedicationStatement vread resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationStatement, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) - end - - test 'MedicationStatement history resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationStatement, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@medicationstatement, versioned_resource_class('MedicationStatement')) - end - - test 'Server returns the appropriate resource from the following _includes: MedicationStatement:medication' do - metadata do - id '08' - link 'https://www.hl7.org/fhir/search.html#include' - description %( - ) - versions :r4 - end - - patient_val = @instance.patient_id - search_params = { 'patient': patient_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_include'] = 'MedicationStatement:medication' - reply = get_resource_by_params(versioned_resource_class('MedicationStatement'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - medication_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Medication' } - assert medication_results, 'No Medication resources were returned from this search' - end - - test 'MedicationStatement resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '09' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationstatement' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('MedicationStatement') - end - - test 'At least one of every must support element is provided in any MedicationStatement for this patient.' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medicationstatement_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'MedicationStatement.status', - 'MedicationStatement.medicationCodeableConcept', - 'MedicationStatement.medicationReference', - 'MedicationStatement.subject', - 'MedicationStatement.effectiveDateTime', - 'MedicationStatement.effectivePeriod', - 'MedicationStatement.dateAsserted', - 'MedicationStatement.derivedFrom' - ] - must_support_elements.each do |path| - @medicationstatement_ary&.each do |resource| - truncated_path = path.gsub('MedicationStatement.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @medicationstatement_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided MedicationStatement resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:MedicationStatement, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@medicationstatement) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_organization_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_organization_sequence.rb deleted file mode 100644 index 4ff8e3803..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_organization_sequence.rb +++ /dev/null @@ -1,227 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300OrganizationSequence < SequenceBase - title 'Organization Tests' - - description 'Verify that Organization resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCO' - - requires :token - conformance_supports :Organization - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'name' - value_found = can_resolve_path(resource, 'name') { |value_in_resource| value_in_resource == value } - assert value_found, 'name on resource does not match name requested' - - when 'address' - value_found = can_resolve_path(resource, 'address') do |address| - address&.text&.start_with?(value) || - address&.city&.start_with?(value) || - address&.state&.start_with?(value) || - address&.postalCode&.start_with?(value) || - address&.country&.start_with?(value) - end - assert value_found, 'address on resource does not match address requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test 'Can read Organization from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - organization_id = @instance.resource_references.find { |reference| reference.resource_type == 'Organization' }&.resource_id - skip 'No Organization references found from the prior searches' if organization_id.nil? - @organization = fetch_resource('Organization', organization_id) - @organization_ary = Array.wrap(@organization) - @resources_found = !@organization.nil? - end - - test :unauthorized_search do - metadata do - id '02' - name 'Server rejects Organization search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Organization search by name' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @organization = reply&.resource&.entry&.first&.resource - @organization_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Organization'), reply) - save_delayed_sequence_references(@organization_ary) - validate_search_reply(versioned_resource_class('Organization'), reply, search_params) - end - - test 'Server returns expected results from Organization search by address' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@organization.nil?, 'Expected valid Organization resource to be present' - - address_val = get_value_for_search_param(resolve_element_from_path(@organization_ary, 'address')) - search_params = { 'address': address_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) - validate_search_reply(versioned_resource_class('Organization'), reply, search_params) - assert_response_ok(reply) - end - - test 'Organization vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Organization, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@organization, versioned_resource_class('Organization')) - end - - test 'Organization history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Organization, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@organization, versioned_resource_class('Organization')) - end - - test 'Organization resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '07' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Organization') - end - - test 'At least one of every must support element is provided in any Organization for this patient.' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @organization_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Organization.identifier', - 'Organization.identifier.system', - 'Organization.active', - 'Organization.name', - 'Organization.telecom', - 'Organization.address', - 'Organization.address.line', - 'Organization.address.city', - 'Organization.address.state', - 'Organization.address.postalCode', - 'Organization.address.country', - 'Organization.endpoint' - ] - must_support_elements.each do |path| - @organization_ary&.each do |resource| - truncated_path = path.gsub('Organization.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @organization_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Organization resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Organization, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@organization) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_patient_sequence.rb deleted file mode 100644 index e3267e558..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_patient_sequence.rb +++ /dev/null @@ -1,375 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300PatientSequence < SequenceBase - title 'Patient Tests' - - description 'Verify that Patient resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCP' - - requires :token, :patient_id - conformance_supports :Patient - - def validate_resource_item(resource, property, value) - case property - - when '_id' - value_found = can_resolve_path(resource, 'id') { |value_in_resource| value_in_resource == value } - assert value_found, '_id on resource does not match _id requested' - - when 'birthdate' - value_found = can_resolve_path(resource, 'birthDate') do |date| - validate_date_search(value, date) - end - assert value_found, 'birthdate on resource does not match birthdate requested' - - when 'family' - value_found = can_resolve_path(resource, 'name.family') { |value_in_resource| value_in_resource == value } - assert value_found, 'family on resource does not match family requested' - - when 'gender' - value_found = can_resolve_path(resource, 'gender') { |value_in_resource| value_in_resource == value } - assert value_found, 'gender on resource does not match gender requested' - - when 'given' - value_found = can_resolve_path(resource, 'name.given') { |value_in_resource| value_in_resource == value } - assert value_found, 'given on resource does not match given requested' - - when 'identifier' - value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } - assert value_found, 'identifier on resource does not match identifier requested' - - when 'name' - value = value.downcase - value_found = can_resolve_path(resource, 'name') do |name| - name&.text&.start_with?(value) || - name&.family&.downcase&.include?(value) || - name&.given&.any? { |given| given.downcase.start_with?(value) } || - name&.prefix&.any? { |prefix| prefix.downcase.start_with?(value) } || - name&.suffix&.any? { |suffix| suffix.downcase.start_with?(value) } - end - assert value_found, 'name on resource does not match name requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Patient search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { '_id': @instance.patient_id } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Patient search by _id' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { '_id': @instance.patient_id } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @patient = reply&.resource&.entry&.first&.resource - @patient_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Patient'), reply) - save_delayed_sequence_references(@patient_ary) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - end - - test 'Server returns expected results from Patient search by identifier' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - identifier_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'identifier')) - search_params = { 'identifier': identifier_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by name' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by birthdate+name' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'birthdate': birthdate_val, 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by gender+name' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) - name_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name')) - search_params = { 'gender': gender_val, 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by family+gender' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) - gender_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'gender')) - search_params = { 'family': family_val, 'gender': gender_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Patient search by birthdate+family' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@patient.nil?, 'Expected valid Patient resource to be present' - - birthdate_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'birthDate')) - family_val = get_value_for_search_param(resolve_element_from_path(@patient_ary, 'name.family')) - search_params = { 'birthdate': birthdate_val, 'family': family_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) - validate_search_reply(versioned_resource_class('Patient'), reply, search_params) - assert_response_ok(reply) - end - - test 'Patient read resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@patient, versioned_resource_class('Patient')) - end - - test 'Patient vread resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@patient, versioned_resource_class('Patient')) - end - - test 'Patient history resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@patient, versioned_resource_class('Patient')) - end - - test 'Patient resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '12' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Patient') - end - - test 'At least one of every must support element is provided in any Patient for this patient.' do - metadata do - id '13' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @patient_ary&.any? - must_support_confirmed = {} - extensions_list = { - 'Patient.extension:race': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race', - 'Patient.extension:ethnicity': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity', - 'Patient.extension:birthsex': 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex' - } - extensions_list.each do |id, url| - @patient_ary&.each do |resource| - must_support_confirmed[id] = true if resource.extension.any? { |extension| extension.url == url } - break if must_support_confirmed[id] - end - skip_notification = "Could not find #{id} in any of the #{@patient_ary.length} provided Patient resource(s)" - skip skip_notification unless must_support_confirmed[id] - end - - must_support_elements = [ - 'Patient.identifier', - 'Patient.identifier.system', - 'Patient.identifier.value', - 'Patient.name', - 'Patient.name.family', - 'Patient.name.given', - 'Patient.telecom', - 'Patient.telecom.system', - 'Patient.telecom.value', - 'Patient.gender', - 'Patient.birthDate', - 'Patient.address', - 'Patient.address.line', - 'Patient.address.city', - 'Patient.address.state', - 'Patient.address.postalCode', - 'Patient.communication', - 'Patient.communication.language' - ] - must_support_elements.each do |path| - @patient_ary&.each do |resource| - truncated_path = path.gsub('Patient.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @patient_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Patient resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '14' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Patient, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@patient) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb deleted file mode 100644 index d929e007e..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_practitioner_sequence.rb +++ /dev/null @@ -1,223 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300PractitionerSequence < SequenceBase - title 'Practitioner Tests' - - description 'Verify that Practitioner resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPR' - - requires :token - conformance_supports :Practitioner - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'name' - value = value.downcase - value_found = can_resolve_path(resource, 'name') do |name| - name&.text&.start_with?(value) || - name&.family&.downcase&.include?(value) || - name&.given&.any? { |given| given.downcase.start_with?(value) } || - name&.prefix&.any? { |prefix| prefix.downcase.start_with?(value) } || - name&.suffix&.any? { |suffix| suffix.downcase.start_with?(value) } - end - assert value_found, 'name on resource does not match name requested' - - when 'identifier' - value_found = can_resolve_path(resource, 'identifier.value') { |value_in_resource| value_in_resource == value } - assert value_found, 'identifier on resource does not match identifier requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test 'Can read Practitioner from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - practitioner_id = @instance.resource_references.find { |reference| reference.resource_type == 'Practitioner' }&.resource_id - skip 'No Practitioner references found from the prior searches' if practitioner_id.nil? - @practitioner = fetch_resource('Practitioner', practitioner_id) - @practitioner_ary = Array.wrap(@practitioner) - @resources_found = !@practitioner.nil? - end - - test :unauthorized_search do - metadata do - id '02' - name 'Server rejects Practitioner search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Practitioner search by name' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - name_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) - search_params = { 'name': name_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @practitioner = reply&.resource&.entry&.first&.resource - @practitioner_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Practitioner'), reply) - save_delayed_sequence_references(@practitioner_ary) - validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) - end - - test 'Server returns expected results from Practitioner search by identifier' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@practitioner.nil?, 'Expected valid Practitioner resource to be present' - - identifier_val = get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'identifier')) - search_params = { 'identifier': identifier_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) - validate_search_reply(versioned_resource_class('Practitioner'), reply, search_params) - assert_response_ok(reply) - end - - test 'Practitioner vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Practitioner, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@practitioner, versioned_resource_class('Practitioner')) - end - - test 'Practitioner history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Practitioner, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@practitioner, versioned_resource_class('Practitioner')) - end - - test 'Practitioner resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '07' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Practitioner') - end - - test 'At least one of every must support element is provided in any Practitioner for this patient.' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitioner_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Practitioner.identifier', - 'Practitioner.identifier.system', - 'Practitioner.identifier.value', - 'Practitioner.identifier', - 'Practitioner.identifier.system', - 'Practitioner.name', - 'Practitioner.name.family' - ] - must_support_elements.each do |path| - @practitioner_ary&.each do |resource| - truncated_path = path.gsub('Practitioner.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @practitioner_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Practitioner resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Practitioner, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@practitioner) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb deleted file mode 100644 index 486aa35e5..000000000 --- a/lib/modules/uscore_v3.0.0/us_core_practitionerrole_sequence.rb +++ /dev/null @@ -1,246 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore300PractitionerroleSequence < SequenceBase - title 'PractitionerRole Tests' - - description 'Verify that PractitionerRole resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPRO' - - requires :token - conformance_supports :PractitionerRole - delayed_sequence - - def validate_resource_item(resource, property, value) - case property - - when 'specialty' - value_found = can_resolve_path(resource, 'specialty.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'specialty on resource does not match specialty requested' - - when 'practitioner' - value_found = can_resolve_path(resource, 'practitioner.reference') { |value_in_resource| value_in_resource == value } - assert value_found, 'practitioner on resource does not match practitioner requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test 'Can read PractitionerRole from the server' do - metadata do - id '01' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - practitionerrole_id = @instance.resource_references.find { |reference| reference.resource_type == 'PractitionerRole' }&.resource_id - skip 'No PractitionerRole references found from the prior searches' if practitionerrole_id.nil? - @practitionerrole = fetch_resource('PractitionerRole', practitionerrole_id) - @practitionerrole_ary = Array.wrap(@practitionerrole) - @resources_found = !@practitionerrole.nil? - end - - test :unauthorized_search do - metadata do - id '02' - name 'Server rejects PractitionerRole search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from PractitionerRole search by specialty' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @practitionerrole = reply&.resource&.entry&.first&.resource - @practitionerrole_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('PractitionerRole'), reply) - save_delayed_sequence_references(@practitionerrole_ary) - validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) - end - - test 'Server returns expected results from PractitionerRole search by practitioner' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@practitionerrole.nil?, 'Expected valid PractitionerRole resource to be present' - - practitioner_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'practitioner')) - search_params = { 'practitioner': practitioner_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) - assert_response_ok(reply) - end - - test 'PractitionerRole vread resource supported' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:PractitionerRole, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) - end - - test 'PractitionerRole history resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:PractitionerRole, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) - end - - test 'Server returns the appropriate resource from the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do - metadata do - id '07' - link 'https://www.hl7.org/fhir/search.html#include' - description %( - ) - versions :r4 - end - - specialty_val = get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) - search_params = { 'specialty': specialty_val } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - search_params['_include'] = 'PractitionerRole:endpoint' - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - endpoint_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Endpoint' } - assert endpoint_results, 'No Endpoint resources were returned from this search' - - search_params['_include'] = 'PractitionerRole:practitioner' - reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - practitioner_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Practitioner' } - assert practitioner_results, 'No Practitioner resources were returned from this search' - end - - test 'PractitionerRole resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '08' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('PractitionerRole') - end - - test 'At least one of every must support element is provided in any PractitionerRole for this patient.' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitionerrole_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'PractitionerRole.practitioner', - 'PractitionerRole.organization', - 'PractitionerRole.code', - 'PractitionerRole.specialty', - 'PractitionerRole.location', - 'PractitionerRole.telecom', - 'PractitionerRole.telecom.system', - 'PractitionerRole.telecom.value', - 'PractitionerRole.endpoint' - ] - must_support_elements.each do |path| - @practitionerrole_ary&.each do |resource| - truncated_path = path.gsub('PractitionerRole.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @practitionerrole_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided PractitionerRole resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:PractitionerRole, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@practitionerrole) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb deleted file mode 100644 index 106fbc882..000000000 --- a/lib/modules/uscore_v3.0.1/pediatric_bmi_for_age_sequence.rb +++ /dev/null @@ -1,350 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301PediatricBmiForAgeSequence < SequenceBase - title 'Pediatric BMI for Age Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPBMIAO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Observation search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { - 'patient': @instance.patient_id, - 'code': '59576-9' - } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'code': '59576-9' - } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), - 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), - 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'code': '59576-9' - } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.category', - 'Observation.category', - 'Observation.category.coding', - 'Observation.category.coding.system', - 'Observation.category.coding.code', - 'Observation.subject', - 'Observation.effectiveDateTime', - 'Observation.effectivePeriod', - 'Observation.valueQuantity', - 'Observation.valueQuantity.value', - 'Observation.valueQuantity.unit', - 'Observation.valueQuantity.system', - 'Observation.valueQuantity.code', - 'Observation.dataAbsentReason', - 'Observation.component', - 'Observation.component.code', - 'Observation.component.valueQuantity', - 'Observation.component.valueCodeableConcept', - 'Observation.component.valueString', - 'Observation.component.valueBoolean', - 'Observation.component.valueInteger', - 'Observation.component.valueRange', - 'Observation.component.valueRatio', - 'Observation.component.valueSampledData', - 'Observation.component.valueTime', - 'Observation.component.valueDateTime', - 'Observation.component.valuePeriod', - 'Observation.component.dataAbsentReason' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb deleted file mode 100644 index 180d303e6..000000000 --- a/lib/modules/uscore_v3.0.1/pediatric_weight_for_height_sequence.rb +++ /dev/null @@ -1,350 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301PediatricWeightForHeightSequence < SequenceBase - title 'Pediatric Weight for Height Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPWHO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Observation search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { - 'patient': @instance.patient_id, - 'code': '77606-2' - } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'code': '77606-2' - } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), - 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), - 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'code': '77606-2' - } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.category', - 'Observation.category', - 'Observation.category.coding', - 'Observation.category.coding.system', - 'Observation.category.coding.code', - 'Observation.subject', - 'Observation.effectiveDateTime', - 'Observation.effectivePeriod', - 'Observation.valueQuantity', - 'Observation.valueQuantity.value', - 'Observation.valueQuantity.unit', - 'Observation.valueQuantity.system', - 'Observation.valueQuantity.code', - 'Observation.dataAbsentReason', - 'Observation.component', - 'Observation.component.code', - 'Observation.component.valueQuantity', - 'Observation.component.valueCodeableConcept', - 'Observation.component.valueString', - 'Observation.component.valueBoolean', - 'Observation.component.valueInteger', - 'Observation.component.valueRange', - 'Observation.component.valueRatio', - 'Observation.component.valueSampledData', - 'Observation.component.valueTime', - 'Observation.component.valueDateTime', - 'Observation.component.valuePeriod', - 'Observation.component.dataAbsentReason' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb deleted file mode 100644 index 6e4612ed6..000000000 --- a/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_lab_sequence.rb +++ /dev/null @@ -1,440 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301DiagnosticreportLabSequence < SequenceBase - title 'DiagnosticReport for Laboratory Results Reporting Tests' - - description 'Verify that DiagnosticReport resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCDRLRR' - - requires :token, :patient_id - conformance_supports :DiagnosticReport - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects DiagnosticReport search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { - 'patient': @instance.patient_id, - 'category': 'LAB' - } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'category': 'LAB' - } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @diagnosticreport = reply&.resource&.entry&.first&.resource - @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - save_delayed_sequence_references(@diagnosticreport_ary) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - end - - test 'Server returns expected results from DiagnosticReport search by patient' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id - } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+code' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+status' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'status': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': 'LAB' - } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'DiagnosticReport create resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport read resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport vread resource supported' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport history resource supported' do - metadata do - id '13' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '14' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'category': 'LAB' - } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '15' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('DiagnosticReport', Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - end - - test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do - metadata do - id '16' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'DiagnosticReport.status', - 'DiagnosticReport.category', - 'DiagnosticReport.category', - 'DiagnosticReport.code', - 'DiagnosticReport.subject', - 'DiagnosticReport.effectiveDateTime', - 'DiagnosticReport.effectivePeriod', - 'DiagnosticReport.issued', - 'DiagnosticReport.performer', - 'DiagnosticReport.result', - 'DiagnosticReport.media', - 'DiagnosticReport.presentedForm' - ] - must_support_elements.each do |path| - @diagnosticreport_ary&.each do |resource| - truncated_path = path.gsub('DiagnosticReport.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @diagnosticreport_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '17' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@diagnosticreport) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb deleted file mode 100644 index bba37171f..000000000 --- a/lib/modules/uscore_v3.0.1/us_core_diagnosticreport_note_sequence.rb +++ /dev/null @@ -1,439 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301DiagnosticreportNoteSequence < SequenceBase - title 'DiagnosticReport for Report and Note exchange Tests' - - description 'Verify that DiagnosticReport resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCDRRN' - - requires :token, :patient_id - conformance_supports :DiagnosticReport - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects DiagnosticReport search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { - 'patient': @instance.patient_id, - 'code': 'LP29684-5' - } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'code': 'LP29684-5' - } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @diagnosticreport = reply&.resource&.entry&.first&.resource - @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - save_delayed_sequence_references(@diagnosticreport_ary) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - end - - test 'Server returns expected results from DiagnosticReport search by patient' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id - } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+code' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'code': code_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'Server returns expected results from DiagnosticReport search by patient+status' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'status': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': 'LP29684-5' - } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) - assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, date_val) - comparator_search_params = { 'patient': patient_val, 'category': category_val, 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end - end - - test 'DiagnosticReport create resource supported' do - metadata do - id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport read resource supported' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport vread resource supported' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'DiagnosticReport history resource supported' do - metadata do - id '13' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '14' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'code': 'LP29684-5' - } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'DiagnosticReport resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '15' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('DiagnosticReport', Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - end - - test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do - metadata do - id '16' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'DiagnosticReport.status', - 'DiagnosticReport.category', - 'DiagnosticReport.code', - 'DiagnosticReport.subject', - 'DiagnosticReport.encounter', - 'DiagnosticReport.effectiveDateTime', - 'DiagnosticReport.effectivePeriod', - 'DiagnosticReport.issued', - 'DiagnosticReport.performer', - 'DiagnosticReport.media', - 'DiagnosticReport.presentedForm' - ] - must_support_elements.each do |path| - @diagnosticreport_ary&.each do |resource| - truncated_path = path.gsub('DiagnosticReport.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @diagnosticreport_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '17' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:DiagnosticReport, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@diagnosticreport) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb deleted file mode 100644 index d3f43745d..000000000 --- a/lib/modules/uscore_v3.0.1/us_core_observation_lab_sequence.rb +++ /dev/null @@ -1,340 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301ObservationLabSequence < SequenceBase - title 'Laboratory Result Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCLRO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Observation search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { - 'patient': @instance.patient_id, - 'category': 'laboratory' - } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'category': 'laboratory' - } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), - 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), - 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'category': 'laboratory' - } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.category', - 'Observation.category', - 'Observation.code', - 'Observation.subject', - 'Observation.effectiveDateTime', - 'Observation.effectivePeriod', - 'Observation.valueQuantity', - 'Observation.valueCodeableConcept', - 'Observation.valueString', - 'Observation.valueBoolean', - 'Observation.valueInteger', - 'Observation.valueRange', - 'Observation.valueRatio', - 'Observation.valueSampledData', - 'Observation.valueTime', - 'Observation.valueDateTime', - 'Observation.valuePeriod', - 'Observation.dataAbsentReason' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.1/us_core_procedure_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_procedure_sequence.rb deleted file mode 100644 index 8d989e879..000000000 --- a/lib/modules/uscore_v3.0.1/us_core_procedure_sequence.rb +++ /dev/null @@ -1,294 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301ProcedureSequence < SequenceBase - title 'Procedure Tests' - - description 'Verify that Procedure resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCPROC' - - requires :token, :patient_id - conformance_supports :Procedure - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - when 'date' - value_found = can_resolve_path(resource, 'occurrenceDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Procedure search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { - 'patient': @instance.patient_id - } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Procedure search by patient' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id - } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @procedure = reply&.resource&.entry&.first&.resource - @procedure_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Procedure'), reply) - save_delayed_sequence_references(@procedure_ary) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - end - - test 'Server returns expected results from Procedure search by patient+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'date': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Procedure search by patient+code+date' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'code')), - 'date': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'occurrenceDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Procedure search by patient+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@procedure.nil?, 'Expected valid Procedure resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'status': get_value_for_search_param(resolve_element_from_path(@procedure_ary, 'status')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - validate_search_reply(versioned_resource_class('Procedure'), reply, search_params) - assert_response_ok(reply) - end - - test 'Procedure read resource supported' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@procedure, versioned_resource_class('Procedure')) - end - - test 'Procedure vread resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@procedure, versioned_resource_class('Procedure')) - end - - test 'Procedure history resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@procedure, versioned_resource_class('Procedure')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '09' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id - } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Procedure resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '10' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Procedure') - end - - test 'At least one of every must support element is provided in any Procedure for this patient.' do - metadata do - id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @procedure_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Procedure.status', - 'Procedure.code', - 'Procedure.subject', - 'Procedure.performedDateTime', - 'Procedure.performedPeriod' - ] - must_support_elements.each do |path| - @procedure_ary&.each do |resource| - truncated_path = path.gsub('Procedure.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @procedure_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Procedure resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Procedure, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@procedure) - end - end - end -end diff --git a/lib/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb deleted file mode 100644 index 0ed23346c..000000000 --- a/lib/modules/uscore_v3.0.1/us_core_smokingstatus_sequence.rb +++ /dev/null @@ -1,326 +0,0 @@ -# frozen_string_literal: true - -module Inferno - module Sequence - class USCore301SmokingstatusSequence < SequenceBase - title 'Smoking Status Observation Tests' - - description 'Verify that Observation resources on the FHIR server follow the Argonaut Data Query Implementation Guide' - - test_id_prefix 'USCSSO' - - requires :token, :patient_id - conformance_supports :Observation - - def validate_resource_item(resource, property, value) - case property - - when 'status' - value_found = can_resolve_path(resource, 'status') { |value_in_resource| value_in_resource == value } - assert value_found, 'status on resource does not match status requested' - - when 'category' - value_found = can_resolve_path(resource, 'category.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'category on resource does not match category requested' - - when 'code' - value_found = can_resolve_path(resource, 'code.coding.code') { |value_in_resource| value_in_resource == value } - assert value_found, 'code on resource does not match code requested' - - when 'date' - value_found = can_resolve_path(resource, 'effectiveDateTime') do |date| - validate_date_search(value, date) - end - assert value_found, 'date on resource does not match date requested' - - when 'patient' - value_found = can_resolve_path(resource, 'subject.reference') { |reference| [value, 'Patient/' + value].include? reference } - assert value_found, 'patient on resource does not match patient requested' - - end - end - - details %( - The #{title} Sequence tests `#{title.gsub(/\s+/, '')}` resources associated with the provided patient. - ) - - @resources_found = false - - test :unauthorized_search do - metadata do - id '01' - name 'Server rejects Observation search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' - description %( - ) - versions :r4 - end - - @client.set_no_auth - omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { - 'patient': @instance.patient_id, - 'code': '72166-2' - } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - @client.set_bearer_token(@instance.token) - assert_response_unauthorized reply - end - - test 'Server returns expected results from Observation search by patient+code' do - metadata do - id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'code': '72166-2' - } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - end - - test 'Server returns expected results from Observation search by patient+category+date' do - metadata do - id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category' do - metadata do - id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+category+status' do - metadata do - id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')), - 'status': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'status')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Server returns expected results from Observation search by patient+code+date' do - metadata do - id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - optional - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@observation.nil?, 'Expected valid Observation resource to be present' - - search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')), - 'date': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'effectiveDateTime')) - } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } - - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) - assert_response_ok(reply) - end - - test 'Observation read resource supported' do - metadata do - id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_read_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation vread resource supported' do - metadata do - id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_vread_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Observation history resource supported' do - metadata do - id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_history_reply(@observation, versioned_resource_class('Observation')) - end - - test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do - metadata do - id '10' - link 'https://www.hl7.org/fhir/search.html#revinclude' - description %( - ) - versions :r4 - end - - search_params = { - 'patient': @instance.patient_id, - 'code': '72166-2' - } - - search_params['_revinclude'] = 'Provenance:target' - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - provenance_results = reply&.resource&.entry&.map(&:resource)&.any? { |resource| resource.resourceType == 'Provenance' } - assert provenance_results, 'No Provenance resources were returned from this search' - end - - test 'Observation resources associated with Patient conform to US Core R4 profiles' do - metadata do - id '11' - link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - test_resources_against_profile('Observation', Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - end - - test 'At least one of every must support element is provided in any Observation for this patient.' do - metadata do - id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' - description %( - ) - versions :r4 - end - - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @observation_ary&.any? - must_support_confirmed = {} - must_support_elements = [ - 'Observation.status', - 'Observation.code', - 'Observation.subject', - 'Observation.issued', - 'Observation.valueCodeableConcept' - ] - must_support_elements.each do |path| - @observation_ary&.each do |resource| - truncated_path = path.gsub('Observation.', '') - must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) - break if must_support_confirmed[path] - end - resource_count = @observation_ary.length - - skip "Could not find #{path} in any of the #{resource_count} provided Observation resource(s)" unless must_support_confirmed[path] - end - @instance.save! - end - - test 'All references can be resolved' do - metadata do - id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' - description %( - ) - versions :r4 - end - - skip_if_not_supported(:Observation, [:search, :read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - validate_reference_resolutions(@observation) - end - end - end -end diff --git a/lib/modules/uscore_v3.1.0/test/fixtures/us_core_location_location_ary.json b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_location_location_ary.json new file mode 100644 index 000000000..3edfd7e02 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_location_location_ary.json @@ -0,0 +1,6 @@ +[ + { + "resourceType": "Location", + "name": "LOCATION NAME" + } +] diff --git a/lib/modules/uscore_v3.1.0/test/fixtures/us_core_medicationrequest_medicationrequest_ary.json b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_medicationrequest_medicationrequest_ary.json new file mode 100644 index 000000000..51b5b1915 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_medicationrequest_medicationrequest_ary.json @@ -0,0 +1,7 @@ +[ + { + "resourceType": "MedicationRequest", + "intent": "order", + "status": "active" + } +] diff --git a/lib/modules/uscore_v3.1.0/test/fixtures/us_core_organization_organization_ary.json b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_organization_organization_ary.json new file mode 100644 index 000000000..2ad5d76b5 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_organization_organization_ary.json @@ -0,0 +1,6 @@ +[ + { + "resourceType": "Organization", + "name": "ORGANIZATION NAME" + } +] diff --git a/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitioner_practitioner_ary.json b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitioner_practitioner_ary.json new file mode 100644 index 000000000..97a68024b --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitioner_practitioner_ary.json @@ -0,0 +1,12 @@ +[ + { + "resourceType": "Practitioner", + "name": [ + { + "text": "PRACTITIONER NAME", + "family": "NAME", + "given": ["PRACTITIONER"] + } + ] + } +] diff --git a/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitionerrole_practitionerrole_ary.json b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitionerrole_practitionerrole_ary.json new file mode 100644 index 000000000..9e65f9f92 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitionerrole_practitionerrole_ary.json @@ -0,0 +1,14 @@ +[ + { + "resourceType": "PractitionerRole", + "specialty": [ + { + "coding": [ + { + "code": "207Q00000X" + } + ] + } + ] + } +] diff --git a/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb b/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb new file mode 100644 index 000000000..07c19ffbe --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310PediatricBmiForAgeSequence do + before do + @sequence_class = Inferno::Sequence::USCore310PediatricBmiForAgeSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id, + 'code': '59576-9' + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Observation") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Observation") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb b/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb new file mode 100644 index 000000000..f8d5bac45 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310PediatricWeightForHeightSequence do + before do + @sequence_class = Inferno::Sequence::USCore310PediatricWeightForHeightSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id, + 'code': '77606-2' + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Observation") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Observation") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb new file mode 100644 index 000000000..d7fdaaf7e --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310AllergyintoleranceSequence do + before do + @sequence_class = Inferno::Sequence::USCore310AllergyintoleranceSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/AllergyIntolerance") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/AllergyIntolerance") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb new file mode 100644 index 000000000..c56df4416 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310CareplanSequence do + before do + @sequence_class = Inferno::Sequence::USCore310CareplanSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id, + 'category': 'assess-plan' + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/CarePlan") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/CarePlan") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb new file mode 100644 index 000000000..cc6b68bc3 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310CareteamSequence do + before do + @sequence_class = Inferno::Sequence::USCore310CareteamSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id, + 'status': 'active' + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/CareTeam") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/CareTeam") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb new file mode 100644 index 000000000..76f336a65 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310ConditionSequence do + before do + @sequence_class = Inferno::Sequence::USCore310ConditionSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Condition") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Condition") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb new file mode 100644 index 000000000..df7d22f20 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310DiagnosticreportLabSequence do + before do + @sequence_class = Inferno::Sequence::USCore310DiagnosticreportLabSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id, + 'category': 'LAB' + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/DiagnosticReport") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/DiagnosticReport") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb new file mode 100644 index 000000000..6e75eb182 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310DiagnosticreportNoteSequence do + before do + @sequence_class = Inferno::Sequence::USCore310DiagnosticreportNoteSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id, + 'code': 'LP29684-5' + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/DiagnosticReport") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/DiagnosticReport") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb new file mode 100644 index 000000000..1e98a5520 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310DocumentreferenceSequence do + before do + @sequence_class = Inferno::Sequence::USCore310DocumentreferenceSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/DocumentReference") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/DocumentReference") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb new file mode 100644 index 000000000..44706d0ed --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310EncounterSequence do + before do + @sequence_class = Inferno::Sequence::USCore310EncounterSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Encounter") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Encounter") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb new file mode 100644 index 000000000..26084e9d6 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310GoalSequence do + before do + @sequence_class = Inferno::Sequence::USCore310GoalSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Goal") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Goal") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb new file mode 100644 index 000000000..3a19f8a96 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310ImmunizationSequence do + before do + @sequence_class = Inferno::Sequence::USCore310ImmunizationSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Immunization") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Immunization") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb new file mode 100644 index 000000000..c3c36047f --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310ImplantableDeviceSequence do + before do + @sequence_class = Inferno::Sequence::USCore310ImplantableDeviceSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Device") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Device") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb new file mode 100644 index 000000000..16028065b --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310LocationSequence do + before do + @sequence_class = Inferno::Sequence::USCore310LocationSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @location_ary = load_json_fixture(:us_core_location_location_ary) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'@location_ary', @location_ary) + + @query = { + 'name': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@location_ary, 'name')) + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Location") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Location") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb new file mode 100644 index 000000000..9b4f30806 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb @@ -0,0 +1,63 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310MedicationrequestSequence do + before do + @sequence_class = Inferno::Sequence::USCore310MedicationrequestSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @medicationrequest_ary = load_json_fixture(:us_core_medicationrequest_medicationrequest_ary) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'@medicationrequest_ary', @medicationrequest_ary) + + @medicationrequest_ary = load_json_fixture(:us_core_medicationrequest_medicationrequest_ary) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'@medicationrequest_ary', @medicationrequest_ary) + + @query = { + 'patient': @instance.patient_id, + 'intent': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@medicationrequest_ary, 'intent')), + 'status': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@medicationrequest_ary, 'status')) + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/MedicationRequest") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/MedicationRequest") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb new file mode 100644 index 000000000..885443575 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310ObservationLabSequence do + before do + @sequence_class = Inferno::Sequence::USCore310ObservationLabSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id, + 'category': 'laboratory' + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Observation") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Observation") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb new file mode 100644 index 000000000..11635d35b --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310OrganizationSequence do + before do + @sequence_class = Inferno::Sequence::USCore310OrganizationSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @organization_ary = load_json_fixture(:us_core_organization_organization_ary) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'@organization_ary', @organization_ary) + + @query = { + 'name': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@organization_ary, 'name')) + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Organization") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Organization") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb new file mode 100644 index 000000000..a3862f08e --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310PatientSequence do + before do + @sequence_class = Inferno::Sequence::USCore310PatientSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + '_id': @instance.patient_id + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Patient") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb new file mode 100644 index 000000000..4b8492d1d --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310PractitionerSequence do + before do + @sequence_class = Inferno::Sequence::USCore310PractitionerSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @practitioner_ary = load_json_fixture(:us_core_practitioner_practitioner_ary) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'@practitioner_ary', @practitioner_ary) + + @query = { + 'name': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@practitioner_ary, 'name')) + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Practitioner") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Practitioner") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb new file mode 100644 index 000000000..d1babbf4f --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb @@ -0,0 +1,57 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310PractitionerroleSequence do + before do + @sequence_class = Inferno::Sequence::USCore310PractitionerroleSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @practitionerrole_ary = load_json_fixture(:us_core_practitionerrole_practitionerrole_ary) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'@practitionerrole_ary', @practitionerrole_ary) + + @query = { + 'specialty': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@practitionerrole_ary, 'specialty')) + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/PractitionerRole") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/PractitionerRole") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb new file mode 100644 index 000000000..fbbc98935 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb @@ -0,0 +1,53 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310ProcedureSequence do + before do + @sequence_class = Inferno::Sequence::USCore310ProcedureSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Procedure") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Procedure") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb new file mode 100644 index 000000000..2599aabb6 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310PulseOximetrySequence do + before do + @sequence_class = Inferno::Sequence::USCore310PulseOximetrySequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id, + 'code': '59408-5' + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Observation") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Observation") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb new file mode 100644 index 000000000..e3ef0584c --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb @@ -0,0 +1,54 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310SmokingstatusSequence do + before do + @sequence_class = Inferno::Sequence::USCore310SmokingstatusSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token) + @patient_id = '123' + @instance.patient_id = @patient_id + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'unauthorized search test' do + before do + @test = @sequence_class[:unauthorized_search] + @sequence = @sequence_class.new(@instance, @client) + + @query = { + 'patient': @instance.patient_id, + 'code': '72166-2' + } + end + + it 'fails when the token refresh response has a success status' do + stub_request(:get, "#{@base_url}/Observation") + .with(query: @query) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 401, but found 200', exception.message + end + + it 'succeeds when the token refresh response has an error status' do + stub_request(:get, "#{@base_url}/Observation") + .with(query: @query) + .to_return(status: 401) + + @sequence.run_test(@test) + end + + it 'is omitted when no token is set' do + @instance.token = '' + + exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } + + assert_equal 'Do not test if no bearer token set', exception.message + end + end +end diff --git a/test/sequence/us_core_patient_sequence_test.rb b/test/sequence/us_core_patient_sequence_test.rb index 0c0cf6c40..7e8b85040 100644 --- a/test/sequence/us_core_patient_sequence_test.rb +++ b/test/sequence/us_core_patient_sequence_test.rb @@ -28,7 +28,7 @@ exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Bad response code: expected 401, but found 200", exception.message + assert_equal 'Bad response code: expected 401, but found 200', exception.message end it 'succeeds when the token refresh response has an error status' do From 7602c4bba6688edcef49351300446bd72f6573f2 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 14 Nov 2019 08:31:26 -0500 Subject: [PATCH 093/173] prevent generating empty unit tests --- generator/uscore/us_core_unit_test_generator.rb | 5 +++++ generator/uscore/uscore_generator.rb | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/generator/uscore/us_core_unit_test_generator.rb b/generator/uscore/us_core_unit_test_generator.rb index 0c44fb844..1bf0ef9ed 100644 --- a/generator/uscore/us_core_unit_test_generator.rb +++ b/generator/uscore/us_core_unit_test_generator.rb @@ -10,6 +10,8 @@ def tests def generate(sequence, path) template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'unit_test.rb.erb'))) class_name = sequence[:class_name] + return if tests[class_name].blank? + unit_tests = template.result_with_hash( class_name: class_name, tests: tests[class_name] @@ -63,6 +65,9 @@ def dynamic_search_params(search_params) .transform_values { |value| dynamic_search_param(value) } end + # From a string like: + # get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')) + # this method extracts the variable name '@careplan_ary' and the path 'category' def dynamic_search_param(param_value) match = param_value.match(/(@\w+).*'([\w\.]+)'/) { diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 94525f10f..04d48f012 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -446,8 +446,7 @@ def get_search_params(search_parameters, sequence) end def search_param_to_string(param, value) - value_string = "'#{value}'" unless value.start_with?('@') || - value.start_with?('get_value_for_search_param') + value_string = "'#{value}'" unless value.start_with?('@', 'get_value_for_search_param') "'#{param}': #{value_string || value}" end From aa8c2ed5d587def6c5c8ba9e9252ab481eb0449d Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 14 Nov 2019 12:48:05 -0500 Subject: [PATCH 094/173] remove placeholder unit test --- .../sequence/us_core_patient_sequence_test.rb | 226 ------------------ 1 file changed, 226 deletions(-) delete mode 100644 test/sequence/us_core_patient_sequence_test.rb diff --git a/test/sequence/us_core_patient_sequence_test.rb b/test/sequence/us_core_patient_sequence_test.rb deleted file mode 100644 index 7e8b85040..000000000 --- a/test/sequence/us_core_patient_sequence_test.rb +++ /dev/null @@ -1,226 +0,0 @@ -# frozen_string_literal: true - -require_relative '../test_helper' - -describe Inferno::Sequence::USCore310PatientSequence do - before do - @sequence_class = Inferno::Sequence::USCore310PatientSequence - @base_url = 'http://www.example.com/fhir' - @client = FHIR::Client.new(@base_url) - @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) - @patient_id = '123' - @instance.patient_id = @patient_id - @auth_header = { 'Authorization' => "Bearer #{@token}" } - end - - describe 'unauthorized search test' do - before do - @test = @sequence_class[:unauthorized_search] - @sequence = @sequence_class.new(@instance, @client) - @query = { _id: @patient_id } - end - - it 'fails when the token refresh response has a success status' do - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query) - .to_return(status: 200) - - exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - assert_equal 'Bad response code: expected 401, but found 200', exception.message - end - - it 'succeeds when the token refresh response has an error status' do - stub_request(:get, "#{@base_url}/Patient") - .with(query: @query) - .to_return(status: 401) - - @sequence.run_test(@test) - end - - it 'is omitted when no token is set' do - @instance.token = '' - - exception = assert_raises(Inferno::OmitException) { @sequence.run_test(@test) } - - assert_equal 'Do not test if no bearer token set', exception.message - end - end - - # describe 'id search test' do - # before do - # @test = @sequence_class[:id_search] - # @sequence = @sequence_class.new(@instance, @client) - # @query = { _id: @patient_id } - # end - - # it 'fails when the search response has a status other than 200' do - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 401) - - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - # assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message - # end - - # it 'fails when a resource other than a bundle is returned' do - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: FHIR::Patient.new.to_json) - - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - # assert_equal "Expected FHIR Bundle but found: Patient", exception.message - # end - - # it 'skips the test if no results are found' do - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: FHIR::Bundle.new.to_json) - - # exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } - - # assert_equal 'No resources appear to be available for this patient. Please use patients with more information.', exception.message - # end - - # it 'fails when the Patient id does not match the requested id' do - # @instance.patient_id = @patient_id - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: wrap_resources_in_bundle(FHIR::Patient.new(id: 'ID')).to_json) - - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - # assert_equal '_id on resource does not match _id requested', exception.message - # end - - # it 'fails when the Patient resource is invalid' do - # bad_patient = FHIR::Patient.new(id: @patient_id) - # bad_patient.gender = 'BAD_GENDER' - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: wrap_resources_in_bundle(bad_patient).to_json) - - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - # assert exception.message.start_with? 'Invalid Patient:' - # end - - # it 'succeeds whan a patient with the correct ID is returned' do - # patient = FHIR::Patient.new(id: @patient_id) - # @sequence.instance_variable_set(:'@patient', patient) - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: wrap_resources_in_bundle(patient).to_json) - - # @sequence.run_test(@test) - # end - # end - - # describe 'identifier search test' do - # before do - # @test = @sequence_class[:identifier_search] - # @sequence = @sequence_class.new(@instance, @client) - # @identifier_value = 'ABC' - # @identifier_system = 'http://www.example.com' - # @patient = FHIR::Patient.new( - # id: @patient_id, - # identifier: [{ system: @identifier_system, value: @identifier_value }] - # ) - # @query = { identifier: @identifier_value } - # @sequence.instance_variable_set(:'@resources_found', true) - # @sequence.instance_variable_set(:'@patient', @patient) - # @sequence.instance_variable_set(:'@patient_ary', [@patient]) - # end - - # it 'skips when no resources have been found' do - # @sequence.instance_variable_set(:'@resources_found', false) - - # exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } - - # assert_equal 'No resources appear to be available for this patient. Please use patients with more information.', exception.message - # end - - # it 'skips when none of the resources have an identifier' do - # @sequence.instance_variable_set(:'@patient_ary', [FHIR::Patient.new]) - - # exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } - - # assert_equal 'Could not resolve identifier in given resource', exception.message - # end - - # it 'fails when no Patient resource has been found' do - # @sequence.instance_variable_set(:'@patient', nil) - - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - # assert_equal 'Expected valid Patient resource to be present', exception.message - # end - - # it 'fails when the search response has a status other than 200' do - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 401) - - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - # assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message - # end - - # it 'fails when a resource other than a bundle is returned' do - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: FHIR::Patient.new.to_json) - - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - # assert_equal "Expected FHIR Bundle but found: Patient", exception.message - # end - - # it 'fails when no results are found' do - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: FHIR::Bundle.new.to_json) - - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - # assert_equal 'No resources of this type were returned', exception.message - # end - - # it 'fails when a Patient identifier does not match the requested identifier' do - # # @instance.patient_id = @patient_id - # patient = FHIR::Patient.new( - # id: '456', - # identifier: [{ system: @identifier_system, value: 'DEF' }] - # ) - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: wrap_resources_in_bundle([@patient, patient]).to_json) - - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - # assert_equal 'identifier on resource does not match identifier requested', exception.message - # end - - # it 'fails when the Patient resource is invalid' do - # @patient.gender = 'BAD_GENDER' - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: wrap_resources_in_bundle(@patient).to_json) - - # exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - - # assert exception.message.start_with? 'Invalid Patient:' - # end - - # it 'succeeds whan a Patient with the correct identifier is returned' do - # stub_request(:get, "#{@base_url}/Patient") - # .with(query: @query, headers: @auth_header) - # .to_return(status: 200, body: wrap_resources_in_bundle(@patient).to_json) - - # @sequence.run_test(@test) - # end - # end -end From 5df49ff3ac84c440c1b5b2b05b8c0ec0135c2e05 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 14 Nov 2019 13:47:26 -0500 Subject: [PATCH 095/173] add comment to unit tests indicating that they are generated --- generator/uscore/templates/unit_tests/unit_test.rb.erb | 3 +++ lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb | 3 +++ .../uscore_v3.1.0/test/pediatric_weight_for_height_test.rb | 3 +++ .../uscore_v3.1.0/test/us_core_allergyintolerance_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb | 3 +++ .../uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb | 3 +++ .../uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb | 3 +++ .../uscore_v3.1.0/test/us_core_documentreference_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb | 3 +++ .../uscore_v3.1.0/test/us_core_implantable_device_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_location_test.rb | 3 +++ .../uscore_v3.1.0/test/us_core_medicationrequest_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb | 3 +++ .../uscore_v3.1.0/test/us_core_practitionerrole_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb | 3 +++ lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb | 3 +++ 24 files changed, 72 insertions(+) diff --git a/generator/uscore/templates/unit_tests/unit_test.rb.erb b/generator/uscore/templates/unit_tests/unit_test.rb.erb index 9054d7246..480903424 100644 --- a/generator/uscore/templates/unit_tests/unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/unit_test.rb.erb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::<%= class_name %> do diff --git a/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb b/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb index 07c19ffbe..8b7aa163e 100644 --- a/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb +++ b/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310PediatricBmiForAgeSequence do diff --git a/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb b/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb index f8d5bac45..95f170a19 100644 --- a/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb +++ b/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310PediatricWeightForHeightSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb index d7fdaaf7e..b5f92f6b5 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310AllergyintoleranceSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb index c56df4416..300c0204c 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310CareplanSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb index cc6b68bc3..7e1ffe223 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310CareteamSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb index 76f336a65..107111597 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310ConditionSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb index df7d22f20..bc143b193 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310DiagnosticreportLabSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb index 6e75eb182..f3463a7f9 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310DiagnosticreportNoteSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb index 1e98a5520..5241be4ab 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310DocumentreferenceSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb index 44706d0ed..3f2b4a79b 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310EncounterSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb index 26084e9d6..fd92a930f 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310GoalSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb index 3a19f8a96..a84e0adfd 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310ImmunizationSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb index c3c36047f..e11934c0d 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310ImplantableDeviceSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb index 16028065b..04305417a 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310LocationSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb index 9b4f30806..4d316bd71 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310MedicationrequestSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb index 885443575..8d9a56610 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310ObservationLabSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb index 11635d35b..c1bce56c5 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310OrganizationSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb index a3862f08e..df0d9888b 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310PatientSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb index 4b8492d1d..5c3a1e734 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310PractitionerSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb index d1babbf4f..29fb9b024 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310PractitionerroleSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb index fbbc98935..9ac7cc1b5 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310ProcedureSequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb index 2599aabb6..a45528acc 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310PulseOximetrySequence do diff --git a/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb index e3ef0584c..183cf55ae 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb @@ -1,5 +1,8 @@ # frozen_string_literal: true +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + require_relative '../../../../test/test_helper' describe Inferno::Sequence::USCore310SmokingstatusSequence do From 64a319ce7e827f1d182931f264ef10c5c2053301 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Sun, 3 Nov 2019 22:02:38 -0500 Subject: [PATCH 096/173] Integrate BDT, all but config variables --- config.yml | 1 + generator/bdt/bdt-structure.json | 588 ++++++++++++++++++ generator/bdt/bdt_generator.rb | 144 +++++ generator/bdt/templates/bdt_base.rb | 126 ++++ generator/bdt/templates/module.yml.erb | 13 + generator/bdt/templates/sequence.rb.erb | 40 ++ .../modules/bdt/auth_group_level_sequence.rb | 61 ++ .../bdt/auth_patient_level_sequence.rb | 61 ++ .../modules/bdt/auth_system_level_sequence.rb | 61 ++ .../bdt/auth_token_endpoint_sequence.rb | 253 ++++++++ lib/app/modules/bdt/bdt_base.rb | 118 ++++ lib/app/modules/bdt/download_sequence.rb | 73 +++ lib/app/modules/bdt/group_sequence.rb | 181 ++++++ lib/app/modules/bdt/patient_sequence.rb | 181 ++++++ lib/app/modules/bdt/status_sequence.rb | 61 ++ lib/app/modules/bdt/system_sequence.rb | 181 ++++++ lib/app/modules/bdt_module.yml | 24 + lib/app/utils/logged_rest_client.rb | 23 +- 18 files changed, 2184 insertions(+), 6 deletions(-) create mode 100644 generator/bdt/bdt-structure.json create mode 100644 generator/bdt/bdt_generator.rb create mode 100644 generator/bdt/templates/bdt_base.rb create mode 100644 generator/bdt/templates/module.yml.erb create mode 100644 generator/bdt/templates/sequence.rb.erb create mode 100644 lib/app/modules/bdt/auth_group_level_sequence.rb create mode 100644 lib/app/modules/bdt/auth_patient_level_sequence.rb create mode 100644 lib/app/modules/bdt/auth_system_level_sequence.rb create mode 100644 lib/app/modules/bdt/auth_token_endpoint_sequence.rb create mode 100644 lib/app/modules/bdt/bdt_base.rb create mode 100644 lib/app/modules/bdt/download_sequence.rb create mode 100644 lib/app/modules/bdt/group_sequence.rb create mode 100644 lib/app/modules/bdt/patient_sequence.rb create mode 100644 lib/app/modules/bdt/status_sequence.rb create mode 100644 lib/app/modules/bdt/system_sequence.rb create mode 100644 lib/app/modules/bdt_module.yml diff --git a/config.yml b/config.yml index f94387a9b..10fd74afe 100644 --- a/config.yml +++ b/config.yml @@ -44,6 +44,7 @@ modules: - smart - argonaut - uscore_v3.1.0 + - bdt # preset fhir servers: optional. Minimally requires name, uri, module, optional inferno_uri, client_id, client_secret, scopes, instructions link presets: diff --git a/generator/bdt/bdt-structure.json b/generator/bdt/bdt-structure.json new file mode 100644 index 000000000..588be5957 --- /dev/null +++ b/generator/bdt/bdt-structure.json @@ -0,0 +1,588 @@ +{ + "name": "__ROOT__", + "type": "group", + "path": "", + "children": [ + { + "name": "Authorization", + "type": "group", + "children": [ + { + "name": "Kick-off request at the system-level export endpoint", + "type": "group", + "children": [ + { + "id": "Auth-01.0.0", + "name": "system-level export - requires authorization header", + "description": "The server should require authorization header", + "type": "test", + "path": "0.0.0" + }, + { + "id": "Auth-01.0.1", + "name": "system-level export - rejects expired token", + "type": "test", + "path": "0.0.1" + }, + { + "id": "Auth-01.0.2", + "name": "system-level export - rejects invalid token", + "type": "test", + "path": "0.0.2" + } + ], + "path": "0.0" + }, + { + "name": "Kick-off request at the patient-level export endpoint", + "type": "group", + "children": [ + { + "id": "Auth-01.1.0", + "name": "patient-level export - requires authorization header", + "description": "The server should require authorization header", + "type": "test", + "path": "0.1.0" + }, + { + "id": "Auth-01.1.1", + "name": "patient-level export - rejects expired token", + "type": "test", + "path": "0.1.1" + }, + { + "id": "Auth-01.1.2", + "name": "patient-level export - rejects invalid token", + "type": "test", + "path": "0.1.2" + } + ], + "path": "0.1" + }, + { + "name": "Kick-off request at the group-level export endpoint", + "type": "group", + "children": [ + { + "id": "Auth-01.2.0", + "name": "group-level export - requires authorization header", + "description": "The server should require authorization header", + "type": "test", + "path": "0.2.0" + }, + { + "id": "Auth-01.2.1", + "name": "group-level export - rejects expired token", + "type": "test", + "path": "0.2.1" + }, + { + "id": "Auth-01.2.2", + "name": "group-level export - rejects invalid token", + "type": "test", + "path": "0.2.2" + } + ], + "path": "0.2" + }, + { + "name": "Token endpoint", + "type": "group", + "children": [ + { + "id": "Auth-02", + "name": "Requires \"application/x-www-form-urlencoded\" POSTs", + "description": "After generating an authentication JWT, the client requests a new access token via HTTP POST to the FHIR authorization server's token endpoint URL, using content-type application/x-www-form-urlencoded.", + "type": "test", + "path": "0.3.0" + }, + { + "id": "Auth-03", + "name": "The 'grant_type' parameter must be present", + "description": "The server should reply with 400 Bad Request if the grant_type parameter is not sent by the client.", + "type": "test", + "path": "0.3.1" + }, + { + "id": "Auth-04", + "name": "The \"grant_type\" must equal \"client_credentials\"", + "description": "The server should reply with 400 Bad Request if the grant_type parameter is not client_credentials.", + "type": "test", + "path": "0.3.2" + }, + { + "id": "Auth-05", + "name": "The \"client_assertion_type\" must be present", + "description": "The server should reply with 400 Bad Request if the client_assertion_type parameter is not sent by the client.", + "type": "test", + "path": "0.3.3" + }, + { + "id": "Auth-06", + "name": "The \"client_assertion_type\" must be jwt-bearer", + "description": "The server should reply with 400 Bad Request if the client_assertion_type parameter is not equal to urn:ietf:params:oauth:client-assertion-type:jwt-bearer", + "type": "test", + "path": "0.3.4" + }, + { + "id": "Auth-07", + "name": "The client_assertion parameter must be a token", + "description": "This test verifies that if the client sends something other then a JWT, the server will detect it and reject the request.", + "type": "test", + "path": "0.3.5" + }, + { + "id": "Auth-08", + "name": "Validates authenticationToken.aud", + "description": "The aud claim of the authentication JWT must be the authorization server's \"token URL\" (the same URL to which this authentication JWT will be posted)", + "type": "test", + "path": "0.3.6" + }, + { + "id": "Auth-09", + "name": "Validates authenticationToken.iss", + "description": "The iss claim of the authentication JWT must equal the registered client_id", + "type": "test", + "path": "0.3.7" + }, + { + "id": "Auth-10", + "name": "Only accept registered client IDs", + "description": "Verify that clients can't use random client id", + "type": "test", + "path": "0.3.8" + }, + { + "id": "Auth-11", + "name": "Requires scope", + "description": "", + "type": "test", + "path": "0.3.9" + }, + { + "id": "Auth-12", + "name": "Rejects empty scope", + "description": "", + "type": "test", + "path": "0.3.10" + }, + { + "id": "Auth-13", + "name": "Validates scopes", + "description": "This test verifies that only valid system scopes are accepted by the server", + "type": "test", + "path": "0.3.11" + }, + { + "id": "Auth-14", + "name": "Supports wildcard action scopes", + "description": "Verifies that scopes like system/Patient.* are supported", + "type": "test", + "path": "0.3.12" + }, + { + "id": "Auth-15", + "name": "Rejects unknown action scopes", + "description": "Verifies that scopes like system/Patient.unknownAction are rejected", + "type": "test", + "path": "0.3.13" + }, + { + "id": "Auth-16", + "name": "Supports wildcard resource scopes", + "description": "Verifies that scopes like system/*.read are supported", + "type": "test", + "path": "0.3.14" + }, + { + "id": "Auth-17", + "name": "Rejects unknown resource scopes", + "description": "Verifies that scopes like system/UnknownResource.read are rejected", + "type": "test", + "path": "0.3.15" + }, + { + "id": "Auth-18", + "name": "validates the jku token header", + "description": "", + "type": "test", + "path": "0.3.16" + }, + { + "id": "Auth-19", + "name": "Validates the token signature", + "description": "This test attempts to obtain an access token with a request that is completely valid, except that the authentication token is signed with unknown private key.", + "type": "test", + "path": "0.3.17" + }, + { + "id": "Auth-20", + "name": "Authorization using JWKS URL", + "type": "test", + "path": "0.3.18" + } + ], + "path": "0.3" + } + ], + "path": "0" + }, + { + "name": "Download Endpoint", + "type": "group", + "children": [ + { + "id": "Download-01", + "name": "Requires valid access token if the requiresAccessToken field in the status body is true", + "description": "If the requiresAccessToken field in the Complete Status body is set to true, the request MUST include a valid access token.", + "type": "test", + "path": "1.0" + }, + { + "id": "Download-02", + "name": "Does not require access token if the requiresAccessToken field in the status body is not true", + "description": "Verifies that files can be downloaded without authorization if the requiresAccessToken field in the complete status body is not set to true", + "type": "test", + "path": "1.1" + }, + { + "id": "Download-03", + "name": "Replies properly in case of error", + "description": "The server should return HTTP Status Code of 4XX or 5XX", + "type": "test", + "path": "1.2" + }, + { + "id": "Download-04", + "name": "Generates valid file response", + "description": "Runs a set of assertions to verify that:
    • The server returns HTTP status of 200 OK
    • The server returns a Content-Type header that matches the file format being delivered. For files in ndjson format, MUST be application/fhir+ndjson
    • The response body is valid FHIR ndjson (unless other format is requested)
    • An Accept header might be sent (optional, defaults to application/fhir+ndjson)
    ", + "type": "test", + "path": "1.3" + } + ], + "path": "1" + }, + { + "name": "Patient-level export", + "type": "group", + "children": [ + { + "id": "Patient-level-01", + "name": "Requires Accept header", + "description": "The Accept header specifies the format of the optional OperationOutcome response to the kick-off request. Currently, only application/fhir+json is supported.", + "type": "test", + "path": "2.0" + }, + { + "id": "Patient-level-02", + "name": "Requires Prefer header to equal respond-async", + "description": "The Prefer request header is required and specifies whether the response is immediate or asynchronous. The header MUST be set to respond-async. Red More", + "type": "test", + "path": "2.1" + }, + { + "id": "Patient-level-03.0", + "name": "Accepts _outputFormat=application/fhir+ndjson", + "description": "Verifies that the server accepts application/fhir+ndjson as _outputFormat parameter", + "type": "test", + "path": "2.2" + }, + { + "id": "Patient-level-03.1", + "name": "Accepts _outputFormat=application/ndjson", + "description": "Verifies that the server accepts application/ndjson as _outputFormat parameter", + "type": "test", + "path": "2.3" + }, + { + "id": "Patient-level-03.2", + "name": "Accepts _outputFormat=ndjson", + "description": "Verifies that the server accepts ndjson as _outputFormat parameter", + "type": "test", + "path": "2.4" + }, + { + "id": "Patient-level-04.0", + "name": "Rejects unsupported format \"_outputFormat=application/xml\"", + "description": "This tests if the server rejects _outputFormat=application/xml parameter, even though application/xml is valid mime type.", + "type": "test", + "path": "2.5" + }, + { + "id": "Patient-level-04.1", + "name": "Rejects unsupported format \"_outputFormat=text/html\"", + "description": "This tests if the server rejects _outputFormat=text/html parameter, even though text/html is valid mime type.", + "type": "test", + "path": "2.6" + }, + { + "id": "Patient-level-04.2", + "name": "Rejects unsupported format \"_outputFormat=x-custom\"", + "description": "This tests if the server rejects _outputFormat=x-custom parameter, even though x-custom is valid mime type.", + "type": "test", + "path": "2.7" + }, + { + "id": "Patient-level-05", + "name": "Rejects _since={invalid date} parameter", + "description": "The server should reject exports if the _since parameter is not a valid date", + "type": "test", + "path": "2.8" + }, + { + "id": "Patient-level-06", + "name": "Rejects _since={future date} parameter", + "description": "The server should reject exports if the _since parameter is a date in the future", + "type": "test", + "path": "2.9" + }, + { + "id": "Patient-level-07", + "name": "Validates the _type parameter", + "description": "Verifies that the request is rejected if the _type contains invalid resource type", + "type": "test", + "path": "2.10" + }, + { + "id": "Patient-level-08", + "name": "Accepts the _typeFilter parameter", + "description": "The _typeFilter parameter is optional so the servers should not reject it, even if they don't support it", + "type": "test", + "path": "2.11" + }, + { + "id": "Patient-level-09", + "name": "Response - Success", + "description": "Verifies that the server starts an export if called with valid parameters. The status code must be 202 Accepted and a Content-Location header must be returned. The response body should be either empty, or a JSON OperationOutcome.", + "type": "test", + "path": "2.12" + } + ], + "path": "2" + }, + { + "name": "System-level export", + "type": "group", + "children": [ + { + "id": "System-level-01", + "name": "Requires Accept header", + "description": "The Accept header specifies the format of the optional OperationOutcome response to the kick-off request. Currently, only application/fhir+json is supported.", + "type": "test", + "path": "3.0" + }, + { + "id": "System-level-02", + "name": "Requires Prefer header to equal respond-async", + "description": "The Prefer request header is required and specifies whether the response is immediate or asynchronous. The header MUST be set to respond-async. Red More", + "type": "test", + "path": "3.1" + }, + { + "id": "System-level-03.0", + "name": "Accepts _outputFormat=application/fhir+ndjson", + "description": "Verifies that the server accepts application/fhir+ndjson as _outputFormat parameter", + "type": "test", + "path": "3.2" + }, + { + "id": "System-level-03.1", + "name": "Accepts _outputFormat=application/ndjson", + "description": "Verifies that the server accepts application/ndjson as _outputFormat parameter", + "type": "test", + "path": "3.3" + }, + { + "id": "System-level-03.2", + "name": "Accepts _outputFormat=ndjson", + "description": "Verifies that the server accepts ndjson as _outputFormat parameter", + "type": "test", + "path": "3.4" + }, + { + "id": "System-level-04.0", + "name": "Rejects unsupported format \"_outputFormat=application/xml\"", + "description": "This tests if the server rejects _outputFormat=application/xml parameter, even though application/xml is valid mime type.", + "type": "test", + "path": "3.5" + }, + { + "id": "System-level-04.1", + "name": "Rejects unsupported format \"_outputFormat=text/html\"", + "description": "This tests if the server rejects _outputFormat=text/html parameter, even though text/html is valid mime type.", + "type": "test", + "path": "3.6" + }, + { + "id": "System-level-04.2", + "name": "Rejects unsupported format \"_outputFormat=x-custom\"", + "description": "This tests if the server rejects _outputFormat=x-custom parameter, even though x-custom is valid mime type.", + "type": "test", + "path": "3.7" + }, + { + "id": "System-level-05", + "name": "Rejects _since={invalid date} parameter", + "description": "The server should reject exports if the _since parameter is not a valid date", + "type": "test", + "path": "3.8" + }, + { + "id": "System-level-06", + "name": "Rejects _since={future date} parameter", + "description": "The server should reject exports if the _since parameter is a date in the future", + "type": "test", + "path": "3.9" + }, + { + "id": "System-level-07", + "name": "Validates the _type parameter", + "description": "Verifies that the request is rejected if the _type contains invalid resource type", + "type": "test", + "path": "3.10" + }, + { + "id": "System-level-08", + "name": "Accepts the _typeFilter parameter", + "description": "The _typeFilter parameter is optional so the servers should not reject it, even if they don't support it", + "type": "test", + "path": "3.11" + }, + { + "id": "System-level-09", + "name": "Response - Success", + "description": "Verifies that the server starts an export if called with valid parameters. The status code must be 202 Accepted and a Content-Location header must be returned. The response body should be either empty, or a JSON OperationOutcome.", + "type": "test", + "path": "3.12" + } + ], + "path": "3" + }, + { + "name": "Group-level export", + "type": "group", + "children": [ + { + "id": "Group-level-01", + "name": "Requires Accept header", + "description": "The Accept header specifies the format of the optional OperationOutcome response to the kick-off request. Currently, only application/fhir+json is supported.", + "type": "test", + "path": "4.0" + }, + { + "id": "Group-level-02", + "name": "Requires Prefer header to equal respond-async", + "description": "The Prefer request header is required and specifies whether the response is immediate or asynchronous. The header MUST be set to respond-async. Red More", + "type": "test", + "path": "4.1" + }, + { + "id": "Group-level-03.0", + "name": "Accepts _outputFormat=application/fhir+ndjson", + "description": "Verifies that the server accepts application/fhir+ndjson as _outputFormat parameter", + "type": "test", + "path": "4.2" + }, + { + "id": "Group-level-03.1", + "name": "Accepts _outputFormat=application/ndjson", + "description": "Verifies that the server accepts application/ndjson as _outputFormat parameter", + "type": "test", + "path": "4.3" + }, + { + "id": "Group-level-03.2", + "name": "Accepts _outputFormat=ndjson", + "description": "Verifies that the server accepts ndjson as _outputFormat parameter", + "type": "test", + "path": "4.4" + }, + { + "id": "Group-level-04.0", + "name": "Rejects unsupported format \"_outputFormat=application/xml\"", + "description": "This tests if the server rejects _outputFormat=application/xml parameter, even though application/xml is valid mime type.", + "type": "test", + "path": "4.5" + }, + { + "id": "Group-level-04.1", + "name": "Rejects unsupported format \"_outputFormat=text/html\"", + "description": "This tests if the server rejects _outputFormat=text/html parameter, even though text/html is valid mime type.", + "type": "test", + "path": "4.6" + }, + { + "id": "Group-level-04.2", + "name": "Rejects unsupported format \"_outputFormat=x-custom\"", + "description": "This tests if the server rejects _outputFormat=x-custom parameter, even though x-custom is valid mime type.", + "type": "test", + "path": "4.7" + }, + { + "id": "Group-level-05", + "name": "Rejects _since={invalid date} parameter", + "description": "The server should reject exports if the _since parameter is not a valid date", + "type": "test", + "path": "4.8" + }, + { + "id": "Group-level-06", + "name": "Rejects _since={future date} parameter", + "description": "The server should reject exports if the _since parameter is a date in the future", + "type": "test", + "path": "4.9" + }, + { + "id": "Group-level-07", + "name": "Validates the _type parameter", + "description": "Verifies that the request is rejected if the _type contains invalid resource type", + "type": "test", + "path": "4.10" + }, + { + "id": "Group-level-08", + "name": "Accepts the _typeFilter parameter", + "description": "The _typeFilter parameter is optional so the servers should not reject it, even if they don't support it", + "type": "test", + "path": "4.11" + }, + { + "id": "Group-level-09", + "name": "Response - Success", + "description": "Verifies that the server starts an export if called with valid parameters. The status code must be 202 Accepted and a Content-Location header must be returned. The response body should be either empty, or a JSON OperationOutcome.", + "type": "test", + "path": "4.12" + } + ], + "path": "4" + }, + { + "name": "Status Endpoint", + "type": "group", + "children": [ + { + "id": "Status-01", + "name": "Responds with 202 for active transaction IDs", + "description": "

    The status endpoint should return 202 status code until the export is completed.

    See https://github.com/smart-on-fhir/fhir-bulk-data-docs/blob/master/export.md#response---in-progress-status", + "type": "test", + "path": "5.0" + }, + { + "id": "Status-02", + "name": "Replies properly in case of error", + "description": "Runs a set of assertions to verify that:
    • The returned HTTP status code is 5XX
    • The server returns a FHIR OperationOutcome resource in JSON format

    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.

    See https://github.com/smart-on-fhir/fhir-bulk-data-docs/blob/master/export.md#response---error-status-1", + "type": "test", + "path": "5.1" + }, + { + "id": "Status-03", + "name": "Generates valid status response", + "description": "Runs a set of assertions to verify that:
    • The status endpoint should return 200 status code when the export is completed
    • The status endpoint should respond with JSON
    • The expires header (if set) must be valid date in the future
    • The JSON response contains transactionTime which is a valid FHIR instant
    • The JSON response contains the kick-off URL in request property
    • The JSON response contains requiresAccessToken boolean property
    • The JSON response contains an output array in which:
      • Every item has valid type property
      • Every item has valid url property
      • Every item may a count number property
    • The JSON response contains an error array in which:
      • Every item has valid type property
      • Every item has valid url property
      • Every item may a count number property
    ", + "type": "test", + "path": "5.2" + } + ], + "path": "5" + } + ] +} \ No newline at end of file diff --git a/generator/bdt/bdt_generator.rb b/generator/bdt/bdt_generator.rb new file mode 100644 index 000000000..9cc8cb16f --- /dev/null +++ b/generator/bdt/bdt_generator.rb @@ -0,0 +1,144 @@ +# frozen_string_literal: true + +require_relative '../generator_base' + +module Inferno + module Generator + class BDTGenerator < Generator::Base + GEN_PATH = './generator/bdt' + OUT_PATH = './lib/app/modules' + + def generate + structure = JSON.parse(File.read(GEN_PATH + '/bdt-structure.json')) + + revised_structure = revise_structure(structure) + + metadata = extract_metadata(revised_structure) + + metadata[:groups].map { |g| g[:sequences] }.flatten.each { |s| generate_sequence(s) } + generate_module(metadata) + copy_base + end + + def extract_test_from_group(group, list) + group['children'].each do |child| + if child['type'] == group + extract_test_from_group(child, list) + else + + new_test = { + name: clean_test_name(child['name']), + path: child['path'], + id: child['id'], + description: child['description'] + } + + list << new_test + + end + end + end + + def generate_sequence(sequence) + puts "Generating #{sequence[:name]}\n" + file_name = sequence_out_path + '/' + sequence[:name].downcase.gsub(' ', '_') + '_sequence.rb' + + template = ERB.new(File.read(File.join(__dir__, 'templates/sequence.rb.erb'))) + output = template.result_with_hash(sequence) + FileUtils.mkdir_p(sequence_out_path) unless File.directory?(sequence_out_path) + File.write(file_name, output) + end + + def generate_module(module_info) + file_name = "#{module_yml_out_path}/#{@path}_module.yml" + + template = ERB.new(File.read(File.join(__dir__, 'templates/module.yml.erb'))) + output = template.result_with_hash(module_info) + + File.write(file_name, output) + end + + def extract_metadata(source) + metadata = { + name: 'test', + groups: [] + } + + source['children'].each do |group| + new_group = { + name: group['name'], + sequences: [] + } + + group['children'].each do |sequence| + new_sequence = { + tests: [] + } + + extract_test_from_group(sequence, new_sequence[:tests]) + + new_sequence[:id] = new_sequence[:tests].first&.dig(:id)&.split('-')&.first + new_sequence[:name] = new_sequence[:id].split('_').map(&:capitalize).join(' ') + new_sequence[:description] = sequence['name'] + new_sequence[:sequence_class_name] = 'BDT' + new_sequence[:id].split('_').map(&:capitalize).join + 'Sequence' + + new_group[:sequences] << new_sequence + end + + metadata[:groups] << new_group + end + + metadata + end + + def copy_base + source_file = File.join(__dir__, 'templates/bdt_base.rb') + out_file_name = sequence_out_path + '/bdt_base.rb' + FileUtils.cp(source_file, out_file_name) + end + + def revise_structure(structure) + auth_group = structure['children'][0] + + auth_group['children'].each do |seq_level| + new_name = 'Auth_' + seq_level['name'].gsub(' ', '_') + + match = seq_level['name'].match(/([^\s]+\-level)+/) + new_name = 'Auth_' + match[1].gsub('-', '_') unless match.nil? + + seq_level['children'].each do |test| + test['id'].gsub!('Auth', new_name) + end + end + + data_group = { + 'name' => 'Bulk Transfer', + 'type' => 'group', + 'children' => structure['children'].drop(1) + } + + structure['children'] = [auth_group, data_group] + structure + end + + # def generate_sequence(sequence) + + # file_name = OUT_PATH + '/bdt/bdt_' + sequence[:id].downcase + '_sequence.rb' + + # template = ERB.new(File.read(GEN_PATH + '/templates/sequence.rb.erb')) + # output = template.result_with_hash(sequence) + + # File.write(file_name, output) + + # end + + # def generate_module(module_info) + + # end + + def clean_test_name(test_name) + test_name.gsub("'", '"') + end + end + end +end diff --git a/generator/bdt/templates/bdt_base.rb b/generator/bdt/templates/bdt_base.rb new file mode 100644 index 000000000..71e81a0cc --- /dev/null +++ b/generator/bdt/templates/bdt_base.rb @@ -0,0 +1,126 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class BDTBase < SequenceBase + BDT_URL = 'http://localhost:4500/api/tests' + + BDT_CONFIG = { + 'path' => '5.0', + 'format' => 'json', + 'settings' => { + 'baseURL' => 'https://bulk-data.smarthealthit.org/eyJlcnIiOiIiLCJwYWdlIjoxMDAsImR1ciI6MTAsInRsdCI6MTUsIm0iOjF9/fhir', + 'tokenEndpoint' => 'https://bulk-data.smarthealthit.org/auth/token', + 'clientId' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJlZ2lzdHJhdGlvbi10b2tlbiJ9.eyJqd2tzIjp7ImtleXMiOlt7Imt0eSI6IkVDIiwiY3J2I' \ + 'joiUC0zODQiLCJ4IjoiTTFyM0dVZDBZRHBXbHF0ZjRHYXJPcmN3SWoyRnhDQlFmQnN4QmlLUzdmTTl1Z1pVUlBialp6YjZ5bDZOSlFETCIsInkiOiJmUWV' \ + 'vRm9wTTc0VjlXSWRYR0NHX3NtVm56c2N4eGlXM0hNQnNjd2tiUlVRSWxqMmFrTTM2WVB4ZDF2Z2M5WWVJIiwia2V5X29wcyI6WyJ2ZXJpZnkiXSwiZXh0I' \ + 'jp0cnVlLCJraWQiOiJmMjkzOTdlZjQ0NmQ1YzE0ODBhZGViYmNiNTk5MTBiMyIsImFsZyI6IkVTMzg0In0seyJrdHkiOiJFQyIsImNydiI6IlAtMzg0Iiw' \ + 'iZCI6IkxfOGh3VXlsbndoYWpNUGRqdkV0MTUtd0ZLbldDVEJ2WG1kSm5waTkySHN4TFVYWEwzS1ZidDlVYndFRjN2S0giLCJ4IjoiTTFyM0dVZDBZRHBXb' \ + 'HF0ZjRHYXJPcmN3SWoyRnhDQlFmQnN4QmlLUzdmTTl1Z1pVUlBialp6YjZ5bDZOSlFETCIsInkiOiJmUWVvRm9wTTc0VjlXSWRYR0NHX3NtVm56c2N4eGl' \ + 'XM0hNQnNjd2tiUlVRSWxqMmFrTTM2WVB4ZDF2Z2M5WWVJIiwia2V5X29wcyI6WyJzaWduIl0sImV4dCI6dHJ1ZSwia2lkIjoiZjI5Mzk3ZWY0NDZkNWMxN' \ + 'DgwYWRlYmJjYjU5OTEwYjMiLCJhbGciOiJFUzM4NCJ9XX0sImFjY2Vzc1Rva2Vuc0V4cGlyZUluIjoxNSwiaWF0IjoxNTU3NTAwNDIwfQ.2NJEarwScjRZ' \ + 'ZaDlpL1ixLxhWdfWFo_EFcaKJfL1oHE', + 'systemExportEndpoint' => '/$export', + 'patientExportEndpoint' => '/Patient/$export', + 'groupExportEndpoint' => '/Group/6/$export', + 'fastestResource' => 'ImagingStudy', + 'requiresAuth' => false, + 'sinceParam' => '_since', + 'jwksUrlAuth' => true, + 'jwksAuth' => true, + 'publicKey' => { + 'kty' => 'EC', + 'crv' => 'P-384', + 'x' => 'M1r3GUd0YDpWlqtf4GarOrcwIj2FxCBQfBsxBiKS7fM9ugZURPbjZzb6yl6NJQDL', + 'y' => 'fQeoFopM74V9WIdXGCG_smVnzscxxiW3HMBscwkbRUQIlj2akM36YPxd1vgc9YeI', + 'key_ops' => [ + 'verify' + ], + 'ext' => true, + 'kid' => 'f29397ef446d5c1480adebbcb59910b3', + 'alg' => 'ES384' + }, + 'privateKey' => { + 'kty' => 'EC', + 'crv' => 'P-384', + 'd' => 'L_8hwUylnwhajMPdjvEt15-wFKnWCTBvXmdJnpi92HsxLUXXL3KVbt9UbwEF3vKH', + 'x' => 'M1r3GUd0YDpWlqtf4GarOrcwIj2FxCBQfBsxBiKS7fM9ugZURPbjZzb6yl6NJQDL', + 'y' => 'fQeoFopM74V9WIdXGCG_smVnzscxxiW3HMBscwkbRUQIlj2akM36YPxd1vgc9YeI', + 'key_ops' => [ + 'sign' + ], + 'ext' => true, + 'kid' => 'f29397ef446d5c1480adebbcb59910b3', + 'alg' => 'ES384' + } + } + }.freeze + + def run_bdt(path) + payload = { + 'path' => path, + 'settings' => BDT_CONFIG + } + response = RestClient.post(BDT_URL, payload.to_json, content_type: :json, accept: :json) + response.body.split('\n').each do |chunk| + message = JSON.parse(chunk.strip) + + data = message['data'] + next if data.nil? + + warning do + data['warnings'].each do |warning| + assert false, warning + end + end + # request = { + # method: :post, + # url: url, + # headers: headers, + # payload: payload + # } + # response = { + # code: response.code, + # headers: response.headers, + # body: response.body + # } + # LoggedRestClient.record_response() + + requests = {} + + data['decorations'].each do |key, value| + if value['__type'] == 'request' + last_request = { + method: value['method'], + url: value['url'], + headers: value['headers'], + payload: value['body'] + } + # binding.pry if value['method'] == 'POST' + requests['request_' + key.chomp('Request').strip] = last_request + end + + next unless value['__type'] == 'response' + + request_key = 'request_' + key.gsub(/[ ]*Response[ \d]*/, '') + next unless requests.key? request_key + + referenced_request = requests[request_key] + response = { + code: value['statusCode'], + headers: value['headers'], + body: value['body']&.to_json + } + LoggedRestClient.record_response(referenced_request, response) + end + + omit 'Not supported' if data['status'] == 'not-supported' + + assert message['status'] != 'error', data['error'] + end + rescue RestClient::Exception => e + assert false, "Error connecting to BDT Service: #{e.message}" + end + end + end +end diff --git a/generator/bdt/templates/module.yml.erb b/generator/bdt/templates/module.yml.erb new file mode 100644 index 000000000..e9a7942dd --- /dev/null +++ b/generator/bdt/templates/module.yml.erb @@ -0,0 +1,13 @@ +name: bdt +title: Bulk Data Testing (under development) +description: BDT Integration +fhir_version: r4 +default_test_set: developer +test_sets: + developer: + view: default + tests: <% groups.each do |group| %> + - name: <%= group[:name] %> + run_all: true + sequences:<% group[:sequences].each do |sequence| %> + - <%=sequence[:sequence_class_name]%><% end %><% end %> \ No newline at end of file diff --git a/generator/bdt/templates/sequence.rb.erb b/generator/bdt/templates/sequence.rb.erb new file mode 100644 index 000000000..908e8a71d --- /dev/null +++ b/generator/bdt/templates/sequence.rb.erb @@ -0,0 +1,40 @@ +# frozen_string_literal: true + +require_relative 'bdt_base' + +module Inferno + module Sequence + class <%=sequence_class_name%> < BDTBase + + group 'FIXME' + + title '<%=name %>' + + description '<%=description %>' + + test_id_prefix '<%=id%>' + + requires :token + conformance_supports :CarePlan + + details %( + <%= name %> + ) + <% tests.each do |test|%> + test '<%=test[:name]%>' do + metadata do + id '<%= test[:id].split('-').last %>' + link 'http://bulkdatainfo' + description %( + <%= test[:description] %> + ) + versions :r4 + end + + run_bdt('<%=test[:path]%>') + + end<% end%> + + end + end +end \ No newline at end of file diff --git a/lib/app/modules/bdt/auth_group_level_sequence.rb b/lib/app/modules/bdt/auth_group_level_sequence.rb new file mode 100644 index 000000000..a1b4cc669 --- /dev/null +++ b/lib/app/modules/bdt/auth_group_level_sequence.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +require_relative 'bdt_base' + +module Inferno + module Sequence + class BDTAuthGroupLevelSequence < BDTBase + group 'FIXME' + + title 'Auth Group Level' + + description 'Kick-off request at the group-level export endpoint' + + test_id_prefix 'Auth_group_level' + + requires :token + conformance_supports :CarePlan + + details %( + Auth Group Level + ) + + test 'group-level export - requires authorization header' do + metadata do + id '01.2.0' + link 'http://bulkdatainfo' + description %( + The server should require authorization header + ) + versions :r4 + end + + run_bdt('0.2.0') + end + test 'group-level export - rejects expired token' do + metadata do + id '01.2.1' + link 'http://bulkdatainfo' + description %( + + ) + versions :r4 + end + + run_bdt('0.2.1') + end + test 'group-level export - rejects invalid token' do + metadata do + id '01.2.2' + link 'http://bulkdatainfo' + description %( + + ) + versions :r4 + end + + run_bdt('0.2.2') + end + end + end +end diff --git a/lib/app/modules/bdt/auth_patient_level_sequence.rb b/lib/app/modules/bdt/auth_patient_level_sequence.rb new file mode 100644 index 000000000..64f6c132b --- /dev/null +++ b/lib/app/modules/bdt/auth_patient_level_sequence.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +require_relative 'bdt_base' + +module Inferno + module Sequence + class BDTAuthPatientLevelSequence < BDTBase + group 'FIXME' + + title 'Auth Patient Level' + + description 'Kick-off request at the patient-level export endpoint' + + test_id_prefix 'Auth_patient_level' + + requires :token + conformance_supports :CarePlan + + details %( + Auth Patient Level + ) + + test 'patient-level export - requires authorization header' do + metadata do + id '01.1.0' + link 'http://bulkdatainfo' + description %( + The server should require authorization header + ) + versions :r4 + end + + run_bdt('0.1.0') + end + test 'patient-level export - rejects expired token' do + metadata do + id '01.1.1' + link 'http://bulkdatainfo' + description %( + + ) + versions :r4 + end + + run_bdt('0.1.1') + end + test 'patient-level export - rejects invalid token' do + metadata do + id '01.1.2' + link 'http://bulkdatainfo' + description %( + + ) + versions :r4 + end + + run_bdt('0.1.2') + end + end + end +end diff --git a/lib/app/modules/bdt/auth_system_level_sequence.rb b/lib/app/modules/bdt/auth_system_level_sequence.rb new file mode 100644 index 000000000..8a7c42cec --- /dev/null +++ b/lib/app/modules/bdt/auth_system_level_sequence.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +require_relative 'bdt_base' + +module Inferno + module Sequence + class BDTAuthSystemLevelSequence < BDTBase + group 'FIXME' + + title 'Auth System Level' + + description 'Kick-off request at the system-level export endpoint' + + test_id_prefix 'Auth_system_level' + + requires :token + conformance_supports :CarePlan + + details %( + Auth System Level + ) + + test 'system-level export - requires authorization header' do + metadata do + id '01.0.0' + link 'http://bulkdatainfo' + description %( + The server should require authorization header + ) + versions :r4 + end + + run_bdt('0.0.0') + end + test 'system-level export - rejects expired token' do + metadata do + id '01.0.1' + link 'http://bulkdatainfo' + description %( + + ) + versions :r4 + end + + run_bdt('0.0.1') + end + test 'system-level export - rejects invalid token' do + metadata do + id '01.0.2' + link 'http://bulkdatainfo' + description %( + + ) + versions :r4 + end + + run_bdt('0.0.2') + end + end + end +end diff --git a/lib/app/modules/bdt/auth_token_endpoint_sequence.rb b/lib/app/modules/bdt/auth_token_endpoint_sequence.rb new file mode 100644 index 000000000..624667fc1 --- /dev/null +++ b/lib/app/modules/bdt/auth_token_endpoint_sequence.rb @@ -0,0 +1,253 @@ +# frozen_string_literal: true + +require_relative 'bdt_base' + +module Inferno + module Sequence + class BDTAuthTokenEndpointSequence < BDTBase + group 'FIXME' + + title 'Auth Token Endpoint' + + description 'Token endpoint' + + test_id_prefix 'Auth_Token_endpoint' + + requires :token + conformance_supports :CarePlan + + details %( + Auth Token Endpoint + ) + + test 'Requires "application/x-www-form-urlencoded" POSTs' do + metadata do + id '02' + link 'http://bulkdatainfo' + description %( + After generating an authentication JWT, the client requests a new access token via HTTP POST to the FHIR authorization server's token endpoint URL, using content-type application/x-www-form-urlencoded. + ) + versions :r4 + end + + run_bdt('0.3.0') + end + test 'The "grant_type" parameter must be present' do + metadata do + id '03' + link 'http://bulkdatainfo' + description %( + The server should reply with 400 Bad Request if the grant_type parameter is not sent by the client. + ) + versions :r4 + end + + run_bdt('0.3.1') + end + test 'The "grant_type" must equal "client_credentials"' do + metadata do + id '04' + link 'http://bulkdatainfo' + description %( + The server should reply with 400 Bad Request if the grant_type parameter is not client_credentials. + ) + versions :r4 + end + + run_bdt('0.3.2') + end + test 'The "client_assertion_type" must be present' do + metadata do + id '05' + link 'http://bulkdatainfo' + description %( + The server should reply with 400 Bad Request if the client_assertion_type parameter is not sent by the client. + ) + versions :r4 + end + + run_bdt('0.3.3') + end + test 'The "client_assertion_type" must be jwt-bearer' do + metadata do + id '06' + link 'http://bulkdatainfo' + description %( + The server should reply with 400 Bad Request if the client_assertion_type parameter is not equal to urn:ietf:params:oauth:client-assertion-type:jwt-bearer + ) + versions :r4 + end + + run_bdt('0.3.4') + end + test 'The client_assertion parameter must be a token' do + metadata do + id '07' + link 'http://bulkdatainfo' + description %( + This test verifies that if the client sends something other then a JWT, the server will detect it and reject the request. + ) + versions :r4 + end + + run_bdt('0.3.5') + end + test 'Validates authenticationToken.aud' do + metadata do + id '08' + link 'http://bulkdatainfo' + description %( + The aud claim of the authentication JWT must be the authorization server's "token URL" (the same URL to which this authentication JWT will be posted) + ) + versions :r4 + end + + run_bdt('0.3.6') + end + test 'Validates authenticationToken.iss' do + metadata do + id '09' + link 'http://bulkdatainfo' + description %( + The iss claim of the authentication JWT must equal the registered client_id + ) + versions :r4 + end + + run_bdt('0.3.7') + end + test 'Only accept registered client IDs' do + metadata do + id '10' + link 'http://bulkdatainfo' + description %( + Verify that clients can't use random client id + ) + versions :r4 + end + + run_bdt('0.3.8') + end + test 'Requires scope' do + metadata do + id '11' + link 'http://bulkdatainfo' + description %( + + ) + versions :r4 + end + + run_bdt('0.3.9') + end + test 'Rejects empty scope' do + metadata do + id '12' + link 'http://bulkdatainfo' + description %( + + ) + versions :r4 + end + + run_bdt('0.3.10') + end + test 'Validates scopes' do + metadata do + id '13' + link 'http://bulkdatainfo' + description %( + This test verifies that only valid system scopes are accepted by the server + ) + versions :r4 + end + + run_bdt('0.3.11') + end + test 'Supports wildcard action scopes' do + metadata do + id '14' + link 'http://bulkdatainfo' + description %( + Verifies that scopes like system/Patient.* are supported + ) + versions :r4 + end + + run_bdt('0.3.12') + end + test 'Rejects unknown action scopes' do + metadata do + id '15' + link 'http://bulkdatainfo' + description %( + Verifies that scopes like system/Patient.unknownAction are rejected + ) + versions :r4 + end + + run_bdt('0.3.13') + end + test 'Supports wildcard resource scopes' do + metadata do + id '16' + link 'http://bulkdatainfo' + description %( + Verifies that scopes like system/*.read are supported + ) + versions :r4 + end + + run_bdt('0.3.14') + end + test 'Rejects unknown resource scopes' do + metadata do + id '17' + link 'http://bulkdatainfo' + description %( + Verifies that scopes like system/UnknownResource.read are rejected + ) + versions :r4 + end + + run_bdt('0.3.15') + end + test 'validates the jku token header' do + metadata do + id '18' + link 'http://bulkdatainfo' + description %( + + ) + versions :r4 + end + + run_bdt('0.3.16') + end + test 'Validates the token signature' do + metadata do + id '19' + link 'http://bulkdatainfo' + description %( + This test attempts to obtain an access token with a request that is completely valid, except that the authentication token is signed with unknown private key. + ) + versions :r4 + end + + run_bdt('0.3.17') + end + test 'Authorization using JWKS URL' do + metadata do + id '20' + link 'http://bulkdatainfo' + description %( + + ) + versions :r4 + end + + run_bdt('0.3.18') + end + end + end +end diff --git a/lib/app/modules/bdt/bdt_base.rb b/lib/app/modules/bdt/bdt_base.rb new file mode 100644 index 000000000..d2e1895f3 --- /dev/null +++ b/lib/app/modules/bdt/bdt_base.rb @@ -0,0 +1,118 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class BDTBase < SequenceBase + BDT_URL = 'http://localhost:4500/api/tests' + + BDT_CONFIG = { + 'path' => '5.0', + 'format' => 'json', + 'settings' => { + 'baseURL' => 'https://bulk-data.smarthealthit.org/eyJlcnIiOiIiLCJwYWdlIjoxMDAsImR1ciI6MTAsInRsdCI6MTUsIm0iOjF9/fhir', + 'tokenEndpoint' => 'https://bulk-data.smarthealthit.org/auth/token', + 'clientId' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJlZ2lzdHJhdGlvbi10b2tlbiJ9.eyJqd2tzIjp7ImtleXMiOlt7Imt0eSI6IkVDIiwiY3J2IjoiUC0zODQiLCJ4IjoiTTFyM0dVZDBZRHBXbHF0ZjRHYXJPcmN3SWoyRnhDQlFmQnN4QmlLUzdmTTl1Z1pVUlBialp6YjZ5bDZOSlFETCIsInkiOiJmUWVvRm9wTTc0VjlXSWRYR0NHX3NtVm56c2N4eGlXM0hNQnNjd2tiUlVRSWxqMmFrTTM2WVB4ZDF2Z2M5WWVJIiwia2V5X29wcyI6WyJ2ZXJpZnkiXSwiZXh0Ijp0cnVlLCJraWQiOiJmMjkzOTdlZjQ0NmQ1YzE0ODBhZGViYmNiNTk5MTBiMyIsImFsZyI6IkVTMzg0In0seyJrdHkiOiJFQyIsImNydiI6IlAtMzg0IiwiZCI6IkxfOGh3VXlsbndoYWpNUGRqdkV0MTUtd0ZLbldDVEJ2WG1kSm5waTkySHN4TFVYWEwzS1ZidDlVYndFRjN2S0giLCJ4IjoiTTFyM0dVZDBZRHBXbHF0ZjRHYXJPcmN3SWoyRnhDQlFmQnN4QmlLUzdmTTl1Z1pVUlBialp6YjZ5bDZOSlFETCIsInkiOiJmUWVvRm9wTTc0VjlXSWRYR0NHX3NtVm56c2N4eGlXM0hNQnNjd2tiUlVRSWxqMmFrTTM2WVB4ZDF2Z2M5WWVJIiwia2V5X29wcyI6WyJzaWduIl0sImV4dCI6dHJ1ZSwia2lkIjoiZjI5Mzk3ZWY0NDZkNWMxNDgwYWRlYmJjYjU5OTEwYjMiLCJhbGciOiJFUzM4NCJ9XX0sImFjY2Vzc1Rva2Vuc0V4cGlyZUluIjoxNSwiaWF0IjoxNTU3NTAwNDIwfQ.2NJEarwScjRZZaDlpL1ixLxhWdfWFo_EFcaKJfL1oHE', + 'systemExportEndpoint' => '/$export', + 'patientExportEndpoint' => '/Patient/$export', + 'groupExportEndpoint' => '/Group/6/$export', + 'fastestResource' => 'ImagingStudy', + 'requiresAuth' => false, + 'sinceParam' => '_since', + 'jwksUrlAuth' => true, + 'jwksAuth' => true, + 'publicKey' => { + 'kty' => 'EC', + 'crv' => 'P-384', + 'x' => 'M1r3GUd0YDpWlqtf4GarOrcwIj2FxCBQfBsxBiKS7fM9ugZURPbjZzb6yl6NJQDL', + 'y' => 'fQeoFopM74V9WIdXGCG_smVnzscxxiW3HMBscwkbRUQIlj2akM36YPxd1vgc9YeI', + 'key_ops' => [ + 'verify' + ], + 'ext' => true, + 'kid' => 'f29397ef446d5c1480adebbcb59910b3', + 'alg' => 'ES384' + }, + 'privateKey' => { + 'kty' => 'EC', + 'crv' => 'P-384', + 'd' => 'L_8hwUylnwhajMPdjvEt15-wFKnWCTBvXmdJnpi92HsxLUXXL3KVbt9UbwEF3vKH', + 'x' => 'M1r3GUd0YDpWlqtf4GarOrcwIj2FxCBQfBsxBiKS7fM9ugZURPbjZzb6yl6NJQDL', + 'y' => 'fQeoFopM74V9WIdXGCG_smVnzscxxiW3HMBscwkbRUQIlj2akM36YPxd1vgc9YeI', + 'key_ops' => [ + 'sign' + ], + 'ext' => true, + 'kid' => 'f29397ef446d5c1480adebbcb59910b3', + 'alg' => 'ES384' + } + } + }.freeze + + def run_bdt(path) + payload = { + 'path' => path, + 'settings' => BDT_CONFIG + } + response = RestClient.post(BDT_URL, payload.to_json, content_type: :json, accept: :json) + response.body.split('\n').each do |chunk| + message = JSON.parse(chunk.strip) + + data = message['data'] + next if data.nil? + + warning do + data['warnings'].each do |warning| + assert false, warning + end + end + # request = { + # method: :post, + # url: url, + # headers: headers, + # payload: payload + # } + # response = { + # code: response.code, + # headers: response.headers, + # body: response.body + # } + # LoggedRestClient.record_response() + + requests = {} + + data['decorations'].each do |key, value| + if value['__type'] == 'request' + last_request = { + method: value['method'], + url: value['url'], + headers: value['headers'], + payload: value['body'] + } + # binding.pry if value['method'] == 'POST' + requests['request_' + key.chomp('Request').strip] = last_request + end + + next unless value['__type'] == 'response' + + request_key = 'request_' + key.gsub(/[ ]*Response[ \d]*/, '') + next unless requests.key? request_key + + referenced_request = requests[request_key] + response = { + code: value['statusCode'], + headers: value['headers'], + body: value['body']&.to_json + } + LoggedRestClient.record_response(referenced_request, response) + end + + omit 'Not supported' if data['status'] == 'not-supported' + + assert message['status'] != 'error', data['error'] + end + rescue RestClient::Exception => e + assert false, "Error connecting to BDT Service: #{e.message}" + end + end + end +end diff --git a/lib/app/modules/bdt/download_sequence.rb b/lib/app/modules/bdt/download_sequence.rb new file mode 100644 index 000000000..308cf899e --- /dev/null +++ b/lib/app/modules/bdt/download_sequence.rb @@ -0,0 +1,73 @@ +# frozen_string_literal: true + +require_relative 'bdt_base' + +module Inferno + module Sequence + class BDTDownloadSequence < BDTBase + group 'FIXME' + + title 'Download' + + description 'Download Endpoint' + + test_id_prefix 'Download' + + requires :token + conformance_supports :CarePlan + + details %( + Download + ) + + test 'Requires valid access token if the requiresAccessToken field in the status body is true' do + metadata do + id '01' + link 'http://bulkdatainfo' + description %( + If the requiresAccessToken field in the Complete Status body is set to true, the request MUST include a valid access token. + ) + versions :r4 + end + + run_bdt('1.0') + end + test 'Does not require access token if the requiresAccessToken field in the status body is not true' do + metadata do + id '02' + link 'http://bulkdatainfo' + description %( + Verifies that files can be downloaded without authorization if the requiresAccessToken field in the complete status body is not set to true + ) + versions :r4 + end + + run_bdt('1.1') + end + test 'Replies properly in case of error' do + metadata do + id '03' + link 'http://bulkdatainfo' + description %( + The server should return HTTP Status Code of 4XX or 5XX + ) + versions :r4 + end + + run_bdt('1.2') + end + test 'Generates valid file response' do + metadata do + id '04' + link 'http://bulkdatainfo' + description %( + Runs a set of assertions to verify that:
    • The server returns HTTP status of 200 OK
    • The server returns a Content-Type header that matches the file format being delivered. For files in ndjson format, MUST be application/fhir+ndjson
    • The response body is valid FHIR ndjson (unless other format is requested)
    • An Accept header might be sent (optional, defaults to application/fhir+ndjson)
    + ) + versions :r4 + end + + run_bdt('1.3') + end + end + end +end diff --git a/lib/app/modules/bdt/group_sequence.rb b/lib/app/modules/bdt/group_sequence.rb new file mode 100644 index 000000000..d619b9283 --- /dev/null +++ b/lib/app/modules/bdt/group_sequence.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +require_relative 'bdt_base' + +module Inferno + module Sequence + class BDTGroupSequence < BDTBase + group 'FIXME' + + title 'Group' + + description 'Group-level export' + + test_id_prefix 'Group' + + requires :token + conformance_supports :CarePlan + + details %( + Group + ) + + test 'Requires Accept header' do + metadata do + id '01' + link 'http://bulkdatainfo' + description %( + The Accept header specifies the format of the optional OperationOutcome response to the kick-off request. Currently, only application/fhir+json is supported. + ) + versions :r4 + end + + run_bdt('4.0') + end + test 'Requires Prefer header to equal respond-async' do + metadata do + id '02' + link 'http://bulkdatainfo' + description %( + The Prefer request header is required and specifies whether the response is immediate or asynchronous. The header MUST be set to respond-async. Red More + ) + versions :r4 + end + + run_bdt('4.1') + end + test 'Accepts _outputFormat=application/fhir+ndjson' do + metadata do + id '03.0' + link 'http://bulkdatainfo' + description %( + Verifies that the server accepts application/fhir+ndjson as _outputFormat parameter + ) + versions :r4 + end + + run_bdt('4.2') + end + test 'Accepts _outputFormat=application/ndjson' do + metadata do + id '03.1' + link 'http://bulkdatainfo' + description %( + Verifies that the server accepts application/ndjson as _outputFormat parameter + ) + versions :r4 + end + + run_bdt('4.3') + end + test 'Accepts _outputFormat=ndjson' do + metadata do + id '03.2' + link 'http://bulkdatainfo' + description %( + Verifies that the server accepts ndjson as _outputFormat parameter + ) + versions :r4 + end + + run_bdt('4.4') + end + test 'Rejects unsupported format "_outputFormat=application/xml"' do + metadata do + id '04.0' + link 'http://bulkdatainfo' + description %( + This tests if the server rejects _outputFormat=application/xml parameter, even though application/xml is valid mime type. + ) + versions :r4 + end + + run_bdt('4.5') + end + test 'Rejects unsupported format "_outputFormat=text/html"' do + metadata do + id '04.1' + link 'http://bulkdatainfo' + description %( + This tests if the server rejects _outputFormat=text/html parameter, even though text/html is valid mime type. + ) + versions :r4 + end + + run_bdt('4.6') + end + test 'Rejects unsupported format "_outputFormat=x-custom"' do + metadata do + id '04.2' + link 'http://bulkdatainfo' + description %( + This tests if the server rejects _outputFormat=x-custom parameter, even though x-custom is valid mime type. + ) + versions :r4 + end + + run_bdt('4.7') + end + test 'Rejects _since={invalid date} parameter' do + metadata do + id '05' + link 'http://bulkdatainfo' + description %( + The server should reject exports if the _since parameter is not a valid date + ) + versions :r4 + end + + run_bdt('4.8') + end + test 'Rejects _since={future date} parameter' do + metadata do + id '06' + link 'http://bulkdatainfo' + description %( + The server should reject exports if the _since parameter is a date in the future + ) + versions :r4 + end + + run_bdt('4.9') + end + test 'Validates the _type parameter' do + metadata do + id '07' + link 'http://bulkdatainfo' + description %( + Verifies that the request is rejected if the _type contains invalid resource type + ) + versions :r4 + end + + run_bdt('4.10') + end + test 'Accepts the _typeFilter parameter' do + metadata do + id '08' + link 'http://bulkdatainfo' + description %( + The _typeFilter parameter is optional so the servers should not reject it, even if they don't support it + ) + versions :r4 + end + + run_bdt('4.11') + end + test 'Response - Success' do + metadata do + id '09' + link 'http://bulkdatainfo' + description %( + Verifies that the server starts an export if called with valid parameters. The status code must be 202 Accepted and a Content-Location header must be returned. The response body should be either empty, or a JSON OperationOutcome. + ) + versions :r4 + end + + run_bdt('4.12') + end + end + end +end diff --git a/lib/app/modules/bdt/patient_sequence.rb b/lib/app/modules/bdt/patient_sequence.rb new file mode 100644 index 000000000..a856fd8c0 --- /dev/null +++ b/lib/app/modules/bdt/patient_sequence.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +require_relative 'bdt_base' + +module Inferno + module Sequence + class BDTPatientSequence < BDTBase + group 'FIXME' + + title 'Patient' + + description 'Patient-level export' + + test_id_prefix 'Patient' + + requires :token + conformance_supports :CarePlan + + details %( + Patient + ) + + test 'Requires Accept header' do + metadata do + id '01' + link 'http://bulkdatainfo' + description %( + The Accept header specifies the format of the optional OperationOutcome response to the kick-off request. Currently, only application/fhir+json is supported. + ) + versions :r4 + end + + run_bdt('2.0') + end + test 'Requires Prefer header to equal respond-async' do + metadata do + id '02' + link 'http://bulkdatainfo' + description %( + The Prefer request header is required and specifies whether the response is immediate or asynchronous. The header MUST be set to respond-async. Red More + ) + versions :r4 + end + + run_bdt('2.1') + end + test 'Accepts _outputFormat=application/fhir+ndjson' do + metadata do + id '03.0' + link 'http://bulkdatainfo' + description %( + Verifies that the server accepts application/fhir+ndjson as _outputFormat parameter + ) + versions :r4 + end + + run_bdt('2.2') + end + test 'Accepts _outputFormat=application/ndjson' do + metadata do + id '03.1' + link 'http://bulkdatainfo' + description %( + Verifies that the server accepts application/ndjson as _outputFormat parameter + ) + versions :r4 + end + + run_bdt('2.3') + end + test 'Accepts _outputFormat=ndjson' do + metadata do + id '03.2' + link 'http://bulkdatainfo' + description %( + Verifies that the server accepts ndjson as _outputFormat parameter + ) + versions :r4 + end + + run_bdt('2.4') + end + test 'Rejects unsupported format "_outputFormat=application/xml"' do + metadata do + id '04.0' + link 'http://bulkdatainfo' + description %( + This tests if the server rejects _outputFormat=application/xml parameter, even though application/xml is valid mime type. + ) + versions :r4 + end + + run_bdt('2.5') + end + test 'Rejects unsupported format "_outputFormat=text/html"' do + metadata do + id '04.1' + link 'http://bulkdatainfo' + description %( + This tests if the server rejects _outputFormat=text/html parameter, even though text/html is valid mime type. + ) + versions :r4 + end + + run_bdt('2.6') + end + test 'Rejects unsupported format "_outputFormat=x-custom"' do + metadata do + id '04.2' + link 'http://bulkdatainfo' + description %( + This tests if the server rejects _outputFormat=x-custom parameter, even though x-custom is valid mime type. + ) + versions :r4 + end + + run_bdt('2.7') + end + test 'Rejects _since={invalid date} parameter' do + metadata do + id '05' + link 'http://bulkdatainfo' + description %( + The server should reject exports if the _since parameter is not a valid date + ) + versions :r4 + end + + run_bdt('2.8') + end + test 'Rejects _since={future date} parameter' do + metadata do + id '06' + link 'http://bulkdatainfo' + description %( + The server should reject exports if the _since parameter is a date in the future + ) + versions :r4 + end + + run_bdt('2.9') + end + test 'Validates the _type parameter' do + metadata do + id '07' + link 'http://bulkdatainfo' + description %( + Verifies that the request is rejected if the _type contains invalid resource type + ) + versions :r4 + end + + run_bdt('2.10') + end + test 'Accepts the _typeFilter parameter' do + metadata do + id '08' + link 'http://bulkdatainfo' + description %( + The _typeFilter parameter is optional so the servers should not reject it, even if they don't support it + ) + versions :r4 + end + + run_bdt('2.11') + end + test 'Response - Success' do + metadata do + id '09' + link 'http://bulkdatainfo' + description %( + Verifies that the server starts an export if called with valid parameters. The status code must be 202 Accepted and a Content-Location header must be returned. The response body should be either empty, or a JSON OperationOutcome. + ) + versions :r4 + end + + run_bdt('2.12') + end + end + end +end diff --git a/lib/app/modules/bdt/status_sequence.rb b/lib/app/modules/bdt/status_sequence.rb new file mode 100644 index 000000000..f1991f50f --- /dev/null +++ b/lib/app/modules/bdt/status_sequence.rb @@ -0,0 +1,61 @@ +# frozen_string_literal: true + +require_relative 'bdt_base' + +module Inferno + module Sequence + class BDTStatusSequence < BDTBase + group 'FIXME' + + title 'Status' + + description 'Status Endpoint' + + test_id_prefix 'Status' + + requires :token + conformance_supports :CarePlan + + details %( + Status + ) + + test 'Responds with 202 for active transaction IDs' do + metadata do + id '01' + link 'http://bulkdatainfo' + description %( +

    The status endpoint should return 202 status code until the export is completed.

    See https://github.com/smart-on-fhir/fhir-bulk-data-docs/blob/master/export.md#response---in-progress-status + ) + versions :r4 + end + + run_bdt('5.0') + end + test 'Replies properly in case of error' do + metadata do + id '02' + link 'http://bulkdatainfo' + description %( + Runs a set of assertions to verify that:
    • The returned HTTP status code is 5XX
    • The server returns a FHIR OperationOutcome resource in JSON format

    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.

    See https://github.com/smart-on-fhir/fhir-bulk-data-docs/blob/master/export.md#response---error-status-1 + ) + versions :r4 + end + + run_bdt('5.1') + end + test 'Generates valid status response' do + metadata do + id '03' + link 'http://bulkdatainfo' + description %( + Runs a set of assertions to verify that:
    • The status endpoint should return 200 status code when the export is completed
    • The status endpoint should respond with JSON
    • The expires header (if set) must be valid date in the future
    • The JSON response contains transactionTime which is a valid FHIR instant
    • The JSON response contains the kick-off URL in request property
    • The JSON response contains requiresAccessToken boolean property
    • The JSON response contains an output array in which:
      • Every item has valid type property
      • Every item has valid url property
      • Every item may a count number property
    • The JSON response contains an error array in which:
      • Every item has valid type property
      • Every item has valid url property
      • Every item may a count number property
    + ) + versions :r4 + end + + run_bdt('5.2') + end + end + end +end diff --git a/lib/app/modules/bdt/system_sequence.rb b/lib/app/modules/bdt/system_sequence.rb new file mode 100644 index 000000000..323449d53 --- /dev/null +++ b/lib/app/modules/bdt/system_sequence.rb @@ -0,0 +1,181 @@ +# frozen_string_literal: true + +require_relative 'bdt_base' + +module Inferno + module Sequence + class BDTSystemSequence < BDTBase + group 'FIXME' + + title 'System' + + description 'System-level export' + + test_id_prefix 'System' + + requires :token + conformance_supports :CarePlan + + details %( + System + ) + + test 'Requires Accept header' do + metadata do + id '01' + link 'http://bulkdatainfo' + description %( + The Accept header specifies the format of the optional OperationOutcome response to the kick-off request. Currently, only application/fhir+json is supported. + ) + versions :r4 + end + + run_bdt('3.0') + end + test 'Requires Prefer header to equal respond-async' do + metadata do + id '02' + link 'http://bulkdatainfo' + description %( + The Prefer request header is required and specifies whether the response is immediate or asynchronous. The header MUST be set to respond-async. Red More + ) + versions :r4 + end + + run_bdt('3.1') + end + test 'Accepts _outputFormat=application/fhir+ndjson' do + metadata do + id '03.0' + link 'http://bulkdatainfo' + description %( + Verifies that the server accepts application/fhir+ndjson as _outputFormat parameter + ) + versions :r4 + end + + run_bdt('3.2') + end + test 'Accepts _outputFormat=application/ndjson' do + metadata do + id '03.1' + link 'http://bulkdatainfo' + description %( + Verifies that the server accepts application/ndjson as _outputFormat parameter + ) + versions :r4 + end + + run_bdt('3.3') + end + test 'Accepts _outputFormat=ndjson' do + metadata do + id '03.2' + link 'http://bulkdatainfo' + description %( + Verifies that the server accepts ndjson as _outputFormat parameter + ) + versions :r4 + end + + run_bdt('3.4') + end + test 'Rejects unsupported format "_outputFormat=application/xml"' do + metadata do + id '04.0' + link 'http://bulkdatainfo' + description %( + This tests if the server rejects _outputFormat=application/xml parameter, even though application/xml is valid mime type. + ) + versions :r4 + end + + run_bdt('3.5') + end + test 'Rejects unsupported format "_outputFormat=text/html"' do + metadata do + id '04.1' + link 'http://bulkdatainfo' + description %( + This tests if the server rejects _outputFormat=text/html parameter, even though text/html is valid mime type. + ) + versions :r4 + end + + run_bdt('3.6') + end + test 'Rejects unsupported format "_outputFormat=x-custom"' do + metadata do + id '04.2' + link 'http://bulkdatainfo' + description %( + This tests if the server rejects _outputFormat=x-custom parameter, even though x-custom is valid mime type. + ) + versions :r4 + end + + run_bdt('3.7') + end + test 'Rejects _since={invalid date} parameter' do + metadata do + id '05' + link 'http://bulkdatainfo' + description %( + The server should reject exports if the _since parameter is not a valid date + ) + versions :r4 + end + + run_bdt('3.8') + end + test 'Rejects _since={future date} parameter' do + metadata do + id '06' + link 'http://bulkdatainfo' + description %( + The server should reject exports if the _since parameter is a date in the future + ) + versions :r4 + end + + run_bdt('3.9') + end + test 'Validates the _type parameter' do + metadata do + id '07' + link 'http://bulkdatainfo' + description %( + Verifies that the request is rejected if the _type contains invalid resource type + ) + versions :r4 + end + + run_bdt('3.10') + end + test 'Accepts the _typeFilter parameter' do + metadata do + id '08' + link 'http://bulkdatainfo' + description %( + The _typeFilter parameter is optional so the servers should not reject it, even if they don't support it + ) + versions :r4 + end + + run_bdt('3.11') + end + test 'Response - Success' do + metadata do + id '09' + link 'http://bulkdatainfo' + description %( + Verifies that the server starts an export if called with valid parameters. The status code must be 202 Accepted and a Content-Location header must be returned. The response body should be either empty, or a JSON OperationOutcome. + ) + versions :r4 + end + + run_bdt('3.12') + end + end + end +end diff --git a/lib/app/modules/bdt_module.yml b/lib/app/modules/bdt_module.yml new file mode 100644 index 000000000..ea9838209 --- /dev/null +++ b/lib/app/modules/bdt_module.yml @@ -0,0 +1,24 @@ +name: bdt +title: Bulk Data Testing (under development) +description: BDT Integration +fhir_version: r4 +default_test_set: developer +test_sets: + developer: + view: default + tests: + - name: Authorization + run_all: true + sequences: + - BDTAuthSystemLevelSequence + - BDTAuthPatientLevelSequence + - BDTAuthGroupLevelSequence + - BDTAuthTokenEndpointSequence + - name: Bulk Transfer + run_all: true + sequences: + - BDTDownloadSequence + - BDTPatientSequence + - BDTSystemSequence + - BDTGroupSequence + - BDTStatusSequence \ No newline at end of file diff --git a/lib/app/utils/logged_rest_client.rb b/lib/app/utils/logged_rest_client.rb index ca159e62a..f1ad29306 100644 --- a/lib/app/utils/logged_rest_client.rb +++ b/lib/app/utils/logged_rest_client.rb @@ -13,15 +13,26 @@ def self.requests end def self.record_response(request, response) - reply = { - code: response.code, - headers: response.headers, - body: response.body - } + # You can call this directly with a hash + # If intercepted from RestClient it will use a class + reply = if response.class == Hash + { + code: response[:code], + headers: response[:headers], + body: response[:body] + } + else + { + code: response.code, + headers: response.headers, + body: response.body + } + end + request[:payload] = begin JSON.parse(request[:payload]) rescue StandardError - nil + request[:payload] end @@requests << { direction: :outbound, request: request, response: reply } end From cf6d0a8fdeaed7857e39cde3688610edd72a0dd4 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Tue, 5 Nov 2019 16:49:33 -0500 Subject: [PATCH 097/173] Update to use docker-hub version of inferno-bdt-service. --- docker-compose.yml | 15 ++++----------- generator/bdt/templates/bdt_base.rb | 4 ++-- lib/app/modules/bdt/bdt_base.rb | 14 +++++++++++--- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d4e4f0669..3c1eb2a49 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,15 +6,8 @@ services: volumes: - ./config.yml:/var/www/inferno/config.yml ports: - - "4567:8080" - nginx_server: - image: nginx - volumes: - - ./deployment-files/nginx.conf:/etc/nginx/nginx.conf:ro + - "4567:4567" + bdt-service: + image: arscan/inferno-bdt-service ports: - - "8080:80" - command: [nginx, '-g', 'daemon off;'] - links: - - ruby_server:ruby_server - depends_on: - - ruby_server + - "4500:4500" diff --git a/generator/bdt/templates/bdt_base.rb b/generator/bdt/templates/bdt_base.rb index 71e81a0cc..52581fcd4 100644 --- a/generator/bdt/templates/bdt_base.rb +++ b/generator/bdt/templates/bdt_base.rb @@ -3,7 +3,7 @@ module Inferno module Sequence class BDTBase < SequenceBase - BDT_URL = 'http://localhost:4500/api/tests' + BDT_URL = 'http://bdt-service:4500/api/tests' BDT_CONFIG = { 'path' => '5.0', @@ -62,7 +62,7 @@ def run_bdt(path) 'settings' => BDT_CONFIG } response = RestClient.post(BDT_URL, payload.to_json, content_type: :json, accept: :json) - response.body.split('\n').each do |chunk| + response.body.split("\n").each do |chunk| message = JSON.parse(chunk.strip) data = message['data'] diff --git a/lib/app/modules/bdt/bdt_base.rb b/lib/app/modules/bdt/bdt_base.rb index d2e1895f3..52581fcd4 100644 --- a/lib/app/modules/bdt/bdt_base.rb +++ b/lib/app/modules/bdt/bdt_base.rb @@ -3,7 +3,7 @@ module Inferno module Sequence class BDTBase < SequenceBase - BDT_URL = 'http://localhost:4500/api/tests' + BDT_URL = 'http://bdt-service:4500/api/tests' BDT_CONFIG = { 'path' => '5.0', @@ -11,7 +11,15 @@ class BDTBase < SequenceBase 'settings' => { 'baseURL' => 'https://bulk-data.smarthealthit.org/eyJlcnIiOiIiLCJwYWdlIjoxMDAsImR1ciI6MTAsInRsdCI6MTUsIm0iOjF9/fhir', 'tokenEndpoint' => 'https://bulk-data.smarthealthit.org/auth/token', - 'clientId' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJlZ2lzdHJhdGlvbi10b2tlbiJ9.eyJqd2tzIjp7ImtleXMiOlt7Imt0eSI6IkVDIiwiY3J2IjoiUC0zODQiLCJ4IjoiTTFyM0dVZDBZRHBXbHF0ZjRHYXJPcmN3SWoyRnhDQlFmQnN4QmlLUzdmTTl1Z1pVUlBialp6YjZ5bDZOSlFETCIsInkiOiJmUWVvRm9wTTc0VjlXSWRYR0NHX3NtVm56c2N4eGlXM0hNQnNjd2tiUlVRSWxqMmFrTTM2WVB4ZDF2Z2M5WWVJIiwia2V5X29wcyI6WyJ2ZXJpZnkiXSwiZXh0Ijp0cnVlLCJraWQiOiJmMjkzOTdlZjQ0NmQ1YzE0ODBhZGViYmNiNTk5MTBiMyIsImFsZyI6IkVTMzg0In0seyJrdHkiOiJFQyIsImNydiI6IlAtMzg0IiwiZCI6IkxfOGh3VXlsbndoYWpNUGRqdkV0MTUtd0ZLbldDVEJ2WG1kSm5waTkySHN4TFVYWEwzS1ZidDlVYndFRjN2S0giLCJ4IjoiTTFyM0dVZDBZRHBXbHF0ZjRHYXJPcmN3SWoyRnhDQlFmQnN4QmlLUzdmTTl1Z1pVUlBialp6YjZ5bDZOSlFETCIsInkiOiJmUWVvRm9wTTc0VjlXSWRYR0NHX3NtVm56c2N4eGlXM0hNQnNjd2tiUlVRSWxqMmFrTTM2WVB4ZDF2Z2M5WWVJIiwia2V5X29wcyI6WyJzaWduIl0sImV4dCI6dHJ1ZSwia2lkIjoiZjI5Mzk3ZWY0NDZkNWMxNDgwYWRlYmJjYjU5OTEwYjMiLCJhbGciOiJFUzM4NCJ9XX0sImFjY2Vzc1Rva2Vuc0V4cGlyZUluIjoxNSwiaWF0IjoxNTU3NTAwNDIwfQ.2NJEarwScjRZZaDlpL1ixLxhWdfWFo_EFcaKJfL1oHE', + 'clientId' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJlZ2lzdHJhdGlvbi10b2tlbiJ9.eyJqd2tzIjp7ImtleXMiOlt7Imt0eSI6IkVDIiwiY3J2I' \ + 'joiUC0zODQiLCJ4IjoiTTFyM0dVZDBZRHBXbHF0ZjRHYXJPcmN3SWoyRnhDQlFmQnN4QmlLUzdmTTl1Z1pVUlBialp6YjZ5bDZOSlFETCIsInkiOiJmUWV' \ + 'vRm9wTTc0VjlXSWRYR0NHX3NtVm56c2N4eGlXM0hNQnNjd2tiUlVRSWxqMmFrTTM2WVB4ZDF2Z2M5WWVJIiwia2V5X29wcyI6WyJ2ZXJpZnkiXSwiZXh0I' \ + 'jp0cnVlLCJraWQiOiJmMjkzOTdlZjQ0NmQ1YzE0ODBhZGViYmNiNTk5MTBiMyIsImFsZyI6IkVTMzg0In0seyJrdHkiOiJFQyIsImNydiI6IlAtMzg0Iiw' \ + 'iZCI6IkxfOGh3VXlsbndoYWpNUGRqdkV0MTUtd0ZLbldDVEJ2WG1kSm5waTkySHN4TFVYWEwzS1ZidDlVYndFRjN2S0giLCJ4IjoiTTFyM0dVZDBZRHBXb' \ + 'HF0ZjRHYXJPcmN3SWoyRnhDQlFmQnN4QmlLUzdmTTl1Z1pVUlBialp6YjZ5bDZOSlFETCIsInkiOiJmUWVvRm9wTTc0VjlXSWRYR0NHX3NtVm56c2N4eGl' \ + 'XM0hNQnNjd2tiUlVRSWxqMmFrTTM2WVB4ZDF2Z2M5WWVJIiwia2V5X29wcyI6WyJzaWduIl0sImV4dCI6dHJ1ZSwia2lkIjoiZjI5Mzk3ZWY0NDZkNWMxN' \ + 'DgwYWRlYmJjYjU5OTEwYjMiLCJhbGciOiJFUzM4NCJ9XX0sImFjY2Vzc1Rva2Vuc0V4cGlyZUluIjoxNSwiaWF0IjoxNTU3NTAwNDIwfQ.2NJEarwScjRZ' \ + 'ZaDlpL1ixLxhWdfWFo_EFcaKJfL1oHE', 'systemExportEndpoint' => '/$export', 'patientExportEndpoint' => '/Patient/$export', 'groupExportEndpoint' => '/Group/6/$export', @@ -54,7 +62,7 @@ def run_bdt(path) 'settings' => BDT_CONFIG } response = RestClient.post(BDT_URL, payload.to_json, content_type: :json, accept: :json) - response.body.split('\n').each do |chunk| + response.body.split("\n").each do |chunk| message = JSON.parse(chunk.strip) data = message['data'] From abbe7b1813a3a104c541c960409f4c39c1c40ccb Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Wed, 13 Nov 2019 11:07:53 -0500 Subject: [PATCH 098/173] WIP update to new bdt and pass parameters. --- generator/bdt/bdt-structure.json | 57 ++++++--- generator/bdt/templates/bdt_base.rb | 25 +++- generator/bdt/templates/sequence.rb.erb | 9 +- lib/app/models/testing_instance.rb | 16 +++ .../modules/bdt/auth_group_level_sequence.rb | 20 ++-- .../bdt/auth_patient_level_sequence.rb | 20 ++-- .../modules/bdt/auth_system_level_sequence.rb | 20 ++-- .../bdt/auth_token_endpoint_sequence.rb | 30 +++-- lib/app/modules/bdt/bdt_base.rb | 23 +++- lib/app/modules/bdt/download_sequence.rb | 20 +++- lib/app/modules/bdt/group_sequence.rb | 8 +- lib/app/modules/bdt/patient_sequence.rb | 8 +- lib/app/modules/bdt/status_sequence.rb | 12 +- lib/app/modules/bdt/system_sequence.rb | 8 +- lib/app/views/default.erb | 113 +++++++++++++++++- lib/app/views/prerequisite_field.erb | 3 + lib/modules/bulk_data_module.yml | 2 +- public/css/styles.css | 6 +- public/js/app.js | 4 +- 19 files changed, 312 insertions(+), 92 deletions(-) diff --git a/generator/bdt/bdt-structure.json b/generator/bdt/bdt-structure.json index 588be5957..27ad07727 100644 --- a/generator/bdt/bdt-structure.json +++ b/generator/bdt/bdt-structure.json @@ -13,20 +13,22 @@ "children": [ { "id": "Auth-01.0.0", - "name": "system-level export - requires authorization header", - "description": "The server should require authorization header", + "name": "Requires authorization header", + "description": "The server should require authorization header at the system-level export endpoint", "type": "test", "path": "0.0.0" }, { "id": "Auth-01.0.1", - "name": "system-level export - rejects expired token", + "name": "Rejects expired token", + "description": "The server should reject expired tokens at the system-level export endpoint", "type": "test", "path": "0.0.1" }, { "id": "Auth-01.0.2", - "name": "system-level export - rejects invalid token", + "name": "Rejects invalid token", + "description": "The server should reject invalid tokens at the system-level export endpoint", "type": "test", "path": "0.0.2" } @@ -39,20 +41,22 @@ "children": [ { "id": "Auth-01.1.0", - "name": "patient-level export - requires authorization header", - "description": "The server should require authorization header", + "name": "Requires authorization header", + "description": "The server should require authorization header at the patient-level export endpoint", "type": "test", "path": "0.1.0" }, { "id": "Auth-01.1.1", - "name": "patient-level export - rejects expired token", + "name": "Rejects expired token", + "description": "The server should reject expired tokens at the patient-level export endpoint", "type": "test", "path": "0.1.1" }, { "id": "Auth-01.1.2", - "name": "patient-level export - rejects invalid token", + "name": "Rejects invalid token", + "description": "The server should reject invalid tokens at the patient-level export endpoint", "type": "test", "path": "0.1.2" } @@ -65,20 +69,22 @@ "children": [ { "id": "Auth-01.2.0", - "name": "group-level export - requires authorization header", - "description": "The server should require authorization header", + "name": "Requires authorization header", + "description": "The server should require authorization header at the group-level export endpoint", "type": "test", "path": "0.2.0" }, { "id": "Auth-01.2.1", - "name": "group-level export - rejects expired token", + "name": "Rejects expired token", + "description": "The server should reject expired tokens at the group-level export endpoint", "type": "test", "path": "0.2.1" }, { "id": "Auth-01.2.2", - "name": "group-level export - rejects invalid token", + "name": "Rejects invalid token", + "description": "The server should reject invalid tokens at the group-level export endpoint", "type": "test", "path": "0.2.2" } @@ -155,14 +161,14 @@ { "id": "Auth-11", "name": "Requires scope", - "description": "", + "description": "The server should reject requests to the token endpoint that do not specify a scope", "type": "test", "path": "0.3.9" }, { "id": "Auth-12", "name": "Rejects empty scope", - "description": "", + "description": "The server should reject requests to the token endpoint that are requesting an empty scope", "type": "test", "path": "0.3.10" }, @@ -204,7 +210,7 @@ { "id": "Auth-18", "name": "validates the jku token header", - "description": "", + "description": "When present, the jky authentication JWT header should match a value that the client supplied to the FHIR server at client registration time. This test attempts to authorize using test-bad-jku as jky header value and expects that to produce an error.", "type": "test", "path": "0.3.16" }, @@ -217,9 +223,17 @@ }, { "id": "Auth-20", - "name": "Authorization using JWKS URL", + "name": "Authorization using JWKS URL and ES384 keys", + "description": "Verify that the server supports JWKS URL authorization using ES384 keys. This would also prove that JWK keys rotation works because this test will create new key, every time it is executed.", "type": "test", "path": "0.3.18" + }, + { + "id": "Auth-21", + "name": "Authorization using JWKS URL and RS384 keys", + "description": "Verify that the server supports JWKS URL authorization using RS384 keys. This would also prove that JWK keys rotation works because this test will create new key, every time it is executed.", + "type": "test", + "path": "0.3.19" } ], "path": "0.3" @@ -258,6 +272,13 @@ "description": "Runs a set of assertions to verify that:
    • The server returns HTTP status of 200 OK
    • The server returns a Content-Type header that matches the file format being delivered. For files in ndjson format, MUST be application/fhir+ndjson
    • The response body is valid FHIR ndjson (unless other format is requested)
    • An Accept header might be sent (optional, defaults to application/fhir+ndjson)
    ", "type": "test", "path": "1.3" + }, + { + "id": "Download-05", + "name": "Rejects a download if the client scopes do not cover that resource type", + "description": "If the download endpoint requires authorization, it should also verify that the client has been granted access to the resource type that it attempts to download. This test makes an export and then it re-authorizes before downloading the first file, so that the download request is made with a token that does not provide access to the downloaded resource.", + "type": "test", + "path": "1.4" } ], "path": "1" @@ -563,14 +584,14 @@ { "id": "Status-01", "name": "Responds with 202 for active transaction IDs", - "description": "

    The status endpoint should return 202 status code until the export is completed.

    See https://github.com/smart-on-fhir/fhir-bulk-data-docs/blob/master/export.md#response---in-progress-status", + "description": "

    The status endpoint should return 202 status code until the export is completed.

    See https://github.com/HL7/bulk-data/blob/master/spec/export/index.md#response---in-progress-status", "type": "test", "path": "5.0" }, { "id": "Status-02", "name": "Replies properly in case of error", - "description": "Runs a set of assertions to verify that:
    • The returned HTTP status code is 5XX
    • The server returns a FHIR OperationOutcome resource in JSON format

    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.

    See https://github.com/smart-on-fhir/fhir-bulk-data-docs/blob/master/export.md#response---error-status-1", + "description": "Runs a set of assertions to verify that:
    • The returned HTTP status code is 5XX
    • The server returns a FHIR OperationOutcome resource in JSON format

    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.

    See https://github.com/HL7/bulk-data/blob/master/spec/export/index.md#response---error-status-1", "type": "test", "path": "5.1" }, diff --git a/generator/bdt/templates/bdt_base.rb b/generator/bdt/templates/bdt_base.rb index 52581fcd4..60b577a43 100644 --- a/generator/bdt/templates/bdt_base.rb +++ b/generator/bdt/templates/bdt_base.rb @@ -3,7 +3,7 @@ module Inferno module Sequence class BDTBase < SequenceBase - BDT_URL = 'http://bdt-service:4500/api/tests' + BDT_URL = 'http://localhost:4500/api/tests' BDT_CONFIG = { 'path' => '5.0', @@ -56,10 +56,30 @@ class BDTBase < SequenceBase } }.freeze + def settings + { + 'baseUrl' => @instance.bulk_url, + 'tokenEndpoint' => @instance.bulk_token_endpoint, + 'clientId' => @instance.bulk_client_id, + 'systemExportEndpoint' => @instance.bulk_system_export_endpoint, + 'patientExportEndpoint' => @instance.bulk_patient_export_endpoint, + 'groupExportEndpoint' => @instance.bulk_group_export_endpoint, + 'fastestResource' => @instance.bulk_fastest_resource, + 'requiresAuth' => !@instance.bulk_requires_auth.nil?, + 'sinceParam' => '_since', + 'jwksUrlAuth' => true, + 'jwksAuth' => true, + 'strictSSL' => false, + 'publicKey' => @instance.bulk_public_key, + 'privateKey' => @instance.bulk_private_key + } + end + def run_bdt(path) + payload = { 'path' => path, - 'settings' => BDT_CONFIG + 'settings' => settings } response = RestClient.post(BDT_URL, payload.to_json, content_type: :json, accept: :json) response.body.split("\n").each do |chunk| @@ -115,6 +135,7 @@ def run_bdt(path) end omit 'Not supported' if data['status'] == 'not-supported' + binding.pry if data['status'] == 'not-supported' assert message['status'] != 'error', data['error'] end diff --git a/generator/bdt/templates/sequence.rb.erb b/generator/bdt/templates/sequence.rb.erb index 908e8a71d..0074486c5 100644 --- a/generator/bdt/templates/sequence.rb.erb +++ b/generator/bdt/templates/sequence.rb.erb @@ -6,16 +6,17 @@ module Inferno module Sequence class <%=sequence_class_name%> < BDTBase - group 'FIXME' - title '<%=name %>' description '<%=description %>' test_id_prefix '<%=id%>' - requires :token - conformance_supports :CarePlan + requires :bulk_url, :bulk_token_endpoint, :bulk_client_id, \ + :bulk_system_export_endpoint, :bulk_patient_export_endpoint, :bulk_group_export_endpoint, \ + :bulk_fastest_resource, :bulk_requires_auth, :bulk_since_param, :bulk_jwks_url_auth, :bulk_jwks_url_auth, \ + :bulk_public_key, :bulk_private_key + details %( <%= name %> diff --git a/lib/app/models/testing_instance.rb b/lib/app/models/testing_instance.rb index fea0634db..fd4bc82bc 100644 --- a/lib/app/models/testing_instance.rb +++ b/lib/app/models/testing_instance.rb @@ -57,6 +57,22 @@ class TestingInstance property :group_id, String + + # Bulk Data Parameters + property :bulk_url, String + property :bulk_token_endpoint, String + property :bulk_client_id, String + property :bulk_system_export_endpoint, String + property :bulk_patient_export_endpoint, String + property :bulk_group_export_endpoint, String + property :bulk_fastest_resource, String + property :bulk_requires_auth, String + property :bulk_since_param, String + property :bulk_jwks_url_auth, String + property :bulk_jwks_auth, String + property :bulk_public_key, String + property :bulk_private_key, String + has n, :sequence_results has n, :resource_references has 1, :server_capabilities diff --git a/lib/app/modules/bdt/auth_group_level_sequence.rb b/lib/app/modules/bdt/auth_group_level_sequence.rb index a1b4cc669..07e4ef42e 100644 --- a/lib/app/modules/bdt/auth_group_level_sequence.rb +++ b/lib/app/modules/bdt/auth_group_level_sequence.rb @@ -5,51 +5,51 @@ module Inferno module Sequence class BDTAuthGroupLevelSequence < BDTBase - group 'FIXME' - title 'Auth Group Level' description 'Kick-off request at the group-level export endpoint' test_id_prefix 'Auth_group_level' - requires :token - conformance_supports :CarePlan + requires :bulk_url, :bulk_token_endpoint, :bulk_client_id, \ + :bulk_system_export_endpoint, :bulk_patient_export_endpoint, :bulk_group_export_endpoint, \ + :bulk_fastest_resource, :bulk_requires_auth, :bulk_since_param, :bulk_jwks_url_auth, :bulk_jwks_url_auth, \ + :bulk_public_key, :bulk_private_key details %( Auth Group Level ) - test 'group-level export - requires authorization header' do + test 'Requires authorization header' do metadata do id '01.2.0' link 'http://bulkdatainfo' description %( - The server should require authorization header + The server should require authorization header at the group-level export endpoint ) versions :r4 end run_bdt('0.2.0') end - test 'group-level export - rejects expired token' do + test 'Rejects expired token' do metadata do id '01.2.1' link 'http://bulkdatainfo' description %( - + The server should reject expired tokens at the group-level export endpoint ) versions :r4 end run_bdt('0.2.1') end - test 'group-level export - rejects invalid token' do + test 'Rejects invalid token' do metadata do id '01.2.2' link 'http://bulkdatainfo' description %( - + The server should reject invalid tokens at the group-level export endpoint ) versions :r4 end diff --git a/lib/app/modules/bdt/auth_patient_level_sequence.rb b/lib/app/modules/bdt/auth_patient_level_sequence.rb index 64f6c132b..a54d503de 100644 --- a/lib/app/modules/bdt/auth_patient_level_sequence.rb +++ b/lib/app/modules/bdt/auth_patient_level_sequence.rb @@ -5,51 +5,51 @@ module Inferno module Sequence class BDTAuthPatientLevelSequence < BDTBase - group 'FIXME' - title 'Auth Patient Level' description 'Kick-off request at the patient-level export endpoint' test_id_prefix 'Auth_patient_level' - requires :token - conformance_supports :CarePlan + requires :bulk_url, :bulk_token_endpoint, :bulk_client_id, \ + :bulk_system_export_endpoint, :bulk_patient_export_endpoint, :bulk_group_export_endpoint, \ + :bulk_fastest_resource, :bulk_requires_auth, :bulk_since_param, :bulk_jwks_url_auth, :bulk_jwks_url_auth, \ + :bulk_public_key, :bulk_private_key details %( Auth Patient Level ) - test 'patient-level export - requires authorization header' do + test 'Requires authorization header' do metadata do id '01.1.0' link 'http://bulkdatainfo' description %( - The server should require authorization header + The server should require authorization header at the patient-level export endpoint ) versions :r4 end run_bdt('0.1.0') end - test 'patient-level export - rejects expired token' do + test 'Rejects expired token' do metadata do id '01.1.1' link 'http://bulkdatainfo' description %( - + The server should reject expired tokens at the patient-level export endpoint ) versions :r4 end run_bdt('0.1.1') end - test 'patient-level export - rejects invalid token' do + test 'Rejects invalid token' do metadata do id '01.1.2' link 'http://bulkdatainfo' description %( - + The server should reject invalid tokens at the patient-level export endpoint ) versions :r4 end diff --git a/lib/app/modules/bdt/auth_system_level_sequence.rb b/lib/app/modules/bdt/auth_system_level_sequence.rb index 8a7c42cec..048ac10d5 100644 --- a/lib/app/modules/bdt/auth_system_level_sequence.rb +++ b/lib/app/modules/bdt/auth_system_level_sequence.rb @@ -5,51 +5,51 @@ module Inferno module Sequence class BDTAuthSystemLevelSequence < BDTBase - group 'FIXME' - title 'Auth System Level' description 'Kick-off request at the system-level export endpoint' test_id_prefix 'Auth_system_level' - requires :token - conformance_supports :CarePlan + requires :bulk_url, :bulk_token_endpoint, :bulk_client_id, \ + :bulk_system_export_endpoint, :bulk_patient_export_endpoint, :bulk_group_export_endpoint, \ + :bulk_fastest_resource, :bulk_requires_auth, :bulk_since_param, :bulk_jwks_url_auth, :bulk_jwks_url_auth, \ + :bulk_public_key, :bulk_private_key details %( Auth System Level ) - test 'system-level export - requires authorization header' do + test 'Requires authorization header' do metadata do id '01.0.0' link 'http://bulkdatainfo' description %( - The server should require authorization header + The server should require authorization header at the system-level export endpoint ) versions :r4 end run_bdt('0.0.0') end - test 'system-level export - rejects expired token' do + test 'Rejects expired token' do metadata do id '01.0.1' link 'http://bulkdatainfo' description %( - + The server should reject expired tokens at the system-level export endpoint ) versions :r4 end run_bdt('0.0.1') end - test 'system-level export - rejects invalid token' do + test 'Rejects invalid token' do metadata do id '01.0.2' link 'http://bulkdatainfo' description %( - + The server should reject invalid tokens at the system-level export endpoint ) versions :r4 end diff --git a/lib/app/modules/bdt/auth_token_endpoint_sequence.rb b/lib/app/modules/bdt/auth_token_endpoint_sequence.rb index 624667fc1..0ff1b6cef 100644 --- a/lib/app/modules/bdt/auth_token_endpoint_sequence.rb +++ b/lib/app/modules/bdt/auth_token_endpoint_sequence.rb @@ -5,16 +5,16 @@ module Inferno module Sequence class BDTAuthTokenEndpointSequence < BDTBase - group 'FIXME' - title 'Auth Token Endpoint' description 'Token endpoint' test_id_prefix 'Auth_Token_endpoint' - requires :token - conformance_supports :CarePlan + requires :bulk_url, :bulk_token_endpoint, :bulk_client_id, \ + :bulk_system_export_endpoint, :bulk_patient_export_endpoint, :bulk_group_export_endpoint, \ + :bulk_fastest_resource, :bulk_requires_auth, :bulk_since_param, :bulk_jwks_url_auth, :bulk_jwks_url_auth, \ + :bulk_public_key, :bulk_private_key details %( Auth Token Endpoint @@ -133,7 +133,7 @@ class BDTAuthTokenEndpointSequence < BDTBase id '11' link 'http://bulkdatainfo' description %( - + The server should reject requests to the token endpoint that do not specify a scope ) versions :r4 end @@ -145,7 +145,7 @@ class BDTAuthTokenEndpointSequence < BDTBase id '12' link 'http://bulkdatainfo' description %( - + The server should reject requests to the token endpoint that are requesting an empty scope ) versions :r4 end @@ -217,7 +217,7 @@ class BDTAuthTokenEndpointSequence < BDTBase id '18' link 'http://bulkdatainfo' description %( - + When present, the jky authentication JWT header should match a value that the client supplied to the FHIR server at client registration time. This test attempts to authorize using test-bad-jku as jky header value and expects that to produce an error. ) versions :r4 end @@ -236,18 +236,30 @@ class BDTAuthTokenEndpointSequence < BDTBase run_bdt('0.3.17') end - test 'Authorization using JWKS URL' do + test 'Authorization using JWKS URL and ES384 keys' do metadata do id '20' link 'http://bulkdatainfo' description %( - + Verify that the server supports JWKS URL authorization using ES384 keys. This would also prove that JWK keys rotation works because this test will create new key, every time it is executed. ) versions :r4 end run_bdt('0.3.18') end + test 'Authorization using JWKS URL and RS384 keys' do + metadata do + id '21' + link 'http://bulkdatainfo' + description %( + Verify that the server supports JWKS URL authorization using RS384 keys. This would also prove that JWK keys rotation works because this test will create new key, every time it is executed. + ) + versions :r4 + end + + run_bdt('0.3.19') + end end end end diff --git a/lib/app/modules/bdt/bdt_base.rb b/lib/app/modules/bdt/bdt_base.rb index 52581fcd4..274fa9248 100644 --- a/lib/app/modules/bdt/bdt_base.rb +++ b/lib/app/modules/bdt/bdt_base.rb @@ -3,7 +3,7 @@ module Inferno module Sequence class BDTBase < SequenceBase - BDT_URL = 'http://bdt-service:4500/api/tests' + BDT_URL = 'http://localhost:4500/api/tests' BDT_CONFIG = { 'path' => '5.0', @@ -56,10 +56,28 @@ class BDTBase < SequenceBase } }.freeze + def settings + { + 'baseUrl' => @instance.bulk_url, + 'tokenEndpoint' => @instance.bulk_token_endpoint, + 'clientId' => @instance.bulk_client_id, + 'systemExportEndpoint' => @instance.bulk_system_export_endpoint, + 'patientExportEndpoint' => @instance.bulk_patient_export_endpoint, + 'groupExportEndpoint' => @instance.bulk_group_export_endpoint, + 'fastestResource' => @instance.bulk_fastest_resource, + 'requiresAuth' => !@instance.bulk_requires_auth.nil?, + 'sinceParam' => '_since', + 'jwksUrlAuth' => true, + 'jwksAuth' => true, + 'publicKey' => @instance.bulk_public_key, + 'privateKey' => @instance.bulk_private_key + } + end + def run_bdt(path) payload = { 'path' => path, - 'settings' => BDT_CONFIG + 'settings' => settings } response = RestClient.post(BDT_URL, payload.to_json, content_type: :json, accept: :json) response.body.split("\n").each do |chunk| @@ -115,6 +133,7 @@ def run_bdt(path) end omit 'Not supported' if data['status'] == 'not-supported' + binding.pry if data['status'] == 'not-supported' assert message['status'] != 'error', data['error'] end diff --git a/lib/app/modules/bdt/download_sequence.rb b/lib/app/modules/bdt/download_sequence.rb index 308cf899e..cacf192cc 100644 --- a/lib/app/modules/bdt/download_sequence.rb +++ b/lib/app/modules/bdt/download_sequence.rb @@ -5,16 +5,16 @@ module Inferno module Sequence class BDTDownloadSequence < BDTBase - group 'FIXME' - title 'Download' description 'Download Endpoint' test_id_prefix 'Download' - requires :token - conformance_supports :CarePlan + requires :bulk_url, :bulk_token_endpoint, :bulk_client_id, \ + :bulk_system_export_endpoint, :bulk_patient_export_endpoint, :bulk_group_export_endpoint, \ + :bulk_fastest_resource, :bulk_requires_auth, :bulk_since_param, :bulk_jwks_url_auth, :bulk_jwks_url_auth, \ + :bulk_public_key, :bulk_private_key details %( Download @@ -68,6 +68,18 @@ class BDTDownloadSequence < BDTBase run_bdt('1.3') end + test 'Rejects a download if the client scopes do not cover that resource type' do + metadata do + id '05' + link 'http://bulkdatainfo' + description %( + If the download endpoint requires authorization, it should also verify that the client has been granted access to the resource type that it attempts to download. This test makes an export and then it re-authorizes before downloading the first file, so that the download request is made with a token that does not provide access to the downloaded resource. + ) + versions :r4 + end + + run_bdt('1.4') + end end end end diff --git a/lib/app/modules/bdt/group_sequence.rb b/lib/app/modules/bdt/group_sequence.rb index d619b9283..bfb09ed3f 100644 --- a/lib/app/modules/bdt/group_sequence.rb +++ b/lib/app/modules/bdt/group_sequence.rb @@ -5,16 +5,16 @@ module Inferno module Sequence class BDTGroupSequence < BDTBase - group 'FIXME' - title 'Group' description 'Group-level export' test_id_prefix 'Group' - requires :token - conformance_supports :CarePlan + requires :bulk_url, :bulk_token_endpoint, :bulk_client_id, \ + :bulk_system_export_endpoint, :bulk_patient_export_endpoint, :bulk_group_export_endpoint, \ + :bulk_fastest_resource, :bulk_requires_auth, :bulk_since_param, :bulk_jwks_url_auth, :bulk_jwks_url_auth, \ + :bulk_public_key, :bulk_private_key details %( Group diff --git a/lib/app/modules/bdt/patient_sequence.rb b/lib/app/modules/bdt/patient_sequence.rb index a856fd8c0..76c0e7f45 100644 --- a/lib/app/modules/bdt/patient_sequence.rb +++ b/lib/app/modules/bdt/patient_sequence.rb @@ -5,16 +5,16 @@ module Inferno module Sequence class BDTPatientSequence < BDTBase - group 'FIXME' - title 'Patient' description 'Patient-level export' test_id_prefix 'Patient' - requires :token - conformance_supports :CarePlan + requires :bulk_url, :bulk_token_endpoint, :bulk_client_id, \ + :bulk_system_export_endpoint, :bulk_patient_export_endpoint, :bulk_group_export_endpoint, \ + :bulk_fastest_resource, :bulk_requires_auth, :bulk_since_param, :bulk_jwks_url_auth, :bulk_jwks_url_auth, \ + :bulk_public_key, :bulk_private_key details %( Patient diff --git a/lib/app/modules/bdt/status_sequence.rb b/lib/app/modules/bdt/status_sequence.rb index f1991f50f..c6bb156f9 100644 --- a/lib/app/modules/bdt/status_sequence.rb +++ b/lib/app/modules/bdt/status_sequence.rb @@ -5,16 +5,16 @@ module Inferno module Sequence class BDTStatusSequence < BDTBase - group 'FIXME' - title 'Status' description 'Status Endpoint' test_id_prefix 'Status' - requires :token - conformance_supports :CarePlan + requires :bulk_url, :bulk_token_endpoint, :bulk_client_id, \ + :bulk_system_export_endpoint, :bulk_patient_export_endpoint, :bulk_group_export_endpoint, \ + :bulk_fastest_resource, :bulk_requires_auth, :bulk_since_param, :bulk_jwks_url_auth, :bulk_jwks_url_auth, \ + :bulk_public_key, :bulk_private_key details %( Status @@ -25,7 +25,7 @@ class BDTStatusSequence < BDTBase id '01' link 'http://bulkdatainfo' description %( -

    The status endpoint should return 202 status code until the export is completed.

    See https://github.com/smart-on-fhir/fhir-bulk-data-docs/blob/master/export.md#response---in-progress-status +

    The status endpoint should return 202 status code until the export is completed.

    See https://github.com/HL7/bulk-data/blob/master/spec/export/index.md#response---in-progress-status ) versions :r4 end @@ -37,7 +37,7 @@ class BDTStatusSequence < BDTBase id '02' link 'http://bulkdatainfo' description %( - Runs a set of assertions to verify that:
    • The returned HTTP status code is 5XX
    • The server returns a FHIR OperationOutcome resource in JSON format

    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.

    See https://github.com/smart-on-fhir/fhir-bulk-data-docs/blob/master/export.md#response---error-status-1 + Runs a set of assertions to verify that:
    • The returned HTTP status code is 5XX
    • The server returns a FHIR OperationOutcome resource in JSON format

    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.

    See https://github.com/HL7/bulk-data/blob/master/spec/export/index.md#response---error-status-1 ) versions :r4 end diff --git a/lib/app/modules/bdt/system_sequence.rb b/lib/app/modules/bdt/system_sequence.rb index 323449d53..c0c84a61f 100644 --- a/lib/app/modules/bdt/system_sequence.rb +++ b/lib/app/modules/bdt/system_sequence.rb @@ -5,16 +5,16 @@ module Inferno module Sequence class BDTSystemSequence < BDTBase - group 'FIXME' - title 'System' description 'System-level export' test_id_prefix 'System' - requires :token - conformance_supports :CarePlan + requires :bulk_url, :bulk_token_endpoint, :bulk_client_id, \ + :bulk_system_export_endpoint, :bulk_patient_export_endpoint, :bulk_group_export_endpoint, \ + :bulk_fastest_resource, :bulk_requires_auth, :bulk_since_param, :bulk_jwks_url_auth, :bulk_jwks_url_auth, \ + :bulk_public_key, :bulk_private_key details %( System diff --git a/lib/app/views/default.erb b/lib/app/views/default.erb index f9e0ead24..f0382ed95 100644 --- a/lib/app/views/default.erb +++ b/lib/app/views/default.erb @@ -114,7 +114,6 @@ - diff --git a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb new file mode 100644 index 000000000..da9c4a216 --- /dev/null +++ b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb @@ -0,0 +1,68 @@ +# frozen_string_literal: true + +module Inferno + module Sequence + class BulkDataAuthorizationSequence < SequenceBase + title 'Bulk Data Authentication' + + test_id_prefix 'BDA' + + requires :client_id, :bulk_private_key, :oauth_token_endpoint + + description 'Test Bulk Data Authorization Token Endpoint' + + def authorize + id_token = JSON::JWT.new( + iss: @instance.client_id, + sub: @instance.client_id, + aud: @instance.oauth_token_endpoint, + exp: 1.hour.from_now, + jti: SecureRandom.hex(32) + ) + + jwk = JSON::JWK.new(JSON.parse(@instance.bulk_private_key)) + + id_token.header[:kid] = jwk['kid'] + private_key = jwk.to_key + client_assertion = id_token.sign(private_key, 'RS384') + + payload = + { + 'scope' => 'system/*.read', + 'grant_type' => 'client_credentials', + 'client_assertion_type' => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', + 'client_assertion' => client_assertion.to_s + } + + header = + { + content_type: 'application/x-www-form-urlencoded', + accept: 'application/json' + } + + uri = Addressable::URI.new + uri.query_values = payload + + response = LoggedRestClient.post(@instance.oauth_token_endpoint, uri.query, header) + response + end + + test :return_access_token do + metadata do + id '01' + name 'Bulk Data Token Endpoint shall return access token' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#issuing-access-tokens' + description %( + With valid token request from Bulk Data client, Token endpoint shall return access token. + ) + end + + response = authorize + + assert_response_ok(response) + @access_token = response.body['access_token'] + assert !@access_token.nil?, 'access_token is empty' + end + end + end +end diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb new file mode 100644 index 000000000..b8927589c --- /dev/null +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -0,0 +1,44 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::BulkDataAuthorizationSequence do + before do + @sequence_class = Inferno::Sequence::BulkDataAuthorizationSequence + config = load_json_fixture(:bulk_data_authorization) + + @instance = Inferno::Models::TestingInstance.create( + url: 'http://www.example.com', + client_id: config['client_id'], + bulk_public_key: config['public_key'].to_json, + bulk_private_key: config['private_key'].to_json, + oauth_token_endpoint: config['token_url'] + ) + + @client = FHIR::Client.new(@instance.url) + + @access_token = { + 'token_type' => 'bearer', + 'expires_in' => 900, + 'access_token' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYmVhcmVyIiwiZXhwaXJlc19pbiI6OTAwLCJpYXQiOjE1NzM5NDU1MDQsImV4cCI6MTU3Mzk0NjQwNH0.Ds-9HxQPJshkPYYBowJXltTaX2T6MSv_qYnZLjteTH8' + } + end + + describe 'return access token tests' do + before do + @test = @sequence_class[:return_access_token] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'success when server returns access token' do + stub_request(:post, @instance.oauth_token_endpoint) + .to_return( + status: 200, + headers: { content_type: 'application/json' }, + body: @access_token.to_json + ) + + @sequence.run_test(@test) + end + end +end diff --git a/lib/modules/bulk_data/test/fixtures/bulk_data_authorization.json b/lib/modules/bulk_data/test/fixtures/bulk_data_authorization.json new file mode 100644 index 000000000..e4f470d00 --- /dev/null +++ b/lib/modules/bulk_data/test/fixtures/bulk_data_authorization.json @@ -0,0 +1,32 @@ +{ + "public_key": { + "kty": "RSA", + "alg": "RS384", + "n": "vjbIzTqiY8K8zApeNng5ekNNIxJfXAue9BjoMrZ9Qy9m7yIA-tf6muEupEXWhq70tC7vIGLqJJ4O8m7yiH8H2qklX2mCAMg3xG3nbykY2X7JXtW9P8VIdG0sAMt5aZQnUGCgSS3n0qaooGn2LUlTGIR88Qi-4Nrao9_3Ki3UCiICeCiAE224jGCg0OlQU6qj2gEB3o-DWJFlG_dz1y-Mxo5ivaeM0vWuodjDrp-aiabJcSF_dx26sdC9dZdBKXFDq0t19I9S9AyGpGDJwzGRtWHY6LsskNHLvo8Zb5AsJ9eRZKpnh30SYBZI9WHtzU85M9WQqdScR69Vyp-6Uhfbvw", + "e": "AQAB", + "key_ops": [ + "verify" + ], + "ext": true, + "kid": "b41528b6f37a9500edb8a905a595bdd7" + }, + "private_key": { + "kty": "RSA", + "alg": "RS384", + "n": "vjbIzTqiY8K8zApeNng5ekNNIxJfXAue9BjoMrZ9Qy9m7yIA-tf6muEupEXWhq70tC7vIGLqJJ4O8m7yiH8H2qklX2mCAMg3xG3nbykY2X7JXtW9P8VIdG0sAMt5aZQnUGCgSS3n0qaooGn2LUlTGIR88Qi-4Nrao9_3Ki3UCiICeCiAE224jGCg0OlQU6qj2gEB3o-DWJFlG_dz1y-Mxo5ivaeM0vWuodjDrp-aiabJcSF_dx26sdC9dZdBKXFDq0t19I9S9AyGpGDJwzGRtWHY6LsskNHLvo8Zb5AsJ9eRZKpnh30SYBZI9WHtzU85M9WQqdScR69Vyp-6Uhfbvw", + "e": "AQAB", + "d": "rriV9GYimi5by7TOW4xNh6_gYBHVRDBsft2OFF8qapdVHt2GNuRDDxc_B6ga6TY2Enh2MLKLTr1dD3W4FIdTCJiMerrorp07FJS7nJEMgWQDxrfgkX4_EqrhW42L5d4vypYnRXEEW6u4gzkx5uFOkdvJBIK7CsIdSaBFYhochnynNgvbKWasi4rl2hayEH8tdf3B7Z6OIH9alspBTaq3j_zJt_KkrpYEzIUb4UgALB5NTWn5YKr0Avk_asOg8YfjViQwO9ASGaWjQeJ2Rx8OEQwBMQHSDMCSWNiWmYOu9PcwSZFc1vLxqzyIM8QrQSJHCCMo_wGYgke_r0CLeONHEQ", + "p": "5hH_QApWGeobRi1n7XbMfJYohB8K3JDPa0MspfplHpJ-17JiGG2sNoBdBcpaPRf9OX48P8VqO0qrSSRAk-I-uO6OO9BHbIukXJILqnY2JmurYzbcYbt5FVbknlHRJojkF6-7sFBazpueUlOnXCw7X7Z_SkfNE4QX5Ejm2Zm5mek", + "q": "06bZz7c7K9s1-aEZsxYnLJ9eTpKlt1tIBDA_LwIh5W3w259pes2kUtimbnkyOf-V2ZIERsFCh5s-S9IOEMvAIa6M5j9GW1ILNT7AcHIUfcyFcH-FF8BU_KJdRP5PXnIXFdYcylvsdoIdchy1AaUIzyiKRCU3HBYI75hez0l_F2c", + "dp": "h_sVIXW6hCCRND48EedIX06k7conMkxIu_39ErDXOWWeoMAnKIcR5TijQnviL__QxD1vQMXezuKIMHfDz2RGbClbWdD1lhtG7wvG515tDPJQXxia0wzqOQmdoFF9S8hXAAT26vPjaAAkaEZXQaxG_4Au5elgNWu6b0wDXZN1Vpk", + "dq": "GqS0YpuUTU8JGmWXUJ4HTGy7eHSpe8134V8ZdRd1oOYYHe2RX64nc25mdR24nuh3uq3Q7_9AGsYGL5E_yAl-JD9O6WUpvDE1y_wcSYty3Os0GRdUb8r8Z9kgmKDS6Pa_xTXw5eBwgfKbNlQ6zPwzgbB-x1lP-K8lbNPni3ybDR0", + "qi": "cqQfoi0sM5Su8ZOhznmdWrDIQB28H6fBKiabgaIKkbWZV4e0nwFvLquHjPOvv4Ao8iEGU5dyhvg0n5BKYPi-4mp6M6OA1sy0NrTr7EsKSYGyu2pBq9rw4oAYTM2LXKg6K-awgUUlkc451IwxHBAe15PWCBM3kvLQeijNid0Vz5I", + "key_ops": [ + "sign" + ], + "ext": true, + "kid": "b41528b6f37a9500edb8a905a595bdd7" + }, + "client_id": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6InJlZ2lzdHJhdGlvbi10b2tlbiJ9.eyJqd2tzIjp7ImtleXMiOlt7Imt0eSI6IlJTQSIsImFsZyI6IlJTMzg0IiwibiI6InZqYkl6VHFpWThLOHpBcGVObmc1ZWtOTkl4SmZYQXVlOUJqb01yWjlReTltN3lJQS10ZjZtdUV1cEVYV2hxNzB0Qzd2SUdMcUpKNE84bTd5aUg4SDJxa2xYMm1DQU1nM3hHM25ieWtZMlg3Slh0VzlQOFZJZEcwc0FNdDVhWlFuVUdDZ1NTM24wcWFvb0duMkxVbFRHSVI4OFFpLTROcmFvOV8zS2kzVUNpSUNlQ2lBRTIyNGpHQ2cwT2xRVTZxajJnRUIzby1EV0pGbEdfZHoxeS1NeG81aXZhZU0wdld1b2RqRHJwLWFpYWJKY1NGX2R4MjZzZEM5ZFpkQktYRkRxMHQxOUk5UzlBeUdwR0RKd3pHUnRXSFk2THNza05ITHZvOFpiNUFzSjllUlpLcG5oMzBTWUJaSTlXSHR6VTg1TTlXUXFkU2NSNjlWeXAtNlVoZmJ2dyIsImUiOiJBUUFCIiwia2V5X29wcyI6WyJ2ZXJpZnkiXSwiZXh0Ijp0cnVlLCJraWQiOiJiNDE1MjhiNmYzN2E5NTAwZWRiOGE5MDVhNTk1YmRkNyJ9LHsia3R5IjoiUlNBIiwiYWxnIjoiUlMzODQiLCJuIjoidmpiSXpUcWlZOEs4ekFwZU5uZzVla05OSXhKZlhBdWU5QmpvTXJaOVF5OW03eUlBLXRmNm11RXVwRVhXaHE3MHRDN3ZJR0xxSko0TzhtN3lpSDhIMnFrbFgybUNBTWczeEczbmJ5a1kyWDdKWHRXOVA4VklkRzBzQU10NWFaUW5VR0NnU1MzbjBxYW9vR24yTFVsVEdJUjg4UWktNE5yYW85XzNLaTNVQ2lJQ2VDaUFFMjI0akdDZzBPbFFVNnFqMmdFQjNvLURXSkZsR19kejF5LU14bzVpdmFlTTB2V3VvZGpEcnAtYWlhYkpjU0ZfZHgyNnNkQzlkWmRCS1hGRHEwdDE5STlTOUF5R3BHREp3ekdSdFdIWTZMc3NrTkhMdm84WmI1QXNKOWVSWktwbmgzMFNZQlpJOVdIdHpVODVNOVdRcWRTY1I2OVZ5cC02VWhmYnZ3IiwiZSI6IkFRQUIiLCJkIjoicnJpVjlHWWltaTVieTdUT1c0eE5oNl9nWUJIVlJEQnNmdDJPRkY4cWFwZFZIdDJHTnVSRER4Y19CNmdhNlRZMkVuaDJNTEtMVHIxZEQzVzRGSWRUQ0ppTWVycm9ycDA3RkpTN25KRU1nV1FEeHJmZ2tYNF9FcXJoVzQyTDVkNHZ5cFluUlhFRVc2dTRnemt4NXVGT2tkdkpCSUs3Q3NJZFNhQkZZaG9jaG55bk5ndmJLV2FzaTRybDJoYXlFSDh0ZGYzQjdaNk9JSDlhbHNwQlRhcTNqX3pKdF9La3JwWUV6SVViNFVnQUxCNU5UV241WUtyMEF2a19hc09nOFlmalZpUXdPOUFTR2FXalFlSjJSeDhPRVF3Qk1RSFNETUNTV05pV21ZT3U5UGN3U1pGYzF2THhxenlJTThRclFTSkhDQ01vX3dHWWdrZV9yMENMZU9OSEVRIiwicCI6IjVoSF9RQXBXR2VvYlJpMW43WGJNZkpZb2hCOEszSkRQYTBNc3BmcGxIcEotMTdKaUdHMnNOb0JkQmNwYVBSZjlPWDQ4UDhWcU8wcXJTU1JBay1JLXVPNk9POUJIYkl1a1hKSUxxblkySm11cll6YmNZYnQ1RlZia25sSFJKb2prRjYtN3NGQmF6cHVlVWxPblhDdzdYN1pfU2tmTkU0UVg1RWptMlptNW1layIsInEiOiIwNmJaejdjN0s5czEtYUVac3hZbkxKOWVUcEtsdDF0SUJEQV9Md0loNVczdzI1OXBlczJrVXRpbWJua3lPZi1WMlpJRVJzRkNoNXMtUzlJT0VNdkFJYTZNNWo5R1cxSUxOVDdBY0hJVWZjeUZjSC1GRjhCVV9LSmRSUDVQWG5JWEZkWWN5bHZzZG9JZGNoeTFBYVVJenlpS1JDVTNIQllJNzVoZXowbF9GMmMiLCJkcCI6Imhfc1ZJWFc2aENDUk5ENDhFZWRJWDA2azdjb25Na3hJdV8zOUVyRFhPV1dlb01BbktJY1I1VGlqUW52aUxfX1F4RDF2UU1YZXp1S0lNSGZEejJSR2JDbGJXZEQxbGh0Rzd3dkc1MTV0RFBKUVh4aWEwd3pxT1FtZG9GRjlTOGhYQUFUMjZ2UGphQUFrYUVaWFFheEdfNEF1NWVsZ05XdTZiMHdEWFpOMVZwayIsImRxIjoiR3FTMFlwdVVUVThKR21XWFVKNEhUR3k3ZUhTcGU4MTM0VjhaZFJkMW9PWVlIZTJSWDY0bmMyNW1kUjI0bnVoM3VxM1E3XzlBR3NZR0w1RV95QWwtSkQ5TzZXVXB2REUxeV93Y1NZdHkzT3MwR1JkVWI4cjhaOWtnbUtEUzZQYV94VFh3NWVCd2dmS2JObFE2elB3emdiQi14MWxQLUs4bGJOUG5pM3liRFIwIiwicWkiOiJjcVFmb2kwc001U3U4Wk9oem5tZFdyRElRQjI4SDZmQktpYWJnYUlLa2JXWlY0ZTBud0Z2THF1SGpQT3Z2NEFvOGlFR1U1ZHlodmcwbjVCS1lQaS00bXA2TTZPQTFzeTBOclRyN0VzS1NZR3l1MnBCcTlydzRvQVlUTTJMWEtnNkstYXdnVVVsa2M0NTFJd3hIQkFlMTVQV0NCTTNrdkxRZWlqTmlkMFZ6NUkiLCJrZXlfb3BzIjpbInNpZ24iXSwiZXh0Ijp0cnVlLCJraWQiOiJiNDE1MjhiNmYzN2E5NTAwZWRiOGE5MDVhNTk1YmRkNyJ9XX0sImFjY2Vzc1Rva2Vuc0V4cGlyZUluIjoxNSwiaWF0IjoxNTc0MDEyMDUzfQ.7jGC1c-NVMHRQhA_DsR-Wr3FbPnmzNUBRufNi88uXsk", + "token_url": "http://www.example.com/auth/token" +} \ No newline at end of file diff --git a/lib/modules/bulk_data_module.yml b/lib/modules/bulk_data_module.yml index 246634341..b14e603c4 100644 --- a/lib/modules/bulk_data_module.yml +++ b/lib/modules/bulk_data_module.yml @@ -11,6 +11,10 @@ test_sets: sequences: - BulkDataCapabilityStatementSequence - BulkDataDiscoverySequence + run_all: true + - name: Authorization + sequences: + - BulkDataAuthorizationSequence - name: Group Export sequences: - BulkDataGroupExportSequence diff --git a/public/js/app.js b/public/js/app.js index 5e0a18a7d..ba89d9833 100644 --- a/public/js/app.js +++ b/public/js/app.js @@ -184,7 +184,9 @@ $(function(){ formInput.find(':radio').each(function(){ $(this).attr('id', $(this)[0].id + '_active'); }); - formInput.find('input')[0].removeAttribute('readonly'); + if(formInput.find('input').length >0){ + formInput.find('input')[0].removeAttribute('readonly'); + } formInput.find(':radio:not(:checked)').attr('disabled', false); $('.enabled-prerequisites').append(formInput); $('.enabled-prerequisite-group-title').show(); From 679f76760a5a16f6c7b2084bbf514ab372242ddd Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Tue, 19 Nov 2019 14:29:25 -0500 Subject: [PATCH 111/173] fix for PR comments --- .../bulk_data/bulk_data_discovery_sequence.rb | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/lib/modules/bulk_data/bulk_data_discovery_sequence.rb b/lib/modules/bulk_data/bulk_data_discovery_sequence.rb index 87ea539dc..a00f0b421 100644 --- a/lib/modules/bulk_data/bulk_data_discovery_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_discovery_sequence.rb @@ -109,20 +109,6 @@ def oauth2_metadata_from_conformance assert conformance_token_url.present?, 'No token URI provided in Conformance/CapabilityStatement resource' assert_valid_http_uri conformance_token_url, "Invalid token url: '#{conformance_token_url}'" - warning do - services = [] - @conformance.try(:rest)&.each do |endpoint| - endpoint.try(:security).try(:service)&.each do |sec_service| - sec_service.try(:coding)&.each do |coding| - services << coding.code - end - end - end - - assert !services.empty?, 'No security services listed. Conformance/CapabilityStatement.rest.security.service should be SMART-on-FHIR.' - assert services.any? { |service| service == 'SMART-on-FHIR' }, "Conformance/CapabilityStatement.rest.security.service set to #{services.map { |e| "'" + e + "'" }.join(', ')}. It should contain 'SMART-on-FHIR'." - end - @instance.update( oauth_token_endpoint: conformance_token_url ) From 15a83afedb08ad356bc786897855b54702bc4122 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Tue, 19 Nov 2019 16:31:13 -0500 Subject: [PATCH 112/173] add two unit tests for test 01 --- .../test/authorization_sequence_test.rb | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index b8927589c..8f20d7c7e 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -40,5 +40,31 @@ @sequence.run_test(@test) end + + it 'fail when server returns status other than 200' do + stub_request(:post, @instance.oauth_token_endpoint) + .to_return( + status: 400 + ) + + assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + end + + it 'fail when server returns empty access_token' do + invalid_access_token = @access_token.clone + invalid_access_token['access_token'] = nil + + stub_request(:post, @instance.oauth_token_endpoint) + .to_return( + status: 400, + body: invalid_access_token.to_json + ) + + assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + end end end From e394176b40100ec7f0a9dfd9376fd619933b26d5 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Tue, 19 Nov 2019 20:25:56 -0600 Subject: [PATCH 113/173] fix PR comments --- .../bulk_data/bulk_data_discovery_sequence.rb | 1 - .../bulk_data/test/discovery_sequence_test.rb | 18 ++++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/modules/bulk_data/bulk_data_discovery_sequence.rb b/lib/modules/bulk_data/bulk_data_discovery_sequence.rb index a00f0b421..3df598da2 100644 --- a/lib/modules/bulk_data/bulk_data_discovery_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_discovery_sequence.rb @@ -106,7 +106,6 @@ def oauth2_metadata_from_conformance conformance_token_url = oauth_metadata[:token_url] - assert conformance_token_url.present?, 'No token URI provided in Conformance/CapabilityStatement resource' assert_valid_http_uri conformance_token_url, "Invalid token url: '#{conformance_token_url}'" @instance.update( diff --git a/lib/modules/bulk_data/test/discovery_sequence_test.rb b/lib/modules/bulk_data/test/discovery_sequence_test.rb index 6c43006a7..7b21b3fb5 100644 --- a/lib/modules/bulk_data/test/discovery_sequence_test.rb +++ b/lib/modules/bulk_data/test/discovery_sequence_test.rb @@ -133,12 +133,14 @@ stub_request(:get, @conformance_endpoint) .to_return( status: 200, - body: @conformance.to_json + body: invalid_conformance.to_json ) - assert_raises(Inferno::AssertionException) do + error = assert_raises(Inferno::AssertionException) do @sequence.run_test(@test) end + + assert_match(/^No OAuth Metadata/, error.message) end it 'fails when conformance does not have token endpoint' do @@ -147,26 +149,30 @@ stub_request(:get, @conformance_endpoint) .to_return( status: 200, - body: @conformance.to_json + body: invalid_conformance.to_json ) - assert_raises(Inferno::AssertionException) do + error = assert_raises(Inferno::AssertionException) do @sequence.run_test(@test) end + + assert_match(/^No OAuth Metadata/, error.message) end it 'fails when conformance token endpoint does not have url' do invalid_conformance = @conformance.clone - invalid_conformance['rest'][0]['security']['extension'][0]['extension'][0]['url'] = 'This is not a url' + invalid_conformance['rest'][0]['security']['extension'][0]['extension'][0]['valueUri'] = 'This is not a url' stub_request(:get, @conformance_endpoint) .to_return( status: 200, body: invalid_conformance.to_json ) - assert_raises(Inferno::AssertionException) do + error = assert_raises(Inferno::AssertionException) do @sequence.run_test(@test) end + + assert_match(/^Invalid token url/, error.message) end end end From a0d00d7f4ba85a8fd41439c53cf7cc9ce14fec0f Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Tue, 19 Nov 2019 20:39:40 -0600 Subject: [PATCH 114/173] Remove rubocop blank and fix testing error --- .../bulk_data/bulk_data_authorization_sequence.rb | 3 ++- .../bulk_data/test/authorization_sequence_test.rb | 14 +++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb index da9c4a216..70054a6b3 100644 --- a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb @@ -60,7 +60,8 @@ def authorize response = authorize assert_response_ok(response) - @access_token = response.body['access_token'] + response_body = JSON.parse(response.body) + @access_token = response_body['access_token'] assert !@access_token.nil?, 'access_token is empty' end end diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index 8f20d7c7e..1639d4f6a 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -47,24 +47,28 @@ status: 400 ) - assert_raises(Inferno::AssertionException) do + error = assert_raises(Inferno::AssertionException) do @sequence.run_test(@test) end + + assert_match(/^Bad response code/, error.message) end - + it 'fail when server returns empty access_token' do invalid_access_token = @access_token.clone invalid_access_token['access_token'] = nil - + stub_request(:post, @instance.oauth_token_endpoint) .to_return( - status: 400, + status: 200, body: invalid_access_token.to_json ) - assert_raises(Inferno::AssertionException) do + error = assert_raises(Inferno::AssertionException) do @sequence.run_test(@test) end + + assert_match(/access_token is empty/, error.message) end end end From 588b54b6c837ffedbf5cfebdd2f03d615b372e99 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 15 Nov 2019 10:15:22 -0500 Subject: [PATCH 115/173] update generator to create keys for read tests --- generator/uscore/uscore_generator.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 0a491c917..8c676fb47 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -104,8 +104,10 @@ def generate_sequence(sequence) end def create_read_test(sequence) + key = :resource_read read_test = { tests_that: "Can read #{sequence[:resource]} from the server", + key: key, index: sequence[:tests].length + 1, link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' } From 4ea6f976897a7318ff2319ea87c50385540b8762 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 15 Nov 2019 10:17:17 -0500 Subject: [PATCH 116/173] regenerate us core sequences --- lib/modules/uscore_v3.1.0/us_core_location_sequence.rb | 3 ++- lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb | 3 ++- lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb | 3 ++- lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb | 3 ++- lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb | 3 ++- lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb | 3 ++- 6 files changed, 12 insertions(+), 6 deletions(-) diff --git a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb index a4c7c7392..652449e63 100644 --- a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb @@ -51,9 +51,10 @@ def validate_resource_item(resource, property, value) @resources_found = false - test 'Can read Location from the server' do + test :resource_read do metadata do id '01' + name 'Can read Location from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) diff --git a/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb index 33772a059..186daf708 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb @@ -19,9 +19,10 @@ class USCore310MedicationSequence < SequenceBase @resources_found = false - test 'Can read Medication from the server' do + test :resource_read do metadata do id '01' + name 'Can read Medication from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) diff --git a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb index 5428551c3..c8da58b2a 100644 --- a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb @@ -39,9 +39,10 @@ def validate_resource_item(resource, property, value) @resources_found = false - test 'Can read Organization from the server' do + test :resource_read do metadata do id '01' + name 'Can read Organization from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) diff --git a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb index e2616ad26..09456762e 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb @@ -40,9 +40,10 @@ def validate_resource_item(resource, property, value) @resources_found = false - test 'Can read Practitioner from the server' do + test :resource_read do metadata do id '01' + name 'Can read Practitioner from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) diff --git a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb index 37a1577a4..bc9da6686 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb @@ -33,9 +33,10 @@ def validate_resource_item(resource, property, value) @resources_found = false - test 'Can read PractitionerRole from the server' do + test :resource_read do metadata do id '01' + name 'Can read PractitionerRole from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) diff --git a/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb index 33d51999d..91e9eb73d 100644 --- a/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb @@ -19,9 +19,10 @@ class USCore310ProvenanceSequence < SequenceBase @resources_found = false - test 'Can read Provenance from the server' do + test :resource_read do metadata do id '01' + name 'Can read Provenance from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) From 4bdab9e533cd7a1e59b0f13d604f955c8f0d3c64 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 15 Nov 2019 10:46:39 -0500 Subject: [PATCH 117/173] add resource read unit test generator --- .../unit_tests/resource_read_unit_test.rb.erb | 61 +++++++++++++++++++ .../uscore/us_core_unit_test_generator.rb | 15 ++++- generator/uscore/uscore_generator.rb | 8 ++- 3 files changed, 81 insertions(+), 3 deletions(-) create mode 100644 generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb diff --git a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb new file mode 100644 index 000000000..0a399b2c0 --- /dev/null +++ b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb @@ -0,0 +1,61 @@ +describe 'resource read test' do + before do + @<%= resource_var_name %>_id = '456' + @test = @sequence_class[:<%= key %>] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips if no <%= resource_type %> has been found' do + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No <%= resource_type %> references found from the prior searches', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: '<%= resource_type %>', + resource_id: @<%= resource_var_name %>_id, + testing_instance: @instance + ) + stub_request(:get, "#{@base_url}/<%= resource_type %>/#{@<%= resource_var_name %>_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message + end + + it 'fails if the resource returned is not a <%= resource_type %>' do + Inferno::Models::ResourceReference.create( + resource_type: '<%= resource_type %>', + resource_id: @<%= resource_var_name %>_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/<%= resource_type %>/#{@<%= resource_var_name %>_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal "Expected resource to be of type <%= resource_type %>", exception.message + end + + it 'succeeds when a <%= resource_type %> resource is read successfully' do + <%= resource_var_name %> = FHIR::<%= resource_type %>.new( + id: @<%= resource_var_name %>_id + ) + Inferno::Models::ResourceReference.create( + resource_type: '<%= resource_type %>', + resource_id: @<%= resource_var_name %>_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/<%= resource_type %>/#{@<%= resource_var_name %>_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: <%= resource_var_name %>.to_json) + + @sequence.run_test(@test) + end +end diff --git a/generator/uscore/us_core_unit_test_generator.rb b/generator/uscore/us_core_unit_test_generator.rb index 1bf0ef9ed..2795eab28 100644 --- a/generator/uscore/us_core_unit_test_generator.rb +++ b/generator/uscore/us_core_unit_test_generator.rb @@ -24,11 +24,10 @@ def generate(sequence, path) File.write(file_name, unit_tests) end - def generate_authorization_test(key:, name:, resource_type:, search_params:, class_name:) + def generate_authorization_test(key:, resource_type:, search_params:, class_name:) template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'authorization_unit_test.rb.erb'))) test = template.result_with_hash( key: key, - name: name, resource_type: resource_type, search_param_string: search_params_to_string(search_params), dynamic_search_params: dynamic_search_params(search_params) @@ -36,6 +35,18 @@ def generate_authorization_test(key:, name:, resource_type:, search_params:, cla tests[class_name] << test end + def generate_resource_read_test(key:, resource_type:, class_name:) + template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'resource_read_unit_test.rb.erb'))) + resource_var_name = resource_type.underscore + + test = template.result_with_hash( + key: key, + resource_type: resource_type, + resource_var_name: resource_var_name + ) + tests[class_name] << test + end + def search_params_to_string(search_params) search_params.map do |param, value| if dynamic_search_param? value diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 8c676fb47..19b278df7 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -119,6 +119,12 @@ def create_read_test(sequence) @#{sequence[:resource].downcase}_ary = Array.wrap(@#{sequence[:resource].downcase}) @resources_found = !@#{sequence[:resource].downcase}.nil?) sequence[:tests] << read_test + + unit_test_generator.generate_resource_read_test( + key: key, + resource_type: sequence[:resource], + class_name: sequence[:class_name] + ) end def create_authorization_test(sequence) @@ -142,9 +148,9 @@ def create_authorization_test(sequence) assert_response_unauthorized reply) sequence[:tests] << authorization_test + unit_test_generator.generate_authorization_test( key: key, - name: sequence[:name], resource_type: sequence[:resource], search_params: { patient: '@instance.patient_id' }, class_name: sequence[:class_name] From 3308838fd6ac479942e953c9c74d406de2fb8a1a Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 15 Nov 2019 11:47:48 -0500 Subject: [PATCH 118/173] refactor read tests to use validate_read_reply instead of fetch_resource --- .../unit_tests/resource_read_unit_test.rb.erb | 2 +- generator/uscore/uscore_generator.rb | 5 ++++- lib/app/sequence_base.rb | 10 ++++++---- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb index 0a399b2c0..d1ca949f0 100644 --- a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb @@ -39,7 +39,7 @@ describe 'resource read test' do exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Expected resource to be of type <%= resource_type %>", exception.message + assert_equal "Expected resource to be of type <%= resource_type %>.", exception.message end it 'succeeds when a <%= resource_type %> resource is read successfully' do diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 19b278df7..0914728a2 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -115,7 +115,10 @@ def create_read_test(sequence) read_test[:test_code] = %( #{sequence[:resource].downcase}_id = @instance.resource_references.find { |reference| reference.resource_type == '#{sequence[:resource]}' }&.resource_id skip 'No #{sequence[:resource]} references found from the prior searches' if #{sequence[:resource].downcase}_id.nil? - @#{sequence[:resource].downcase} = fetch_resource('#{sequence[:resource]}', #{sequence[:resource].downcase}_id) + @#{sequence[:resource].downcase} = validate_read_reply( + FHIR::#{sequence[:resource]}.new(id: #{sequence[:resource].downcase}_id), + FHIR::#{sequence[:resource]} + ) @#{sequence[:resource].downcase}_ary = Array.wrap(@#{sequence[:resource].downcase}) @resources_found = !@#{sequence[:resource].downcase}.nil?) sequence[:tests] << read_test diff --git a/lib/app/sequence_base.rb b/lib/app/sequence_base.rb index c54443c47..7dbc9a0e0 100644 --- a/lib/app/sequence_base.rb +++ b/lib/app/sequence_base.rb @@ -515,18 +515,20 @@ def validate_search_reply(klass, reply, search_params) end def validate_read_reply(resource, klass) - assert !resource.nil?, "No #{klass.name.demodulize} resources available from search." + class_name = klass.name.demodulize + assert !resource.nil?, "No #{class_name} resources available from search." if resource.is_a? FHIR::DSTU2::Reference read_response = resource.read else id = resource.try(:id) - assert !id.nil?, "#{klass} id not returned" + assert !id.nil?, "#{class_name} id not returned" read_response = @client.read(klass, id) assert_response_ok read_response read_response = read_response.resource end - assert !read_response.nil?, "Expected valid #{klass} resource to be present" - assert read_response.is_a?(klass), "Expected resource to be valid #{klass}" + assert !read_response.nil?, "Expected #{class_name} resource to be present." + assert read_response.is_a?(klass), "Expected resource to be of type #{class_name}." + read_response end def validate_history_reply(resource, klass) From d708f8c0ea72d616ddd76ef83d566a0e19e246e5 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 15 Nov 2019 12:07:48 -0500 Subject: [PATCH 119/173] add unit test for resource presence --- .../unit_tests/resource_read_unit_test.rb.erb | 15 +++++++++++++++ generator/uscore/uscore_generator.rb | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb index d1ca949f0..72fe9997d 100644 --- a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb @@ -26,6 +26,21 @@ describe 'resource read test' do assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message end + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: '<%= resource_type %>', + resource_id: @<%= resource_var_name %>_id, + testing_instance: @instance + ) + stub_request(:get, "#{@base_url}/<%= resource_type %>/#{@<%= resource_var_name %>_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected <%= resource_type %> resource to be present.', exception.message + end + it 'fails if the resource returned is not a <%= resource_type %>' do Inferno::Models::ResourceReference.create( resource_type: '<%= resource_type %>', diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 0914728a2..5dcf2b766 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -119,8 +119,8 @@ def create_read_test(sequence) FHIR::#{sequence[:resource]}.new(id: #{sequence[:resource].downcase}_id), FHIR::#{sequence[:resource]} ) - @#{sequence[:resource].downcase}_ary = Array.wrap(@#{sequence[:resource].downcase}) - @resources_found = !@#{sequence[:resource].downcase}.nil?) + @#{sequence[:resource].downcase}_ary = Array.wrap(@#{sequence[:resource].downcase}).compact + @resources_found = @#{sequence[:resource].downcase}.present?) sequence[:tests] << read_test unit_test_generator.generate_resource_read_test( From 4badf9903061318d7025bcfa4435772c5c88f1c9 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 15 Nov 2019 15:05:44 -0500 Subject: [PATCH 120/173] add skip if interaction not supported for read and authorization tests --- .../templates/unit_tests/authorization_unit_test.rb.erb | 9 +++++++++ .../templates/unit_tests/resource_read_unit_test.rb.erb | 9 +++++++++ generator/uscore/templates/unit_tests/unit_test.rb.erb | 3 +++ generator/uscore/us_core_unit_test_generator.rb | 3 ++- generator/uscore/uscore_generator.rb | 6 ++++++ 5 files changed, 29 insertions(+), 1 deletion(-) diff --git a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb index 3b69d3c50..39cce48df 100644 --- a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb @@ -14,6 +14,15 @@ describe 'unauthorized search test' do } end + it 'skips if the <%= resource_type %> search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support <%= resource_type %> search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/<%= resource_type %>") .with(query: @query) diff --git a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb index 72fe9997d..24eda6f73 100644 --- a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb @@ -5,6 +5,15 @@ describe 'resource read test' do @sequence = @sequence_class.new(@instance, @client) end + it 'skips if the <%= resource_type %> read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support <%= resource_type %> read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'skips if no <%= resource_type %> has been found' do exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } diff --git a/generator/uscore/templates/unit_tests/unit_test.rb.erb b/generator/uscore/templates/unit_tests/unit_test.rb.erb index 480903424..97412ef4a 100644 --- a/generator/uscore/templates/unit_tests/unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/unit_test.rb.erb @@ -14,6 +14,9 @@ describe Inferno::Sequence::<%= class_name %> do @instance = Inferno::Models::TestingInstance.create(token: @token) @patient_id = '123' @instance.patient_id = @patient_id + @module = OpenStruct.new(resources_to_test: Set.new(['<%= resource_type %>'])) + @instance.instance_variable_set(:'@module', @module) + set_resource_support(@instance, '<%= resource_type %>') @auth_header = { 'Authorization' => "Bearer #{@token}" } end diff --git a/generator/uscore/us_core_unit_test_generator.rb b/generator/uscore/us_core_unit_test_generator.rb index 2795eab28..78e022208 100644 --- a/generator/uscore/us_core_unit_test_generator.rb +++ b/generator/uscore/us_core_unit_test_generator.rb @@ -14,7 +14,8 @@ def generate(sequence, path) unit_tests = template.result_with_hash( class_name: class_name, - tests: tests[class_name] + tests: tests[class_name], + resource_type: sequence[:resource] ) test_path = File.join(path, 'test') diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 5dcf2b766..12352c59c 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -113,8 +113,11 @@ def create_read_test(sequence) } read_test[:test_code] = %( + skip_if_not_supported(:#{sequence[:resource]}, [:read]) + #{sequence[:resource].downcase}_id = @instance.resource_references.find { |reference| reference.resource_type == '#{sequence[:resource]}' }&.resource_id skip 'No #{sequence[:resource]} references found from the prior searches' if #{sequence[:resource].downcase}_id.nil? + @#{sequence[:resource].downcase} = validate_read_reply( FHIR::#{sequence[:resource]}.new(id: #{sequence[:resource].downcase}_id), FHIR::#{sequence[:resource]} @@ -143,8 +146,11 @@ def create_authorization_test(sequence) return if first_search.nil? authorization_test[:test_code] = %( + skip_if_not_supported(:#{sequence[:resource]}, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) @client.set_bearer_token(@instance.token) From 4468b033a82bb33dd5e68ad6a93650d531bd0fff Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Mon, 18 Nov 2019 12:27:54 -0500 Subject: [PATCH 121/173] specify module in unit tests rather than mocking it --- .../templates/unit_tests/resource_read_unit_test.rb.erb | 4 ++-- generator/uscore/templates/unit_tests/unit_test.rb.erb | 4 +--- generator/uscore/us_core_unit_test_generator.rb | 5 +++-- generator/uscore/uscore_generator.rb | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb index 24eda6f73..3ef2130ca 100644 --- a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb @@ -32,7 +32,7 @@ describe 'resource read test' do exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Bad response code: expected 200, 201, but found 401. ", exception.message + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message end it 'fails if no resource is received' do @@ -63,7 +63,7 @@ describe 'resource read test' do exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } - assert_equal "Expected resource to be of type <%= resource_type %>.", exception.message + assert_equal 'Expected resource to be of type <%= resource_type %>.', exception.message end it 'succeeds when a <%= resource_type %> resource is read successfully' do diff --git a/generator/uscore/templates/unit_tests/unit_test.rb.erb b/generator/uscore/templates/unit_tests/unit_test.rb.erb index 97412ef4a..944efe2be 100644 --- a/generator/uscore/templates/unit_tests/unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/unit_test.rb.erb @@ -11,11 +11,9 @@ describe Inferno::Sequence::<%= class_name %> do @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: '<%= module_name %>') @patient_id = '123' @instance.patient_id = @patient_id - @module = OpenStruct.new(resources_to_test: Set.new(['<%= resource_type %>'])) - @instance.instance_variable_set(:'@module', @module) set_resource_support(@instance, '<%= resource_type %>') @auth_header = { 'Authorization' => "Bearer #{@token}" } end diff --git a/generator/uscore/us_core_unit_test_generator.rb b/generator/uscore/us_core_unit_test_generator.rb index 78e022208..ee08a0625 100644 --- a/generator/uscore/us_core_unit_test_generator.rb +++ b/generator/uscore/us_core_unit_test_generator.rb @@ -7,7 +7,7 @@ def tests @tests ||= Hash.new { |hash, key| hash[key] = [] } end - def generate(sequence, path) + def generate(sequence, path, module_name) template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'unit_test.rb.erb'))) class_name = sequence[:class_name] return if tests[class_name].blank? @@ -15,7 +15,8 @@ def generate(sequence, path) unit_tests = template.result_with_hash( class_name: class_name, tests: tests[class_name], - resource_type: sequence[:resource] + resource_type: sequence[:resource], + module_name: module_name ) test_path = File.join(path, 'test') diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 12352c59c..81a084a50 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -27,7 +27,7 @@ def generate generate_search_validators(metadata) metadata[:sequences].each do |sequence| generate_sequence(sequence) - unit_test_generator.generate(sequence, sequence_out_path) + unit_test_generator.generate(sequence, sequence_out_path, metadata[:name]) end generate_module(metadata) end From 9b40473caa9dda1124205f84190d6511e8c73ae8 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Mon, 18 Nov 2019 12:38:24 -0500 Subject: [PATCH 122/173] generate unit tests for read interaction tests --- .../unit_tests/resource_read_unit_test.rb.erb | 10 +++- .../uscore/us_core_unit_test_generator.rb | 15 ++++- generator/uscore/uscore_generator.rb | 55 +++++++++++-------- 3 files changed, 54 insertions(+), 26 deletions(-) diff --git a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb index 3ef2130ca..f315f4d63 100644 --- a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb @@ -3,6 +3,9 @@ describe 'resource read test' do @<%= resource_var_name %>_id = '456' @test = @sequence_class[:<%= key %>] @sequence = @sequence_class.new(@instance, @client) + <% if interaction_test %>@sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@<%= resource_var_name %>', FHIR::<%= resource_type %>.new(id: @<%= resource_var_name %>_id)) + <% end %> end it 'skips if the <%= resource_type %> read interaction is not supported' do @@ -15,9 +18,10 @@ describe 'resource read test' do end it 'skips if no <%= resource_type %> has been found' do + <% if interaction_test %>@sequence.instance_variable_set(:'@resources_found', false)<% end %> exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } - assert_equal 'No <%= resource_type %> references found from the prior searches', exception.message + assert_equal '<%= no_resources_found_message %>', exception.message end it 'fails if a non-success response code is received' do @@ -26,6 +30,7 @@ describe 'resource read test' do resource_id: @<%= resource_var_name %>_id, testing_instance: @instance ) + stub_request(:get, "#{@base_url}/<%= resource_type %>/#{@<%= resource_var_name %>_id}") .with(query: @query, headers: @auth_header) .to_return(status: 401) @@ -41,6 +46,7 @@ describe 'resource read test' do resource_id: @<%= resource_var_name %>_id, testing_instance: @instance ) + stub_request(:get, "#{@base_url}/<%= resource_type %>/#{@<%= resource_var_name %>_id}") .with(query: @query, headers: @auth_header) .to_return(status: 200) @@ -59,7 +65,7 @@ describe 'resource read test' do stub_request(:get, "#{@base_url}/<%= resource_type %>/#{@<%= resource_var_name %>_id}") .with(query: @query, headers: @auth_header) - .to_return(status: 200, body: FHIR::Patient.new.to_json) + .to_return(status: 200, body: FHIR::<%= wrong_resource_type %>.new.to_json) exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } diff --git a/generator/uscore/us_core_unit_test_generator.rb b/generator/uscore/us_core_unit_test_generator.rb index ee08a0625..1f225d1a7 100644 --- a/generator/uscore/us_core_unit_test_generator.rb +++ b/generator/uscore/us_core_unit_test_generator.rb @@ -37,18 +37,29 @@ def generate_authorization_test(key:, resource_type:, search_params:, class_name tests[class_name] << test end - def generate_resource_read_test(key:, resource_type:, class_name:) + def generate_resource_read_test(key:, resource_type:, class_name:, interaction_test: false) template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'resource_read_unit_test.rb.erb'))) resource_var_name = resource_type.underscore test = template.result_with_hash( key: key, resource_type: resource_type, - resource_var_name: resource_var_name + resource_var_name: resource_var_name, + interaction_test: interaction_test, + no_resources_found_message: no_resources_found_message(interaction_test, resource_type), + wrong_resource_type: resource_type == 'Patient' ? 'Observation' : 'Patient' ) tests[class_name] << test end + def no_resources_found_message(interaction_test, resource_type) + if interaction_test + "No #{resource_type} resources could be found for this patient. Please use patients with more information." + else + "No #{resource_type} references found from the prior searches" + end + end + def search_params_to_string(search_params) search_params.map do |param, value| if dynamic_search_param? value diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 81a084a50..e15efbb53 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -115,15 +115,15 @@ def create_read_test(sequence) read_test[:test_code] = %( skip_if_not_supported(:#{sequence[:resource]}, [:read]) - #{sequence[:resource].downcase}_id = @instance.resource_references.find { |reference| reference.resource_type == '#{sequence[:resource]}' }&.resource_id - skip 'No #{sequence[:resource]} references found from the prior searches' if #{sequence[:resource].downcase}_id.nil? + #{sequence[:resource].underscore}_id = @instance.resource_references.find { |reference| reference.resource_type == '#{sequence[:resource]}' }&.resource_id + skip 'No #{sequence[:resource]} references found from the prior searches' if #{sequence[:resource].underscore}_id.nil? - @#{sequence[:resource].downcase} = validate_read_reply( - FHIR::#{sequence[:resource]}.new(id: #{sequence[:resource].downcase}_id), + @#{sequence[:resource].underscore} = validate_read_reply( + FHIR::#{sequence[:resource]}.new(id: #{sequence[:resource].underscore}_id), FHIR::#{sequence[:resource]} ) - @#{sequence[:resource].downcase}_ary = Array.wrap(@#{sequence[:resource].downcase}).compact - @resources_found = @#{sequence[:resource].downcase}.present?) + @#{sequence[:resource].underscore}_ary = Array.wrap(@#{sequence[:resource].underscore}).compact + @resources_found = @#{sequence[:resource].underscore}.present?) sequence[:tests] << read_test unit_test_generator.generate_resource_read_test( @@ -230,7 +230,7 @@ def create_search_test(sequence, search_param) else %( skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@#{sequence[:resource].downcase}.nil?, 'Expected valid #{sequence[:resource]} resource to be present' + assert !@#{sequence[:resource].underscore}.nil?, 'Expected valid #{sequence[:resource]} resource to be present' #{get_search_params(search_param[:names], sequence)} reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params) @@ -241,19 +241,30 @@ def create_search_test(sequence, search_param) end def create_interaction_test(sequence, interaction) + key = :"#{interaction[:code]}_interaction" interaction_test = { - tests_that: "#{sequence[:resource]} #{interaction[:code]} resource supported", + tests_that: "#{sequence[:resource]} #{interaction[:code]} interaction supported", + key: key, index: sequence[:tests].length + 1, link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' } interaction_test[:test_code] = %( skip_if_not_supported(:#{sequence[:resource]}, [:#{interaction[:code]}]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No #{sequence[:resource]} resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_#{interaction[:code]}_reply(@#{sequence[:resource].downcase}, versioned_resource_class('#{sequence[:resource]}'))) + validate_#{interaction[:code]}_reply(@#{sequence[:resource].underscore}, versioned_resource_class('#{sequence[:resource]}'))) sequence[:tests] << interaction_test + + if interaction[:code] == 'read' # rubocop:disable Style/GuardClause + unit_test_generator.generate_resource_read_test( + key: key, + resource_type: sequence[:resource], + class_name: sequence[:class_name], + interaction_test: true + ) + end end def create_must_support_test(sequence) @@ -265,7 +276,7 @@ def create_must_support_test(sequence) } test[:test_code] += %( - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @#{sequence[:resource].downcase}_ary&.any?) + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @#{sequence[:resource].underscore}_ary&.any?) test[:test_code] += %( must_support_confirmed = {}) @@ -280,11 +291,11 @@ def create_must_support_test(sequence) #{extensions_list.join(",\n ")} } extensions_list.each do |id, url| - @#{sequence[:resource].downcase}_ary&.each do |resource| + @#{sequence[:resource].underscore}_ary&.each do |resource| must_support_confirmed[id] = true if resource.extension.any? { |extension| extension.url == url } break if must_support_confirmed[id] end - skip_notification = "Could not find \#{id} in any of the \#{@#{sequence[:resource].downcase}_ary.length} provided #{sequence[:resource]} resource(s)" + skip_notification = "Could not find \#{id} in any of the \#{@#{sequence[:resource].underscore}_ary.length} provided #{sequence[:resource]} resource(s)" skip skip_notification unless must_support_confirmed[id] end ) @@ -301,12 +312,12 @@ def create_must_support_test(sequence) #{elements_list.join(",\n ")} ] must_support_elements.each do |path| - @#{sequence[:resource].downcase}_ary&.each do |resource| + @#{sequence[:resource].underscore}_ary&.each do |resource| truncated_path = path.gsub('#{sequence[:resource]}.', '') must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) break if must_support_confirmed[path] end - resource_count = @#{sequence[:resource].downcase}_ary.length + resource_count = @#{sequence[:resource].underscore}_ary.length skip "Could not find \#{path} in any of the \#{resource_count} provided #{sequence[:resource]} resource(s)" unless must_support_confirmed[path] end) @@ -342,7 +353,7 @@ def create_references_resolved_test(sequence) skip_if_not_supported(:#{sequence[:resource]}, [:search, :read]) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - validate_reference_resolutions(@#{sequence[:resource].downcase})) + validate_reference_resolutions(@#{sequence[:resource].underscore})) sequence[:tests] << test end @@ -406,10 +417,10 @@ def get_first_search_by_patient(sequence, search_parameters, save_resource_ids_i skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @#{sequence[:resource].downcase} = reply&.resource&.entry&.first&.resource - @#{sequence[:resource].downcase}_ary = fetch_all_bundled_resources(reply&.resource) + @#{sequence[:resource].underscore} = reply&.resource&.entry&.first&.resource + @#{sequence[:resource].underscore}_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(#{save_resource_ids_in_bundle_arguments}) - save_delayed_sequence_references(@#{sequence[:resource].downcase}_ary) + save_delayed_sequence_references(@#{sequence[:resource].underscore}_ary) validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params) ) end @@ -431,11 +442,11 @@ def get_first_search_with_fixed_values(sequence, search_parameters, save_resourc @resources_found = true if resource_count.positive? next unless @resources_found - @#{sequence[:resource].downcase} = reply&.resource&.entry&.first&.resource - @#{sequence[:resource].downcase}_ary = fetch_all_bundled_resources(reply&.resource) + @#{sequence[:resource].underscore} = reply&.resource&.entry&.first&.resource + @#{sequence[:resource].underscore}_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(#{save_resource_ids_in_bundle_arguments}) - save_delayed_sequence_references(@#{sequence[:resource].downcase}_ary) + save_delayed_sequence_references(@#{sequence[:resource].underscore}_ary) validate_search_reply(versioned_resource_class('#{sequence[:resource]}'), reply, search_params) break end From f5cab6e4335ff7d3b7cce226d00824c21e7b8d90 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Mon, 18 Nov 2019 14:31:55 -0500 Subject: [PATCH 123/173] regenerate us core sequences --- .../pediatric_bmi_for_age_sequence.rb | 18 ++- .../pediatric_weight_for_height_sequence.rb | 18 ++- .../test/pediatric_bmi_for_age_test.rb | 103 ++++++++++++++++- .../test/pediatric_weight_for_height_test.rb | 103 ++++++++++++++++- .../test/us_core_allergyintolerance_test.rb | 103 ++++++++++++++++- .../test/us_core_careplan_test.rb | 103 ++++++++++++++++- .../test/us_core_careteam_test.rb | 103 ++++++++++++++++- .../test/us_core_condition_test.rb | 103 ++++++++++++++++- .../test/us_core_diagnosticreport_lab_test.rb | 103 ++++++++++++++++- .../us_core_diagnosticreport_note_test.rb | 103 ++++++++++++++++- .../test/us_core_documentreference_test.rb | 103 ++++++++++++++++- .../test/us_core_encounter_test.rb | 103 ++++++++++++++++- .../uscore_v3.1.0/test/us_core_goal_test.rb | 103 ++++++++++++++++- .../test/us_core_immunization_test.rb | 103 ++++++++++++++++- .../test/us_core_implantable_device_test.rb | 103 ++++++++++++++++- .../test/us_core_location_test.rb | 100 +++++++++++++++- .../test/us_core_medication_test.rb | 108 ++++++++++++++++++ .../test/us_core_medicationrequest_test.rb | 103 ++++++++++++++++- .../test/us_core_observation_lab_test.rb | 103 ++++++++++++++++- .../test/us_core_organization_test.rb | 100 +++++++++++++++- .../test/us_core_patient_test.rb | 103 ++++++++++++++++- .../test/us_core_practitioner_test.rb | 100 +++++++++++++++- .../test/us_core_practitionerrole_test.rb | 100 +++++++++++++++- .../test/us_core_procedure_test.rb | 103 ++++++++++++++++- .../test/us_core_provenance_test.rb | 108 ++++++++++++++++++ .../test/us_core_pulse_oximetry_test.rb | 103 ++++++++++++++++- .../test/us_core_smokingstatus_test.rb | 103 ++++++++++++++++- .../us_core_allergyintolerance_sequence.rb | 40 ++++--- .../us_core_careplan_sequence.rb | 44 ++++--- .../us_core_careteam_sequence.rb | 38 +++--- .../us_core_condition_sequence.rb | 18 ++- .../us_core_diagnosticreport_lab_sequence.rb | 55 +++++---- .../us_core_diagnosticreport_note_sequence.rb | 55 +++++---- .../us_core_documentreference_sequence.rb | 57 +++++---- .../us_core_encounter_sequence.rb | 18 ++- .../uscore_v3.1.0/us_core_goal_sequence.rb | 18 ++- .../us_core_immunization_sequence.rb | 18 ++- .../us_core_implantable_device_sequence.rb | 18 ++- .../us_core_location_sequence.rb | 25 ++-- .../us_core_medication_sequence.rb | 22 ++-- .../us_core_medicationrequest_sequence.rb | 44 ++++--- .../us_core_observation_lab_sequence.rb | 18 ++- .../us_core_organization_sequence.rb | 25 ++-- .../uscore_v3.1.0/us_core_patient_sequence.rb | 18 ++- .../us_core_practitioner_sequence.rb | 25 ++-- .../us_core_practitionerrole_sequence.rb | 49 +++++--- .../us_core_procedure_sequence.rb | 18 ++- .../us_core_provenance_sequence.rb | 22 ++-- .../us_core_pulse_oximetry_sequence.rb | 18 ++- .../us_core_smokingstatus_sequence.rb | 18 ++- 50 files changed, 2997 insertions(+), 293 deletions(-) create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_medication_test.rb create mode 100644 lib/modules/uscore_v3.1.0/test/us_core_provenance_test.rb diff --git a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb index 6f57ae682..7276f6f28 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb @@ -56,8 +56,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Observation, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) @@ -207,9 +210,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Observation read resource supported' do + test :read_interaction do metadata do id '07' + name 'Observation read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -217,14 +221,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation vread resource supported' do + test :vread_interaction do metadata do id '08' + name 'Observation vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -232,14 +237,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation history resource supported' do + test :history_interaction do metadata do id '09' + name 'Observation history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -247,7 +253,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@observation, versioned_resource_class('Observation')) end diff --git a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb index 24e76e543..66fd2b470 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb @@ -56,8 +56,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Observation, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) @@ -207,9 +210,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Observation read resource supported' do + test :read_interaction do metadata do id '07' + name 'Observation read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -217,14 +221,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation vread resource supported' do + test :vread_interaction do metadata do id '08' + name 'Observation vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -232,14 +237,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation history resource supported' do + test :history_interaction do metadata do id '09' + name 'Observation history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -247,7 +253,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@observation, versioned_resource_class('Observation')) end diff --git a/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb b/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb index 7ff539993..2d0527dba 100644 --- a/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb +++ b/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Observation') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Observation search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Observation search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Observation") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @observation_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@observation', FHIR::Observation.new(id: @observation_id)) + end + + it 'skips if the Observation read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Observation read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Observation has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Observation resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Observation resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Observation' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Observation.', exception.message + end + + it 'succeeds when a Observation resource is read successfully' do + observation = FHIR::Observation.new( + id: @observation_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: observation.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb b/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb index 7cf802106..46c4ecda0 100644 --- a/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb +++ b/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Observation') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Observation search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Observation search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Observation") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @observation_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@observation', FHIR::Observation.new(id: @observation_id)) + end + + it 'skips if the Observation read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Observation read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Observation has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Observation resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Observation resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Observation' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Observation.', exception.message + end + + it 'succeeds when a Observation resource is read successfully' do + observation = FHIR::Observation.new( + id: @observation_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: observation.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb index b5f92f6b5..793f04151 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'AllergyIntolerance') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the AllergyIntolerance search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support AllergyIntolerance search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/AllergyIntolerance") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @allergy_intolerance_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@allergy_intolerance', FHIR::AllergyIntolerance.new(id: @allergy_intolerance_id)) + end + + it 'skips if the AllergyIntolerance read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support AllergyIntolerance read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no AllergyIntolerance has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No AllergyIntolerance resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'AllergyIntolerance', + resource_id: @allergy_intolerance_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/AllergyIntolerance/#{@allergy_intolerance_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'AllergyIntolerance', + resource_id: @allergy_intolerance_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/AllergyIntolerance/#{@allergy_intolerance_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected AllergyIntolerance resource to be present.', exception.message + end + + it 'fails if the resource returned is not a AllergyIntolerance' do + Inferno::Models::ResourceReference.create( + resource_type: 'AllergyIntolerance', + resource_id: @allergy_intolerance_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/AllergyIntolerance/#{@allergy_intolerance_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type AllergyIntolerance.', exception.message + end + + it 'succeeds when a AllergyIntolerance resource is read successfully' do + allergy_intolerance = FHIR::AllergyIntolerance.new( + id: @allergy_intolerance_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'AllergyIntolerance', + resource_id: @allergy_intolerance_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/AllergyIntolerance/#{@allergy_intolerance_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: allergy_intolerance.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb index ce6a38cfc..51cb44227 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'CarePlan') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the CarePlan search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support CarePlan search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/CarePlan") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @care_plan_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@care_plan', FHIR::CarePlan.new(id: @care_plan_id)) + end + + it 'skips if the CarePlan read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support CarePlan read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no CarePlan has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No CarePlan resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'CarePlan', + resource_id: @care_plan_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/CarePlan/#{@care_plan_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'CarePlan', + resource_id: @care_plan_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/CarePlan/#{@care_plan_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected CarePlan resource to be present.', exception.message + end + + it 'fails if the resource returned is not a CarePlan' do + Inferno::Models::ResourceReference.create( + resource_type: 'CarePlan', + resource_id: @care_plan_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/CarePlan/#{@care_plan_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type CarePlan.', exception.message + end + + it 'succeeds when a CarePlan resource is read successfully' do + care_plan = FHIR::CarePlan.new( + id: @care_plan_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'CarePlan', + resource_id: @care_plan_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/CarePlan/#{@care_plan_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: care_plan.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb index 22ada4965..be0e8c271 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'CareTeam') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the CareTeam search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support CareTeam search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/CareTeam") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @care_team_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@care_team', FHIR::CareTeam.new(id: @care_team_id)) + end + + it 'skips if the CareTeam read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support CareTeam read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no CareTeam has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No CareTeam resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'CareTeam', + resource_id: @care_team_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/CareTeam/#{@care_team_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'CareTeam', + resource_id: @care_team_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/CareTeam/#{@care_team_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected CareTeam resource to be present.', exception.message + end + + it 'fails if the resource returned is not a CareTeam' do + Inferno::Models::ResourceReference.create( + resource_type: 'CareTeam', + resource_id: @care_team_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/CareTeam/#{@care_team_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type CareTeam.', exception.message + end + + it 'succeeds when a CareTeam resource is read successfully' do + care_team = FHIR::CareTeam.new( + id: @care_team_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'CareTeam', + resource_id: @care_team_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/CareTeam/#{@care_team_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: care_team.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb index 107111597..3f42bf10a 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Condition') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Condition search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Condition search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Condition") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @condition_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@condition', FHIR::Condition.new(id: @condition_id)) + end + + it 'skips if the Condition read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Condition read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Condition has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Condition resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Condition', + resource_id: @condition_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Condition/#{@condition_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Condition', + resource_id: @condition_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Condition/#{@condition_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Condition resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Condition' do + Inferno::Models::ResourceReference.create( + resource_type: 'Condition', + resource_id: @condition_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Condition/#{@condition_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Condition.', exception.message + end + + it 'succeeds when a Condition resource is read successfully' do + condition = FHIR::Condition.new( + id: @condition_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Condition', + resource_id: @condition_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Condition/#{@condition_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: condition.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb index e64e0855c..3ef1fbd5f 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'DiagnosticReport') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the DiagnosticReport search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support DiagnosticReport search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/DiagnosticReport") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @diagnostic_report_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@diagnostic_report', FHIR::DiagnosticReport.new(id: @diagnostic_report_id)) + end + + it 'skips if the DiagnosticReport read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support DiagnosticReport read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no DiagnosticReport has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No DiagnosticReport resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'DiagnosticReport', + resource_id: @diagnostic_report_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DiagnosticReport/#{@diagnostic_report_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'DiagnosticReport', + resource_id: @diagnostic_report_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DiagnosticReport/#{@diagnostic_report_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected DiagnosticReport resource to be present.', exception.message + end + + it 'fails if the resource returned is not a DiagnosticReport' do + Inferno::Models::ResourceReference.create( + resource_type: 'DiagnosticReport', + resource_id: @diagnostic_report_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DiagnosticReport/#{@diagnostic_report_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type DiagnosticReport.', exception.message + end + + it 'succeeds when a DiagnosticReport resource is read successfully' do + diagnostic_report = FHIR::DiagnosticReport.new( + id: @diagnostic_report_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'DiagnosticReport', + resource_id: @diagnostic_report_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DiagnosticReport/#{@diagnostic_report_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: diagnostic_report.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb index de73e89b9..72f6f860a 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'DiagnosticReport') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the DiagnosticReport search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support DiagnosticReport search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/DiagnosticReport") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @diagnostic_report_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@diagnostic_report', FHIR::DiagnosticReport.new(id: @diagnostic_report_id)) + end + + it 'skips if the DiagnosticReport read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support DiagnosticReport read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no DiagnosticReport has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No DiagnosticReport resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'DiagnosticReport', + resource_id: @diagnostic_report_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DiagnosticReport/#{@diagnostic_report_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'DiagnosticReport', + resource_id: @diagnostic_report_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DiagnosticReport/#{@diagnostic_report_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected DiagnosticReport resource to be present.', exception.message + end + + it 'fails if the resource returned is not a DiagnosticReport' do + Inferno::Models::ResourceReference.create( + resource_type: 'DiagnosticReport', + resource_id: @diagnostic_report_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DiagnosticReport/#{@diagnostic_report_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type DiagnosticReport.', exception.message + end + + it 'succeeds when a DiagnosticReport resource is read successfully' do + diagnostic_report = FHIR::DiagnosticReport.new( + id: @diagnostic_report_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'DiagnosticReport', + resource_id: @diagnostic_report_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DiagnosticReport/#{@diagnostic_report_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: diagnostic_report.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb index 5241be4ab..649eed303 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'DocumentReference') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the DocumentReference search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support DocumentReference search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/DocumentReference") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @document_reference_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@document_reference', FHIR::DocumentReference.new(id: @document_reference_id)) + end + + it 'skips if the DocumentReference read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support DocumentReference read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no DocumentReference has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No DocumentReference resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'DocumentReference', + resource_id: @document_reference_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DocumentReference/#{@document_reference_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'DocumentReference', + resource_id: @document_reference_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DocumentReference/#{@document_reference_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected DocumentReference resource to be present.', exception.message + end + + it 'fails if the resource returned is not a DocumentReference' do + Inferno::Models::ResourceReference.create( + resource_type: 'DocumentReference', + resource_id: @document_reference_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DocumentReference/#{@document_reference_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type DocumentReference.', exception.message + end + + it 'succeeds when a DocumentReference resource is read successfully' do + document_reference = FHIR::DocumentReference.new( + id: @document_reference_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'DocumentReference', + resource_id: @document_reference_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/DocumentReference/#{@document_reference_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: document_reference.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb index 3f2b4a79b..2345f8a5a 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Encounter') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Encounter search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Encounter search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Encounter") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @encounter_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@encounter', FHIR::Encounter.new(id: @encounter_id)) + end + + it 'skips if the Encounter read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Encounter read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Encounter has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Encounter resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Encounter', + resource_id: @encounter_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Encounter/#{@encounter_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Encounter', + resource_id: @encounter_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Encounter/#{@encounter_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Encounter resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Encounter' do + Inferno::Models::ResourceReference.create( + resource_type: 'Encounter', + resource_id: @encounter_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Encounter/#{@encounter_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Encounter.', exception.message + end + + it 'succeeds when a Encounter resource is read successfully' do + encounter = FHIR::Encounter.new( + id: @encounter_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Encounter', + resource_id: @encounter_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Encounter/#{@encounter_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: encounter.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb index fd92a930f..e78e4371c 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Goal') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Goal search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Goal search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Goal") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @goal_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@goal', FHIR::Goal.new(id: @goal_id)) + end + + it 'skips if the Goal read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Goal read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Goal has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Goal resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Goal', + resource_id: @goal_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Goal/#{@goal_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Goal', + resource_id: @goal_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Goal/#{@goal_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Goal resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Goal' do + Inferno::Models::ResourceReference.create( + resource_type: 'Goal', + resource_id: @goal_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Goal/#{@goal_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Goal.', exception.message + end + + it 'succeeds when a Goal resource is read successfully' do + goal = FHIR::Goal.new( + id: @goal_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Goal', + resource_id: @goal_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Goal/#{@goal_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: goal.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb index a84e0adfd..755797c42 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Immunization') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Immunization search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Immunization search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Immunization") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @immunization_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@immunization', FHIR::Immunization.new(id: @immunization_id)) + end + + it 'skips if the Immunization read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Immunization read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Immunization has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Immunization resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Immunization', + resource_id: @immunization_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Immunization/#{@immunization_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Immunization', + resource_id: @immunization_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Immunization/#{@immunization_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Immunization resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Immunization' do + Inferno::Models::ResourceReference.create( + resource_type: 'Immunization', + resource_id: @immunization_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Immunization/#{@immunization_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Immunization.', exception.message + end + + it 'succeeds when a Immunization resource is read successfully' do + immunization = FHIR::Immunization.new( + id: @immunization_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Immunization', + resource_id: @immunization_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Immunization/#{@immunization_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: immunization.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb index e11934c0d..03c16b846 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Device') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Device search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Device search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Device") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @device_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@device', FHIR::Device.new(id: @device_id)) + end + + it 'skips if the Device read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Device read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Device has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Device resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Device', + resource_id: @device_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Device/#{@device_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Device', + resource_id: @device_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Device/#{@device_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Device resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Device' do + Inferno::Models::ResourceReference.create( + resource_type: 'Device', + resource_id: @device_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Device/#{@device_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Device.', exception.message + end + + it 'succeeds when a Device resource is read successfully' do + device = FHIR::Device.new( + id: @device_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Device', + resource_id: @device_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Device/#{@device_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: device.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb index 87230d16d..b7c71b808 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb @@ -11,12 +11,101 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Location') @auth_header = { 'Authorization' => "Bearer #{@token}" } end + describe 'resource read test' do + before do + @location_id = '456' + @test = @sequence_class[:resource_read] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips if the Location read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Location read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Location has been found' do + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Location references found from the prior searches', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Location', + resource_id: @location_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Location/#{@location_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Location', + resource_id: @location_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Location/#{@location_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Location resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Location' do + Inferno::Models::ResourceReference.create( + resource_type: 'Location', + resource_id: @location_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Location/#{@location_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Location.', exception.message + end + + it 'succeeds when a Location resource is read successfully' do + location = FHIR::Location.new( + id: @location_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Location', + resource_id: @location_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Location/#{@location_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: location.to_json) + + @sequence.run_test(@test) + end + end + describe 'unauthorized search test' do before do @test = @sequence_class[:unauthorized_search] @@ -27,6 +116,15 @@ } end + it 'skips if the Location search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Location search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Location") .with(query: @query) diff --git a/lib/modules/uscore_v3.1.0/test/us_core_medication_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_medication_test.rb new file mode 100644 index 000000000..756e11d97 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_medication_test.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310MedicationSequence do + before do + @sequence_class = Inferno::Sequence::USCore310MedicationSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') + @patient_id = '123' + @instance.patient_id = @patient_id + set_resource_support(@instance, 'Medication') + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'resource read test' do + before do + @medication_id = '456' + @test = @sequence_class[:resource_read] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips if the Medication read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Medication read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Medication has been found' do + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Medication references found from the prior searches', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Medication', + resource_id: @medication_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Medication/#{@medication_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Medication', + resource_id: @medication_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Medication/#{@medication_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Medication resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Medication' do + Inferno::Models::ResourceReference.create( + resource_type: 'Medication', + resource_id: @medication_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Medication/#{@medication_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Medication.', exception.message + end + + it 'succeeds when a Medication resource is read successfully' do + medication = FHIR::Medication.new( + id: @medication_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Medication', + resource_id: @medication_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Medication/#{@medication_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: medication.to_json) + + @sequence.run_test(@test) + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb index 9ea4d9109..b2dbf4cb0 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'MedicationRequest') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the MedicationRequest search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support MedicationRequest search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/MedicationRequest") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @medication_request_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@medication_request', FHIR::MedicationRequest.new(id: @medication_request_id)) + end + + it 'skips if the MedicationRequest read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support MedicationRequest read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no MedicationRequest has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No MedicationRequest resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'MedicationRequest', + resource_id: @medication_request_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/MedicationRequest/#{@medication_request_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'MedicationRequest', + resource_id: @medication_request_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/MedicationRequest/#{@medication_request_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected MedicationRequest resource to be present.', exception.message + end + + it 'fails if the resource returned is not a MedicationRequest' do + Inferno::Models::ResourceReference.create( + resource_type: 'MedicationRequest', + resource_id: @medication_request_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/MedicationRequest/#{@medication_request_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type MedicationRequest.', exception.message + end + + it 'succeeds when a MedicationRequest resource is read successfully' do + medication_request = FHIR::MedicationRequest.new( + id: @medication_request_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'MedicationRequest', + resource_id: @medication_request_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/MedicationRequest/#{@medication_request_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: medication_request.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb index 1964f3a5b..ed5551690 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Observation') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Observation search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Observation search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Observation") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @observation_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@observation', FHIR::Observation.new(id: @observation_id)) + end + + it 'skips if the Observation read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Observation read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Observation has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Observation resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Observation resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Observation' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Observation.', exception.message + end + + it 'succeeds when a Observation resource is read successfully' do + observation = FHIR::Observation.new( + id: @observation_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: observation.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb index d70d316f4..bbb8bd872 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb @@ -11,12 +11,101 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Organization') @auth_header = { 'Authorization' => "Bearer #{@token}" } end + describe 'resource read test' do + before do + @organization_id = '456' + @test = @sequence_class[:resource_read] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips if the Organization read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Organization read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Organization has been found' do + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Organization references found from the prior searches', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Organization', + resource_id: @organization_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Organization/#{@organization_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Organization', + resource_id: @organization_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Organization/#{@organization_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Organization resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Organization' do + Inferno::Models::ResourceReference.create( + resource_type: 'Organization', + resource_id: @organization_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Organization/#{@organization_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Organization.', exception.message + end + + it 'succeeds when a Organization resource is read successfully' do + organization = FHIR::Organization.new( + id: @organization_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Organization', + resource_id: @organization_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Organization/#{@organization_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: organization.to_json) + + @sequence.run_test(@test) + end + end + describe 'unauthorized search test' do before do @test = @sequence_class[:unauthorized_search] @@ -27,6 +116,15 @@ } end + it 'skips if the Organization search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Organization search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Organization") .with(query: @query) diff --git a/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb index 35f64eeb2..bf6b40460 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Patient') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Patient search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Patient search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Patient") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @patient_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@patient', FHIR::Patient.new(id: @patient_id)) + end + + it 'skips if the Patient read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Patient read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Patient has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Patient resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Patient', + resource_id: @patient_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Patient', + resource_id: @patient_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Patient resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Patient' do + Inferno::Models::ResourceReference.create( + resource_type: 'Patient', + resource_id: @patient_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Observation.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Patient.', exception.message + end + + it 'succeeds when a Patient resource is read successfully' do + patient = FHIR::Patient.new( + id: @patient_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Patient', + resource_id: @patient_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Patient/#{@patient_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: patient.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb index 8e4f96611..27c9b4d5f 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb @@ -11,12 +11,101 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Practitioner') @auth_header = { 'Authorization' => "Bearer #{@token}" } end + describe 'resource read test' do + before do + @practitioner_id = '456' + @test = @sequence_class[:resource_read] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips if the Practitioner read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Practitioner read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Practitioner has been found' do + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Practitioner references found from the prior searches', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Practitioner', + resource_id: @practitioner_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Practitioner/#{@practitioner_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Practitioner', + resource_id: @practitioner_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Practitioner/#{@practitioner_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Practitioner resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Practitioner' do + Inferno::Models::ResourceReference.create( + resource_type: 'Practitioner', + resource_id: @practitioner_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Practitioner/#{@practitioner_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Practitioner.', exception.message + end + + it 'succeeds when a Practitioner resource is read successfully' do + practitioner = FHIR::Practitioner.new( + id: @practitioner_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Practitioner', + resource_id: @practitioner_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Practitioner/#{@practitioner_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: practitioner.to_json) + + @sequence.run_test(@test) + end + end + describe 'unauthorized search test' do before do @test = @sequence_class[:unauthorized_search] @@ -27,6 +116,15 @@ } end + it 'skips if the Practitioner search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Practitioner search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Practitioner") .with(query: @query) diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb index b8114e3ac..3e8e1de66 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb @@ -11,12 +11,101 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'PractitionerRole') @auth_header = { 'Authorization' => "Bearer #{@token}" } end + describe 'resource read test' do + before do + @practitioner_role_id = '456' + @test = @sequence_class[:resource_read] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips if the PractitionerRole read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support PractitionerRole read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no PractitionerRole has been found' do + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No PractitionerRole references found from the prior searches', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'PractitionerRole', + resource_id: @practitioner_role_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/PractitionerRole/#{@practitioner_role_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'PractitionerRole', + resource_id: @practitioner_role_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/PractitionerRole/#{@practitioner_role_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected PractitionerRole resource to be present.', exception.message + end + + it 'fails if the resource returned is not a PractitionerRole' do + Inferno::Models::ResourceReference.create( + resource_type: 'PractitionerRole', + resource_id: @practitioner_role_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/PractitionerRole/#{@practitioner_role_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type PractitionerRole.', exception.message + end + + it 'succeeds when a PractitionerRole resource is read successfully' do + practitioner_role = FHIR::PractitionerRole.new( + id: @practitioner_role_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'PractitionerRole', + resource_id: @practitioner_role_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/PractitionerRole/#{@practitioner_role_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: practitioner_role.to_json) + + @sequence.run_test(@test) + end + end + describe 'unauthorized search test' do before do @test = @sequence_class[:unauthorized_search] @@ -27,6 +116,15 @@ } end + it 'skips if the PractitionerRole search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support PractitionerRole search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/PractitionerRole") .with(query: @query) diff --git a/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb index 9ac7cc1b5..a5e93b122 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Procedure') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Procedure search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Procedure search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Procedure") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @procedure_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@procedure', FHIR::Procedure.new(id: @procedure_id)) + end + + it 'skips if the Procedure read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Procedure read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Procedure has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Procedure resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Procedure', + resource_id: @procedure_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Procedure/#{@procedure_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Procedure', + resource_id: @procedure_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Procedure/#{@procedure_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Procedure resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Procedure' do + Inferno::Models::ResourceReference.create( + resource_type: 'Procedure', + resource_id: @procedure_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Procedure/#{@procedure_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Procedure.', exception.message + end + + it 'succeeds when a Procedure resource is read successfully' do + procedure = FHIR::Procedure.new( + id: @procedure_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Procedure', + resource_id: @procedure_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Procedure/#{@procedure_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: procedure.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_provenance_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_provenance_test.rb new file mode 100644 index 000000000..193a3e5dc --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/us_core_provenance_test.rb @@ -0,0 +1,108 @@ +# frozen_string_literal: true + +# NOTE: This is a generated file. Any changes made to this file will be +# overwritten when it is regenerated + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::USCore310ProvenanceSequence do + before do + @sequence_class = Inferno::Sequence::USCore310ProvenanceSequence + @base_url = 'http://www.example.com/fhir' + @client = FHIR::Client.new(@base_url) + @token = 'ABC' + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') + @patient_id = '123' + @instance.patient_id = @patient_id + set_resource_support(@instance, 'Provenance') + @auth_header = { 'Authorization' => "Bearer #{@token}" } + end + + describe 'resource read test' do + before do + @provenance_id = '456' + @test = @sequence_class[:resource_read] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips if the Provenance read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Provenance read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Provenance has been found' do + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Provenance references found from the prior searches', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Provenance', + resource_id: @provenance_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Provenance/#{@provenance_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Provenance', + resource_id: @provenance_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Provenance/#{@provenance_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Provenance resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Provenance' do + Inferno::Models::ResourceReference.create( + resource_type: 'Provenance', + resource_id: @provenance_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Provenance/#{@provenance_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Provenance.', exception.message + end + + it 'succeeds when a Provenance resource is read successfully' do + provenance = FHIR::Provenance.new( + id: @provenance_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Provenance', + resource_id: @provenance_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Provenance/#{@provenance_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: provenance.to_json) + + @sequence.run_test(@test) + end + end +end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb index b7682ac9b..756cd1e32 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Observation') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Observation search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Observation search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Observation") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @observation_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@observation', FHIR::Observation.new(id: @observation_id)) + end + + it 'skips if the Observation read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Observation read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Observation has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Observation resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Observation resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Observation' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Observation.', exception.message + end + + it 'succeeds when a Observation resource is read successfully' do + observation = FHIR::Observation.new( + id: @observation_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: observation.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb index d69d5a351..358ce545e 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb @@ -11,9 +11,10 @@ @base_url = 'http://www.example.com/fhir' @client = FHIR::Client.new(@base_url) @token = 'ABC' - @instance = Inferno::Models::TestingInstance.create(token: @token) + @instance = Inferno::Models::TestingInstance.create(token: @token, selected_module: 'uscore_v3.1.0') @patient_id = '123' @instance.patient_id = @patient_id + set_resource_support(@instance, 'Observation') @auth_header = { 'Authorization' => "Bearer #{@token}" } end @@ -27,6 +28,15 @@ } end + it 'skips if the Observation search interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Observation search operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + it 'fails when the token refresh response has a success status' do stub_request(:get, "#{@base_url}/Observation") .with(query: @query) @@ -53,4 +63,95 @@ assert_equal 'Do not test if no bearer token set', exception.message end end + + describe 'resource read test' do + before do + @observation_id = '456' + @test = @sequence_class[:read_interaction] + @sequence = @sequence_class.new(@instance, @client) + @sequence.instance_variable_set(:'@resources_found', true) + @sequence.instance_variable_set(:'@observation', FHIR::Observation.new(id: @observation_id)) + end + + it 'skips if the Observation read interaction is not supported' do + @instance.server_capabilities.destroy + @instance.reload + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + skip_message = 'This server does not support Observation read operation(s) according to conformance statement.' + assert_equal skip_message, exception.message + end + + it 'skips if no Observation has been found' do + @sequence.instance_variable_set(:'@resources_found', false) + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No Observation resources could be found for this patient. Please use patients with more information.', exception.message + end + + it 'fails if a non-success response code is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 401) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Bad response code: expected 200, 201, but found 401. ', exception.message + end + + it 'fails if no resource is received' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected Observation resource to be present.', exception.message + end + + it 'fails if the resource returned is not a Observation' do + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: FHIR::Patient.new.to_json) + + exception = assert_raises(Inferno::AssertionException) { @sequence.run_test(@test) } + + assert_equal 'Expected resource to be of type Observation.', exception.message + end + + it 'succeeds when a Observation resource is read successfully' do + observation = FHIR::Observation.new( + id: @observation_id + ) + Inferno::Models::ResourceReference.create( + resource_type: 'Observation', + resource_id: @observation_id, + testing_instance: @instance + ) + + stub_request(:get, "#{@base_url}/Observation/#{@observation_id}") + .with(query: @query, headers: @auth_header) + .to_return(status: 200, body: observation.to_json) + + @sequence.run_test(@test) + end + end end diff --git a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb index 9e44b4a1f..84f875eff 100644 --- a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb @@ -42,8 +42,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:AllergyIntolerance, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) @client.set_bearer_token(@instance.token) @@ -72,10 +75,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @allergyintolerance = reply&.resource&.entry&.first&.resource - @allergyintolerance_ary = fetch_all_bundled_resources(reply&.resource) + @allergy_intolerance = reply&.resource&.entry&.first&.resource + @allergy_intolerance_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('AllergyIntolerance'), reply) - save_delayed_sequence_references(@allergyintolerance_ary) + save_delayed_sequence_references(@allergy_intolerance_ary) validate_search_reply(versioned_resource_class('AllergyIntolerance'), reply, search_params) end @@ -90,7 +93,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@allergyintolerance.nil?, 'Expected valid AllergyIntolerance resource to be present' + assert !@allergy_intolerance.nil?, 'Expected valid AllergyIntolerance resource to be present' search_params = { 'patient': @instance.patient_id, @@ -103,9 +106,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'AllergyIntolerance read resource supported' do + test :read_interaction do metadata do id '04' + name 'AllergyIntolerance read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -113,14 +117,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:AllergyIntolerance, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No AllergyIntolerance resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_read_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) + validate_read_reply(@allergy_intolerance, versioned_resource_class('AllergyIntolerance')) end - test 'AllergyIntolerance vread resource supported' do + test :vread_interaction do metadata do id '05' + name 'AllergyIntolerance vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -128,14 +133,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:AllergyIntolerance, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No AllergyIntolerance resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_vread_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) + validate_vread_reply(@allergy_intolerance, versioned_resource_class('AllergyIntolerance')) end - test 'AllergyIntolerance history resource supported' do + test :history_interaction do metadata do id '06' + name 'AllergyIntolerance history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -143,9 +149,9 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:AllergyIntolerance, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No AllergyIntolerance resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_history_reply(@allergyintolerance, versioned_resource_class('AllergyIntolerance')) + validate_history_reply(@allergy_intolerance, versioned_resource_class('AllergyIntolerance')) end test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do @@ -191,7 +197,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @allergyintolerance_ary&.any? + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @allergy_intolerance_ary&.any? must_support_confirmed = {} must_support_elements = [ 'AllergyIntolerance.clinicalStatus', @@ -200,12 +206,12 @@ def validate_resource_item(resource, property, value) 'AllergyIntolerance.patient' ] must_support_elements.each do |path| - @allergyintolerance_ary&.each do |resource| + @allergy_intolerance_ary&.each do |resource| truncated_path = path.gsub('AllergyIntolerance.', '') must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) break if must_support_confirmed[path] end - resource_count = @allergyintolerance_ary.length + resource_count = @allergy_intolerance_ary.length skip "Could not find #{path} in any of the #{resource_count} provided AllergyIntolerance resource(s)" unless must_support_confirmed[path] end @@ -224,7 +230,7 @@ def validate_resource_item(resource, property, value) skip_if_not_supported(:AllergyIntolerance, [:search, :read]) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - validate_reference_resolutions(@allergyintolerance) + validate_reference_resolutions(@allergy_intolerance) end end end diff --git a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb index 0b76aafde..b39e6a9c1 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -52,8 +52,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:CarePlan, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) @client.set_bearer_token(@instance.token) @@ -83,10 +86,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @careplan = reply&.resource&.entry&.first&.resource - @careplan_ary = fetch_all_bundled_resources(reply&.resource) + @care_plan = reply&.resource&.entry&.first&.resource + @care_plan_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) - save_delayed_sequence_references(@careplan_ary) + save_delayed_sequence_references(@care_plan_ary) validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) end @@ -101,7 +104,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' + assert !@care_plan.nil?, 'Expected valid CarePlan resource to be present' search_params = { 'patient': @instance.patient_id, @@ -134,7 +137,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' + assert !@care_plan.nil?, 'Expected valid CarePlan resource to be present' search_params = { 'patient': @instance.patient_id, @@ -168,7 +171,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@careplan.nil?, 'Expected valid CarePlan resource to be present' + assert !@care_plan.nil?, 'Expected valid CarePlan resource to be present' search_params = { 'patient': @instance.patient_id, @@ -182,9 +185,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'CarePlan read resource supported' do + test :read_interaction do metadata do id '06' + name 'CarePlan read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -192,14 +196,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:CarePlan, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No CarePlan resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_read_reply(@careplan, versioned_resource_class('CarePlan')) + validate_read_reply(@care_plan, versioned_resource_class('CarePlan')) end - test 'CarePlan vread resource supported' do + test :vread_interaction do metadata do id '07' + name 'CarePlan vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -207,14 +212,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:CarePlan, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No CarePlan resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_vread_reply(@careplan, versioned_resource_class('CarePlan')) + validate_vread_reply(@care_plan, versioned_resource_class('CarePlan')) end - test 'CarePlan history resource supported' do + test :history_interaction do metadata do id '08' + name 'CarePlan history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -222,9 +228,9 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:CarePlan, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No CarePlan resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_history_reply(@careplan, versioned_resource_class('CarePlan')) + validate_history_reply(@care_plan, versioned_resource_class('CarePlan')) end test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do @@ -271,7 +277,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careplan_ary&.any? + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @care_plan_ary&.any? must_support_confirmed = {} must_support_elements = [ 'CarePlan.text', @@ -283,12 +289,12 @@ def validate_resource_item(resource, property, value) 'CarePlan.subject' ] must_support_elements.each do |path| - @careplan_ary&.each do |resource| + @care_plan_ary&.each do |resource| truncated_path = path.gsub('CarePlan.', '') must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) break if must_support_confirmed[path] end - resource_count = @careplan_ary.length + resource_count = @care_plan_ary.length skip "Could not find #{path} in any of the #{resource_count} provided CarePlan resource(s)" unless must_support_confirmed[path] end @@ -307,7 +313,7 @@ def validate_resource_item(resource, property, value) skip_if_not_supported(:CarePlan, [:search, :read]) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - validate_reference_resolutions(@careplan) + validate_reference_resolutions(@care_plan) end end end diff --git a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb index 3c47e51e4..add2024d0 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb @@ -42,8 +42,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:CareTeam, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) @client.set_bearer_token(@instance.token) @@ -73,16 +76,17 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @careteam = reply&.resource&.entry&.first&.resource - @careteam_ary = fetch_all_bundled_resources(reply&.resource) + @care_team = reply&.resource&.entry&.first&.resource + @care_team_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) - save_delayed_sequence_references(@careteam_ary) + save_delayed_sequence_references(@care_team_ary) validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) end - test 'CareTeam read resource supported' do + test :read_interaction do metadata do id '03' + name 'CareTeam read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -90,14 +94,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:CareTeam, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No CareTeam resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_read_reply(@careteam, versioned_resource_class('CareTeam')) + validate_read_reply(@care_team, versioned_resource_class('CareTeam')) end - test 'CareTeam vread resource supported' do + test :vread_interaction do metadata do id '04' + name 'CareTeam vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -105,14 +110,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:CareTeam, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No CareTeam resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_vread_reply(@careteam, versioned_resource_class('CareTeam')) + validate_vread_reply(@care_team, versioned_resource_class('CareTeam')) end - test 'CareTeam history resource supported' do + test :history_interaction do metadata do id '05' + name 'CareTeam history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -120,9 +126,9 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:CareTeam, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No CareTeam resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_history_reply(@careteam, versioned_resource_class('CareTeam')) + validate_history_reply(@care_team, versioned_resource_class('CareTeam')) end test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do @@ -169,7 +175,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @careteam_ary&.any? + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @care_team_ary&.any? must_support_confirmed = {} must_support_elements = [ 'CareTeam.status', @@ -179,12 +185,12 @@ def validate_resource_item(resource, property, value) 'CareTeam.participant.member' ] must_support_elements.each do |path| - @careteam_ary&.each do |resource| + @care_team_ary&.each do |resource| truncated_path = path.gsub('CareTeam.', '') must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) break if must_support_confirmed[path] end - resource_count = @careteam_ary.length + resource_count = @care_team_ary.length skip "Could not find #{path} in any of the #{resource_count} provided CareTeam resource(s)" unless must_support_confirmed[path] end @@ -203,7 +209,7 @@ def validate_resource_item(resource, property, value) skip_if_not_supported(:CareTeam, [:search, :read]) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - validate_reference_resolutions(@careteam) + validate_reference_resolutions(@care_team) end end end diff --git a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb index 94085f4ad..c09e2e2cd 100644 --- a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb @@ -56,8 +56,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Condition, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) @client.set_bearer_token(@instance.token) @@ -197,9 +200,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Condition read resource supported' do + test :read_interaction do metadata do id '07' + name 'Condition read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -207,14 +211,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Condition, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Condition resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@condition, versioned_resource_class('Condition')) end - test 'Condition vread resource supported' do + test :vread_interaction do metadata do id '08' + name 'Condition vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -222,14 +227,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Condition, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Condition resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@condition, versioned_resource_class('Condition')) end - test 'Condition history resource supported' do + test :history_interaction do metadata do id '09' + name 'Condition history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -237,7 +243,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Condition, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Condition resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@condition, versioned_resource_class('Condition')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb index cef92f86e..a0ed33e90 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -56,8 +56,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:DiagnosticReport, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @client.set_bearer_token(@instance.token) @@ -86,10 +89,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @diagnosticreport = reply&.resource&.entry&.first&.resource - @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) + @diagnostic_report = reply&.resource&.entry&.first&.resource + @diagnostic_report_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - save_delayed_sequence_references(@diagnosticreport_ary) + save_delayed_sequence_references(@diagnostic_report_ary) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end @@ -103,7 +106,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { 'patient': @instance.patient_id, @@ -126,7 +129,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { 'patient': @instance.patient_id, @@ -158,7 +161,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { 'patient': @instance.patient_id, @@ -181,7 +184,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { 'patient': @instance.patient_id, @@ -205,7 +208,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { 'patient': @instance.patient_id, @@ -227,9 +230,10 @@ def validate_resource_item(resource, property, value) end end - test 'DiagnosticReport create resource supported' do + test :create_interaction do metadata do id '08' + name 'DiagnosticReport create interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -237,14 +241,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DiagnosticReport, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DiagnosticReport resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + validate_create_reply(@diagnostic_report, versioned_resource_class('DiagnosticReport')) end - test 'DiagnosticReport read resource supported' do + test :read_interaction do metadata do id '09' + name 'DiagnosticReport read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -252,14 +257,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DiagnosticReport, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DiagnosticReport resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + validate_read_reply(@diagnostic_report, versioned_resource_class('DiagnosticReport')) end - test 'DiagnosticReport vread resource supported' do + test :vread_interaction do metadata do id '10' + name 'DiagnosticReport vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -267,14 +273,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DiagnosticReport, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DiagnosticReport resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + validate_vread_reply(@diagnostic_report, versioned_resource_class('DiagnosticReport')) end - test 'DiagnosticReport history resource supported' do + test :history_interaction do metadata do id '11' + name 'DiagnosticReport history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -282,9 +289,9 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DiagnosticReport, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DiagnosticReport resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + validate_history_reply(@diagnostic_report, versioned_resource_class('DiagnosticReport')) end test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do @@ -330,7 +337,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnostic_report_ary&.any? must_support_confirmed = {} must_support_elements = [ 'DiagnosticReport.status', @@ -345,12 +352,12 @@ def validate_resource_item(resource, property, value) 'DiagnosticReport.result' ] must_support_elements.each do |path| - @diagnosticreport_ary&.each do |resource| + @diagnostic_report_ary&.each do |resource| truncated_path = path.gsub('DiagnosticReport.', '') must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) break if must_support_confirmed[path] end - resource_count = @diagnosticreport_ary.length + resource_count = @diagnostic_report_ary.length skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] end @@ -369,7 +376,7 @@ def validate_resource_item(resource, property, value) skip_if_not_supported(:DiagnosticReport, [:search, :read]) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - validate_reference_resolutions(@diagnosticreport) + validate_reference_resolutions(@diagnostic_report) end end end diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb index 92651b528..3ea5c0042 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -56,8 +56,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:DiagnosticReport, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @client.set_bearer_token(@instance.token) @@ -86,10 +89,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @diagnosticreport = reply&.resource&.entry&.first&.resource - @diagnosticreport_ary = fetch_all_bundled_resources(reply&.resource) + @diagnostic_report = reply&.resource&.entry&.first&.resource + @diagnostic_report_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - save_delayed_sequence_references(@diagnosticreport_ary) + save_delayed_sequence_references(@diagnostic_report_ary) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end @@ -103,7 +106,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { 'patient': @instance.patient_id, @@ -126,7 +129,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { 'patient': @instance.patient_id, @@ -158,7 +161,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { 'patient': @instance.patient_id, @@ -181,7 +184,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { 'patient': @instance.patient_id, @@ -205,7 +208,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@diagnosticreport.nil?, 'Expected valid DiagnosticReport resource to be present' + assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { 'patient': @instance.patient_id, @@ -227,9 +230,10 @@ def validate_resource_item(resource, property, value) end end - test 'DiagnosticReport create resource supported' do + test :create_interaction do metadata do id '08' + name 'DiagnosticReport create interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -237,14 +241,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DiagnosticReport, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DiagnosticReport resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_create_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + validate_create_reply(@diagnostic_report, versioned_resource_class('DiagnosticReport')) end - test 'DiagnosticReport read resource supported' do + test :read_interaction do metadata do id '09' + name 'DiagnosticReport read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -252,14 +257,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DiagnosticReport, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DiagnosticReport resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_read_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + validate_read_reply(@diagnostic_report, versioned_resource_class('DiagnosticReport')) end - test 'DiagnosticReport vread resource supported' do + test :vread_interaction do metadata do id '10' + name 'DiagnosticReport vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -267,14 +273,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DiagnosticReport, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DiagnosticReport resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_vread_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + validate_vread_reply(@diagnostic_report, versioned_resource_class('DiagnosticReport')) end - test 'DiagnosticReport history resource supported' do + test :history_interaction do metadata do id '11' + name 'DiagnosticReport history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -282,9 +289,9 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DiagnosticReport, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DiagnosticReport resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_history_reply(@diagnosticreport, versioned_resource_class('DiagnosticReport')) + validate_history_reply(@diagnostic_report, versioned_resource_class('DiagnosticReport')) end test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do @@ -330,7 +337,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnosticreport_ary&.any? + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @diagnostic_report_ary&.any? must_support_confirmed = {} must_support_elements = [ 'DiagnosticReport.status', @@ -345,12 +352,12 @@ def validate_resource_item(resource, property, value) 'DiagnosticReport.presentedForm' ] must_support_elements.each do |path| - @diagnosticreport_ary&.each do |resource| + @diagnostic_report_ary&.each do |resource| truncated_path = path.gsub('DiagnosticReport.', '') must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) break if must_support_confirmed[path] end - resource_count = @diagnosticreport_ary.length + resource_count = @diagnostic_report_ary.length skip "Could not find #{path} in any of the #{resource_count} provided DiagnosticReport resource(s)" unless must_support_confirmed[path] end @@ -369,7 +376,7 @@ def validate_resource_item(resource, property, value) skip_if_not_supported(:DiagnosticReport, [:search, :read]) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - validate_reference_resolutions(@diagnosticreport) + validate_reference_resolutions(@diagnostic_report) end end end diff --git a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb index e75edcf0d..b878c07b8 100644 --- a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb @@ -64,8 +64,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:DocumentReference, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @client.set_bearer_token(@instance.token) @@ -94,10 +97,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @documentreference = reply&.resource&.entry&.first&.resource - @documentreference_ary = fetch_all_bundled_resources(reply&.resource) + @document_reference = reply&.resource&.entry&.first&.resource + @document_reference_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('DocumentReference'), reply) - save_delayed_sequence_references(@documentreference_ary) + save_delayed_sequence_references(@document_reference_ary) validate_search_reply(versioned_resource_class('DocumentReference'), reply, search_params) end @@ -111,7 +114,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + assert !@document_reference.nil?, 'Expected valid DocumentReference resource to be present' search_params = { '_id': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'id')) @@ -133,7 +136,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + assert !@document_reference.nil?, 'Expected valid DocumentReference resource to be present' search_params = { 'patient': @instance.patient_id, @@ -156,7 +159,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + assert !@document_reference.nil?, 'Expected valid DocumentReference resource to be present' search_params = { 'patient': @instance.patient_id, @@ -180,7 +183,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + assert !@document_reference.nil?, 'Expected valid DocumentReference resource to be present' search_params = { 'patient': @instance.patient_id, @@ -204,7 +207,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + assert !@document_reference.nil?, 'Expected valid DocumentReference resource to be present' search_params = { 'patient': @instance.patient_id, @@ -237,7 +240,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@documentreference.nil?, 'Expected valid DocumentReference resource to be present' + assert !@document_reference.nil?, 'Expected valid DocumentReference resource to be present' search_params = { 'patient': @instance.patient_id, @@ -250,9 +253,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'DocumentReference create resource supported' do + test :create_interaction do metadata do id '09' + name 'DocumentReference create interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -260,14 +264,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DocumentReference, [:create]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DocumentReference resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_create_reply(@documentreference, versioned_resource_class('DocumentReference')) + validate_create_reply(@document_reference, versioned_resource_class('DocumentReference')) end - test 'DocumentReference read resource supported' do + test :read_interaction do metadata do id '10' + name 'DocumentReference read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -275,14 +280,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DocumentReference, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DocumentReference resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_read_reply(@documentreference, versioned_resource_class('DocumentReference')) + validate_read_reply(@document_reference, versioned_resource_class('DocumentReference')) end - test 'DocumentReference vread resource supported' do + test :vread_interaction do metadata do id '11' + name 'DocumentReference vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -290,14 +296,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DocumentReference, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DocumentReference resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_vread_reply(@documentreference, versioned_resource_class('DocumentReference')) + validate_vread_reply(@document_reference, versioned_resource_class('DocumentReference')) end - test 'DocumentReference history resource supported' do + test :history_interaction do metadata do id '12' + name 'DocumentReference history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -305,9 +312,9 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:DocumentReference, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No DocumentReference resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_history_reply(@documentreference, versioned_resource_class('DocumentReference')) + validate_history_reply(@document_reference, versioned_resource_class('DocumentReference')) end test 'Server returns the appropriate resources from the following _revincludes: Provenance:target' do @@ -353,7 +360,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @documentreference_ary&.any? + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @document_reference_ary&.any? must_support_confirmed = {} must_support_elements = [ 'DocumentReference.identifier', @@ -375,12 +382,12 @@ def validate_resource_item(resource, property, value) 'DocumentReference.context.period' ] must_support_elements.each do |path| - @documentreference_ary&.each do |resource| + @document_reference_ary&.each do |resource| truncated_path = path.gsub('DocumentReference.', '') must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) break if must_support_confirmed[path] end - resource_count = @documentreference_ary.length + resource_count = @document_reference_ary.length skip "Could not find #{path} in any of the #{resource_count} provided DocumentReference resource(s)" unless must_support_confirmed[path] end @@ -399,7 +406,7 @@ def validate_resource_item(resource, property, value) skip_if_not_supported(:DocumentReference, [:search, :read]) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - validate_reference_resolutions(@documentreference) + validate_reference_resolutions(@document_reference) end end end diff --git a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb index 54a8b65b7..3cfca80b6 100644 --- a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb @@ -64,8 +64,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Encounter, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @client.set_bearer_token(@instance.token) @@ -249,9 +252,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Encounter read resource supported' do + test :read_interaction do metadata do id '09' + name 'Encounter read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -259,14 +263,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Encounter, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Encounter resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@encounter, versioned_resource_class('Encounter')) end - test 'Encounter vread resource supported' do + test :vread_interaction do metadata do id '10' + name 'Encounter vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -274,14 +279,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Encounter, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Encounter resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@encounter, versioned_resource_class('Encounter')) end - test 'Encounter history resource supported' do + test :history_interaction do metadata do id '11' + name 'Encounter history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -289,7 +295,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Encounter, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Encounter resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@encounter, versioned_resource_class('Encounter')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb index 964590d3b..ac70143e3 100644 --- a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb @@ -48,8 +48,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Goal, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) @client.set_bearer_token(@instance.token) @@ -141,9 +144,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Goal read resource supported' do + test :read_interaction do metadata do id '05' + name 'Goal read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -151,14 +155,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Goal, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Goal resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@goal, versioned_resource_class('Goal')) end - test 'Goal vread resource supported' do + test :vread_interaction do metadata do id '06' + name 'Goal vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -166,14 +171,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Goal, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Goal resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@goal, versioned_resource_class('Goal')) end - test 'Goal history resource supported' do + test :history_interaction do metadata do id '07' + name 'Goal history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -181,7 +187,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Goal, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Goal resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@goal, versioned_resource_class('Goal')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb index 4363beed2..0bc5a0d30 100644 --- a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb @@ -48,8 +48,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Immunization, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) @client.set_bearer_token(@instance.token) @@ -141,9 +144,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Immunization read resource supported' do + test :read_interaction do metadata do id '05' + name 'Immunization read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -151,14 +155,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Immunization, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Immunization resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@immunization, versioned_resource_class('Immunization')) end - test 'Immunization vread resource supported' do + test :vread_interaction do metadata do id '06' + name 'Immunization vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -166,14 +171,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Immunization, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Immunization resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@immunization, versioned_resource_class('Immunization')) end - test 'Immunization history resource supported' do + test :history_interaction do metadata do id '07' + name 'Immunization history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -181,7 +187,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Immunization, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Immunization resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@immunization, versioned_resource_class('Immunization')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb index 7a813a48c..aa6ea7023 100644 --- a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb @@ -42,8 +42,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Device, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Device'), search_params) @client.set_bearer_token(@instance.token) @@ -103,9 +106,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Device read resource supported' do + test :read_interaction do metadata do id '04' + name 'Device read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -113,14 +117,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Device, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Device resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@device, versioned_resource_class('Device')) end - test 'Device vread resource supported' do + test :vread_interaction do metadata do id '05' + name 'Device vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -128,14 +133,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Device, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Device resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@device, versioned_resource_class('Device')) end - test 'Device history resource supported' do + test :history_interaction do metadata do id '06' + name 'Device history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -143,7 +149,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Device, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Device resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@device, versioned_resource_class('Device')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb index 652449e63..a133f935c 100644 --- a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb @@ -61,11 +61,17 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Location, [:read]) + location_id = @instance.resource_references.find { |reference| reference.resource_type == 'Location' }&.resource_id skip 'No Location references found from the prior searches' if location_id.nil? - @location = fetch_resource('Location', location_id) - @location_ary = Array.wrap(@location) - @resources_found = !@location.nil? + + @location = validate_read_reply( + FHIR::Location.new(id: location_id), + FHIR::Location + ) + @location_ary = Array.wrap(@location).compact + @resources_found = @location.present? end test :unauthorized_search do @@ -78,8 +84,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Location, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Location'), search_params) @client.set_bearer_token(@instance.token) @@ -207,9 +216,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Location vread resource supported' do + test :vread_interaction do metadata do id '08' + name 'Location vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -217,14 +227,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Location, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Location resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@location, versioned_resource_class('Location')) end - test 'Location history resource supported' do + test :history_interaction do metadata do id '09' + name 'Location history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -232,7 +243,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Location, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Location resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@location, versioned_resource_class('Location')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb index 186daf708..58f54e25e 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb @@ -29,16 +29,23 @@ class USCore310MedicationSequence < SequenceBase versions :r4 end + skip_if_not_supported(:Medication, [:read]) + medication_id = @instance.resource_references.find { |reference| reference.resource_type == 'Medication' }&.resource_id skip 'No Medication references found from the prior searches' if medication_id.nil? - @medication = fetch_resource('Medication', medication_id) - @medication_ary = Array.wrap(@medication) - @resources_found = !@medication.nil? + + @medication = validate_read_reply( + FHIR::Medication.new(id: medication_id), + FHIR::Medication + ) + @medication_ary = Array.wrap(@medication).compact + @resources_found = @medication.present? end - test 'Medication vread resource supported' do + test :vread_interaction do metadata do id '02' + name 'Medication vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -46,14 +53,15 @@ class USCore310MedicationSequence < SequenceBase end skip_if_not_supported(:Medication, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Medication resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@medication, versioned_resource_class('Medication')) end - test 'Medication history resource supported' do + test :history_interaction do metadata do id '03' + name 'Medication history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -61,7 +69,7 @@ class USCore310MedicationSequence < SequenceBase end skip_if_not_supported(:Medication, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Medication resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@medication, versioned_resource_class('Medication')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb index 092621806..7db8a399b 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb @@ -54,8 +54,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:MedicationRequest, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) @client.set_bearer_token(@instance.token) @@ -82,11 +85,11 @@ def validate_resource_item(resource, property, value) @resources_found = true if resource_count.positive? next unless @resources_found - @medicationrequest = reply&.resource&.entry&.first&.resource - @medicationrequest_ary = fetch_all_bundled_resources(reply&.resource) + @medication_request = reply&.resource&.entry&.first&.resource + @medication_request_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('MedicationRequest'), reply) - save_delayed_sequence_references(@medicationrequest_ary) + save_delayed_sequence_references(@medication_request_ary) validate_search_reply(versioned_resource_class('MedicationRequest'), reply, search_params) break end @@ -103,7 +106,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' + assert !@medication_request.nil?, 'Expected valid MedicationRequest resource to be present' search_params = { 'patient': @instance.patient_id, @@ -128,7 +131,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' + assert !@medication_request.nil?, 'Expected valid MedicationRequest resource to be present' search_params = { 'patient': @instance.patient_id, @@ -153,7 +156,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@medicationrequest.nil?, 'Expected valid MedicationRequest resource to be present' + assert !@medication_request.nil?, 'Expected valid MedicationRequest resource to be present' search_params = { 'patient': @instance.patient_id, @@ -167,9 +170,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'MedicationRequest read resource supported' do + test :read_interaction do metadata do id '06' + name 'MedicationRequest read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -177,14 +181,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:MedicationRequest, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No MedicationRequest resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_read_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) + validate_read_reply(@medication_request, versioned_resource_class('MedicationRequest')) end - test 'MedicationRequest vread resource supported' do + test :vread_interaction do metadata do id '07' + name 'MedicationRequest vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -192,14 +197,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:MedicationRequest, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No MedicationRequest resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_vread_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) + validate_vread_reply(@medication_request, versioned_resource_class('MedicationRequest')) end - test 'MedicationRequest history resource supported' do + test :history_interaction do metadata do id '08' + name 'MedicationRequest history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -207,9 +213,9 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:MedicationRequest, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No MedicationRequest resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_history_reply(@medicationrequest, versioned_resource_class('MedicationRequest')) + validate_history_reply(@medication_request, versioned_resource_class('MedicationRequest')) end test 'Server returns the appropriate resource from the following _includes: MedicationRequest:medication' do @@ -280,7 +286,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medicationrequest_ary&.any? + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @medication_request_ary&.any? must_support_confirmed = {} must_support_elements = [ 'MedicationRequest.status', @@ -297,12 +303,12 @@ def validate_resource_item(resource, property, value) 'MedicationRequest.dosageInstruction.text' ] must_support_elements.each do |path| - @medicationrequest_ary&.each do |resource| + @medication_request_ary&.each do |resource| truncated_path = path.gsub('MedicationRequest.', '') must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) break if must_support_confirmed[path] end - resource_count = @medicationrequest_ary.length + resource_count = @medication_request_ary.length skip "Could not find #{path} in any of the #{resource_count} provided MedicationRequest resource(s)" unless must_support_confirmed[path] end @@ -321,7 +327,7 @@ def validate_resource_item(resource, property, value) skip_if_not_supported(:MedicationRequest, [:search, :read]) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - validate_reference_resolutions(@medicationrequest) + validate_reference_resolutions(@medication_request) end end end diff --git a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb index f818b10c9..9ca24bc22 100644 --- a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb @@ -56,8 +56,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Observation, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) @@ -207,9 +210,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Observation read resource supported' do + test :read_interaction do metadata do id '07' + name 'Observation read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -217,14 +221,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation vread resource supported' do + test :vread_interaction do metadata do id '08' + name 'Observation vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -232,14 +237,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation history resource supported' do + test :history_interaction do metadata do id '09' + name 'Observation history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -247,7 +253,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@observation, versioned_resource_class('Observation')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb index c8da58b2a..467ef9512 100644 --- a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb @@ -49,11 +49,17 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Organization, [:read]) + organization_id = @instance.resource_references.find { |reference| reference.resource_type == 'Organization' }&.resource_id skip 'No Organization references found from the prior searches' if organization_id.nil? - @organization = fetch_resource('Organization', organization_id) - @organization_ary = Array.wrap(@organization) - @resources_found = !@organization.nil? + + @organization = validate_read_reply( + FHIR::Organization.new(id: organization_id), + FHIR::Organization + ) + @organization_ary = Array.wrap(@organization).compact + @resources_found = @organization.present? end test :unauthorized_search do @@ -66,8 +72,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Organization, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) @client.set_bearer_token(@instance.token) @@ -126,9 +135,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Organization vread resource supported' do + test :vread_interaction do metadata do id '05' + name 'Organization vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -136,14 +146,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Organization, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Organization resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@organization, versioned_resource_class('Organization')) end - test 'Organization history resource supported' do + test :history_interaction do metadata do id '06' + name 'Organization history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -151,7 +162,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Organization, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Organization resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@organization, versioned_resource_class('Organization')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb index 182430d92..ca5e00f0a 100644 --- a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb @@ -71,8 +71,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Patient, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @client.set_bearer_token(@instance.token) @@ -246,9 +249,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Patient read resource supported' do + test :read_interaction do metadata do id '09' + name 'Patient read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -256,14 +260,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Patient, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Patient resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@patient, versioned_resource_class('Patient')) end - test 'Patient vread resource supported' do + test :vread_interaction do metadata do id '10' + name 'Patient vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -271,14 +276,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Patient, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Patient resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@patient, versioned_resource_class('Patient')) end - test 'Patient history resource supported' do + test :history_interaction do metadata do id '11' + name 'Patient history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -286,7 +292,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Patient, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Patient resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@patient, versioned_resource_class('Patient')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb index 09456762e..506e8e36b 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb @@ -50,11 +50,17 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Practitioner, [:read]) + practitioner_id = @instance.resource_references.find { |reference| reference.resource_type == 'Practitioner' }&.resource_id skip 'No Practitioner references found from the prior searches' if practitioner_id.nil? - @practitioner = fetch_resource('Practitioner', practitioner_id) - @practitioner_ary = Array.wrap(@practitioner) - @resources_found = !@practitioner.nil? + + @practitioner = validate_read_reply( + FHIR::Practitioner.new(id: practitioner_id), + FHIR::Practitioner + ) + @practitioner_ary = Array.wrap(@practitioner).compact + @resources_found = @practitioner.present? end test :unauthorized_search do @@ -67,8 +73,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Practitioner, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) @client.set_bearer_token(@instance.token) @@ -127,9 +136,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Practitioner vread resource supported' do + test :vread_interaction do metadata do id '05' + name 'Practitioner vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -137,14 +147,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Practitioner, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Practitioner resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@practitioner, versioned_resource_class('Practitioner')) end - test 'Practitioner history resource supported' do + test :history_interaction do metadata do id '06' + name 'Practitioner history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -152,7 +163,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Practitioner, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Practitioner resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@practitioner, versioned_resource_class('Practitioner')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb index bc9da6686..71c30e2d9 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb @@ -43,11 +43,17 @@ def validate_resource_item(resource, property, value) versions :r4 end - practitionerrole_id = @instance.resource_references.find { |reference| reference.resource_type == 'PractitionerRole' }&.resource_id - skip 'No PractitionerRole references found from the prior searches' if practitionerrole_id.nil? - @practitionerrole = fetch_resource('PractitionerRole', practitionerrole_id) - @practitionerrole_ary = Array.wrap(@practitionerrole) - @resources_found = !@practitionerrole.nil? + skip_if_not_supported(:PractitionerRole, [:read]) + + practitioner_role_id = @instance.resource_references.find { |reference| reference.resource_type == 'PractitionerRole' }&.resource_id + skip 'No PractitionerRole references found from the prior searches' if practitioner_role_id.nil? + + @practitioner_role = validate_read_reply( + FHIR::PractitionerRole.new(id: practitioner_role_id), + FHIR::PractitionerRole + ) + @practitioner_role_ary = Array.wrap(@practitioner_role).compact + @resources_found = @practitioner_role.present? end test :unauthorized_search do @@ -60,8 +66,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:PractitionerRole, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) @client.set_bearer_token(@instance.token) @@ -91,10 +100,10 @@ def validate_resource_item(resource, property, value) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - @practitionerrole = reply&.resource&.entry&.first&.resource - @practitionerrole_ary = fetch_all_bundled_resources(reply&.resource) + @practitioner_role = reply&.resource&.entry&.first&.resource + @practitioner_role_ary = fetch_all_bundled_resources(reply&.resource) save_resource_ids_in_bundle(versioned_resource_class('PractitionerRole'), reply) - save_delayed_sequence_references(@practitionerrole_ary) + save_delayed_sequence_references(@practitioner_role_ary) validate_search_reply(versioned_resource_class('PractitionerRole'), reply, search_params) end @@ -108,7 +117,7 @@ def validate_resource_item(resource, property, value) end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - assert !@practitionerrole.nil?, 'Expected valid PractitionerRole resource to be present' + assert !@practitioner_role.nil?, 'Expected valid PractitionerRole resource to be present' search_params = { 'practitioner': get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'practitioner')) @@ -120,9 +129,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'PractitionerRole vread resource supported' do + test :vread_interaction do metadata do id '05' + name 'PractitionerRole vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -130,14 +140,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:PractitionerRole, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No PractitionerRole resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_vread_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) + validate_vread_reply(@practitioner_role, versioned_resource_class('PractitionerRole')) end - test 'PractitionerRole history resource supported' do + test :history_interaction do metadata do id '06' + name 'PractitionerRole history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -145,9 +156,9 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:PractitionerRole, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No PractitionerRole resources could be found for this patient. Please use patients with more information.' unless @resources_found - validate_history_reply(@practitionerrole, versioned_resource_class('PractitionerRole')) + validate_history_reply(@practitioner_role, versioned_resource_class('PractitionerRole')) end test 'Server returns the appropriate resource from the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner' do @@ -223,7 +234,7 @@ def validate_resource_item(resource, property, value) versions :r4 end - skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitionerrole_ary&.any? + skip 'No resources appear to be available for this patient. Please use patients with more information' unless @practitioner_role_ary&.any? must_support_confirmed = {} must_support_elements = [ 'PractitionerRole.practitioner', @@ -237,12 +248,12 @@ def validate_resource_item(resource, property, value) 'PractitionerRole.endpoint' ] must_support_elements.each do |path| - @practitionerrole_ary&.each do |resource| + @practitioner_role_ary&.each do |resource| truncated_path = path.gsub('PractitionerRole.', '') must_support_confirmed[path] = true if can_resolve_path(resource, truncated_path) break if must_support_confirmed[path] end - resource_count = @practitionerrole_ary.length + resource_count = @practitioner_role_ary.length skip "Could not find #{path} in any of the #{resource_count} provided PractitionerRole resource(s)" unless must_support_confirmed[path] end @@ -261,7 +272,7 @@ def validate_resource_item(resource, property, value) skip_if_not_supported(:PractitionerRole, [:search, :read]) skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - validate_reference_resolutions(@practitionerrole) + validate_reference_resolutions(@practitioner_role) end end end diff --git a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb index 5e49b5670..80203e627 100644 --- a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb @@ -52,8 +52,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Procedure, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) @client.set_bearer_token(@instance.token) @@ -177,9 +180,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Procedure read resource supported' do + test :read_interaction do metadata do id '06' + name 'Procedure read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -187,14 +191,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Procedure, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Procedure resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@procedure, versioned_resource_class('Procedure')) end - test 'Procedure vread resource supported' do + test :vread_interaction do metadata do id '07' + name 'Procedure vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -202,14 +207,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Procedure, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Procedure resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@procedure, versioned_resource_class('Procedure')) end - test 'Procedure history resource supported' do + test :history_interaction do metadata do id '08' + name 'Procedure history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -217,7 +223,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Procedure, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Procedure resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@procedure, versioned_resource_class('Procedure')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb index 91e9eb73d..1313536dd 100644 --- a/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb @@ -29,16 +29,23 @@ class USCore310ProvenanceSequence < SequenceBase versions :r4 end + skip_if_not_supported(:Provenance, [:read]) + provenance_id = @instance.resource_references.find { |reference| reference.resource_type == 'Provenance' }&.resource_id skip 'No Provenance references found from the prior searches' if provenance_id.nil? - @provenance = fetch_resource('Provenance', provenance_id) - @provenance_ary = Array.wrap(@provenance) - @resources_found = !@provenance.nil? + + @provenance = validate_read_reply( + FHIR::Provenance.new(id: provenance_id), + FHIR::Provenance + ) + @provenance_ary = Array.wrap(@provenance).compact + @resources_found = @provenance.present? end - test 'Provenance vread resource supported' do + test :vread_interaction do metadata do id '02' + name 'Provenance vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -46,14 +53,15 @@ class USCore310ProvenanceSequence < SequenceBase end skip_if_not_supported(:Provenance, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Provenance resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@provenance, versioned_resource_class('Provenance')) end - test 'Provenance history resource supported' do + test :history_interaction do metadata do id '03' + name 'Provenance history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -61,7 +69,7 @@ class USCore310ProvenanceSequence < SequenceBase end skip_if_not_supported(:Provenance, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Provenance resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@provenance, versioned_resource_class('Provenance')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb index 6626cb590..33679a9fc 100644 --- a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb @@ -56,8 +56,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Observation, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) @@ -207,9 +210,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Observation read resource supported' do + test :read_interaction do metadata do id '07' + name 'Observation read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -217,14 +221,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation vread resource supported' do + test :vread_interaction do metadata do id '08' + name 'Observation vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -232,14 +237,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation history resource supported' do + test :history_interaction do metadata do id '09' + name 'Observation history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -247,7 +253,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@observation, versioned_resource_class('Observation')) end diff --git a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb index 2ed4baf10..27d354ce5 100644 --- a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb @@ -56,8 +56,11 @@ def validate_resource_item(resource, property, value) versions :r4 end + skip_if_not_supported(:Observation, [:search]) + @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? + search_params = { patient: @instance.patient_id } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) @@ -207,9 +210,10 @@ def validate_resource_item(resource, property, value) assert_response_ok(reply) end - test 'Observation read resource supported' do + test :read_interaction do metadata do id '07' + name 'Observation read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -217,14 +221,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:read]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_read_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation vread resource supported' do + test :vread_interaction do metadata do id '08' + name 'Observation vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -232,14 +237,15 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:vread]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_vread_reply(@observation, versioned_resource_class('Observation')) end - test 'Observation history resource supported' do + test :history_interaction do metadata do id '09' + name 'Observation history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( ) @@ -247,7 +253,7 @@ def validate_resource_item(resource, property, value) end skip_if_not_supported(:Observation, [:history]) - skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found + skip 'No Observation resources could be found for this patient. Please use patients with more information.' unless @resources_found validate_history_reply(@observation, versioned_resource_class('Observation')) end From 4fcebf0f78d2b33f898e5adde9a15920a8d992c7 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 19 Nov 2019 09:48:34 -0500 Subject: [PATCH 124/173] update read unit test descriptions Co-Authored-By: Reece Adamson <41651655+radamson@users.noreply.github.com> --- .../uscore/templates/unit_tests/resource_read_unit_test.rb.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb index f315f4d63..5382d0973 100644 --- a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb @@ -1,4 +1,4 @@ -describe 'resource read test' do +describe '<%= resource_type %> read test' do before do @<%= resource_var_name %>_id = '456' @test = @sequence_class[:<%= key %>] From 625c7de67a9de6b4a9152d4daeb1f93df372b150 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 19 Nov 2019 09:53:55 -0500 Subject: [PATCH 125/173] rename key to test_key --- .../unit_tests/authorization_unit_test.rb.erb | 2 +- .../unit_tests/resource_read_unit_test.rb.erb | 2 +- .../uscore/us_core_unit_test_generator.rb | 8 ++++---- generator/uscore/uscore_generator.rb | 18 +++++++++--------- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb index 39cce48df..a324ded1c 100644 --- a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb @@ -1,6 +1,6 @@ describe 'unauthorized search test' do before do - @test = @sequence_class[:<%= key %>] + @test = @sequence_class[:<%= test_key %>] @sequence = @sequence_class.new(@instance, @client) <% if dynamic_search_params.present? %> <% dynamic_search_params.each do |_param, search_param| %> diff --git a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb index 5382d0973..69453d056 100644 --- a/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/resource_read_unit_test.rb.erb @@ -1,7 +1,7 @@ describe '<%= resource_type %> read test' do before do @<%= resource_var_name %>_id = '456' - @test = @sequence_class[:<%= key %>] + @test = @sequence_class[:<%= test_key %>] @sequence = @sequence_class.new(@instance, @client) <% if interaction_test %>@sequence.instance_variable_set(:'@resources_found', true) @sequence.instance_variable_set(:'@<%= resource_var_name %>', FHIR::<%= resource_type %>.new(id: @<%= resource_var_name %>_id)) diff --git a/generator/uscore/us_core_unit_test_generator.rb b/generator/uscore/us_core_unit_test_generator.rb index 1f225d1a7..22af6d5b0 100644 --- a/generator/uscore/us_core_unit_test_generator.rb +++ b/generator/uscore/us_core_unit_test_generator.rb @@ -26,10 +26,10 @@ def generate(sequence, path, module_name) File.write(file_name, unit_tests) end - def generate_authorization_test(key:, resource_type:, search_params:, class_name:) + def generate_authorization_test(test_key:, resource_type:, search_params:, class_name:) template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'authorization_unit_test.rb.erb'))) test = template.result_with_hash( - key: key, + test_key: test_key, resource_type: resource_type, search_param_string: search_params_to_string(search_params), dynamic_search_params: dynamic_search_params(search_params) @@ -37,12 +37,12 @@ def generate_authorization_test(key:, resource_type:, search_params:, class_name tests[class_name] << test end - def generate_resource_read_test(key:, resource_type:, class_name:, interaction_test: false) + def generate_resource_read_test(test_key:, resource_type:, class_name:, interaction_test: false) template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'resource_read_unit_test.rb.erb'))) resource_var_name = resource_type.underscore test = template.result_with_hash( - key: key, + test_key: test_key, resource_type: resource_type, resource_var_name: resource_var_name, interaction_test: interaction_test, diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index e15efbb53..cece78037 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -104,10 +104,10 @@ def generate_sequence(sequence) end def create_read_test(sequence) - key = :resource_read + test_key = :resource_read read_test = { tests_that: "Can read #{sequence[:resource]} from the server", - key: key, + key: test_key, index: sequence[:tests].length + 1, link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' } @@ -127,17 +127,17 @@ def create_read_test(sequence) sequence[:tests] << read_test unit_test_generator.generate_resource_read_test( - key: key, + test_key: test_key, resource_type: sequence[:resource], class_name: sequence[:class_name] ) end def create_authorization_test(sequence) - key = :unauthorized_search + test_key = :unauthorized_search authorization_test = { tests_that: "Server rejects #{sequence[:resource]} search without authorization", - key: key, + key: test_key, index: sequence[:tests].length + 1, link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' } @@ -159,7 +159,7 @@ def create_authorization_test(sequence) sequence[:tests] << authorization_test unit_test_generator.generate_authorization_test( - key: key, + test_key: test_key, resource_type: sequence[:resource], search_params: { patient: '@instance.patient_id' }, class_name: sequence[:class_name] @@ -241,10 +241,10 @@ def create_search_test(sequence, search_param) end def create_interaction_test(sequence, interaction) - key = :"#{interaction[:code]}_interaction" + test_key = :"#{interaction[:code]}_interaction" interaction_test = { tests_that: "#{sequence[:resource]} #{interaction[:code]} interaction supported", - key: key, + key: test_key, index: sequence[:tests].length + 1, link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' } @@ -259,7 +259,7 @@ def create_interaction_test(sequence, interaction) if interaction[:code] == 'read' # rubocop:disable Style/GuardClause unit_test_generator.generate_resource_read_test( - key: key, + test_key: test_key, resource_type: sequence[:resource], class_name: sequence[:class_name], interaction_test: true From cf2e3664e079056e840b78741664cc0afca2f025 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 19 Nov 2019 09:54:09 -0500 Subject: [PATCH 126/173] regenerate us core sequences --- lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb | 2 +- .../uscore_v3.1.0/test/pediatric_weight_for_height_test.rb | 2 +- .../uscore_v3.1.0/test/us_core_allergyintolerance_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb | 2 +- .../uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb | 2 +- .../uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb | 2 +- .../uscore_v3.1.0/test/us_core_documentreference_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb | 2 +- .../uscore_v3.1.0/test/us_core_implantable_device_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_location_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_medication_test.rb | 2 +- .../uscore_v3.1.0/test/us_core_medicationrequest_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_provenance_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb | 2 +- 25 files changed, 25 insertions(+), 25 deletions(-) diff --git a/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb b/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb index 2d0527dba..9ecb2bb24 100644 --- a/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb +++ b/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Observation read test' do before do @observation_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb b/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb index 46c4ecda0..3afcdc779 100644 --- a/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb +++ b/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Observation read test' do before do @observation_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb index 793f04151..6ddaeab9a 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_allergyintolerance_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'AllergyIntolerance read test' do before do @allergy_intolerance_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb index 51cb44227..39978b592 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'CarePlan read test' do before do @care_plan_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb index be0e8c271..322b3e5cc 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'CareTeam read test' do before do @care_team_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb index 3f42bf10a..dce55897d 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_condition_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Condition read test' do before do @condition_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb index 3ef1fbd5f..d6c78bf6a 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'DiagnosticReport read test' do before do @diagnostic_report_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb index 72f6f860a..b19fa63e8 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'DiagnosticReport read test' do before do @diagnostic_report_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb index 649eed303..3669d2b90 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_documentreference_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'DocumentReference read test' do before do @document_reference_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb index 2345f8a5a..4b1ea1e3b 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_encounter_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Encounter read test' do before do @encounter_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb index e78e4371c..5409e4256 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_goal_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Goal read test' do before do @goal_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb index 755797c42..1c2be6294 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_immunization_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Immunization read test' do before do @immunization_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb index 03c16b846..a3f4bc22b 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_implantable_device_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Device read test' do before do @device_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb index b7c71b808..5a0b5ad9f 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb @@ -18,7 +18,7 @@ @auth_header = { 'Authorization' => "Bearer #{@token}" } end - describe 'resource read test' do + describe 'Location read test' do before do @location_id = '456' @test = @sequence_class[:resource_read] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_medication_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_medication_test.rb index 756e11d97..440c2be93 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_medication_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_medication_test.rb @@ -18,7 +18,7 @@ @auth_header = { 'Authorization' => "Bearer #{@token}" } end - describe 'resource read test' do + describe 'Medication read test' do before do @medication_id = '456' @test = @sequence_class[:resource_read] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb index b2dbf4cb0..7b3d815d7 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'MedicationRequest read test' do before do @medication_request_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb index ed5551690..31bcfad76 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Observation read test' do before do @observation_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb index bbb8bd872..bc2ccf771 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb @@ -18,7 +18,7 @@ @auth_header = { 'Authorization' => "Bearer #{@token}" } end - describe 'resource read test' do + describe 'Organization read test' do before do @organization_id = '456' @test = @sequence_class[:resource_read] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb index bf6b40460..6789fa998 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Patient read test' do before do @patient_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb index 27c9b4d5f..bbb73442f 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb @@ -18,7 +18,7 @@ @auth_header = { 'Authorization' => "Bearer #{@token}" } end - describe 'resource read test' do + describe 'Practitioner read test' do before do @practitioner_id = '456' @test = @sequence_class[:resource_read] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb index 3e8e1de66..9999e248d 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb @@ -18,7 +18,7 @@ @auth_header = { 'Authorization' => "Bearer #{@token}" } end - describe 'resource read test' do + describe 'PractitionerRole read test' do before do @practitioner_role_id = '456' @test = @sequence_class[:resource_read] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb index a5e93b122..44d783d09 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_procedure_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Procedure read test' do before do @procedure_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_provenance_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_provenance_test.rb index 193a3e5dc..8fc8d4220 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_provenance_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_provenance_test.rb @@ -18,7 +18,7 @@ @auth_header = { 'Authorization' => "Bearer #{@token}" } end - describe 'resource read test' do + describe 'Provenance read test' do before do @provenance_id = '456' @test = @sequence_class[:resource_read] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb index 756cd1e32..3eeed265d 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Observation read test' do before do @observation_id = '456' @test = @sequence_class[:read_interaction] diff --git a/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb index 358ce545e..db4acecb0 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb @@ -64,7 +64,7 @@ end end - describe 'resource read test' do + describe 'Observation read test' do before do @observation_id = '456' @test = @sequence_class[:read_interaction] From 40db0fa858d6dba8657ae676cac1f9c2bb56dffa Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 20 Nov 2019 10:44:51 -0600 Subject: [PATCH 127/173] Add test for invalid content-type --- .../bulk_data_authorization_sequence.rb | 20 +++++++++-- .../test/authorization_sequence_test.rb | 33 ++++++++++++++++++- 2 files changed, 49 insertions(+), 4 deletions(-) diff --git a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb index 70054a6b3..548b3e707 100644 --- a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb @@ -11,7 +11,7 @@ class BulkDataAuthorizationSequence < SequenceBase description 'Test Bulk Data Authorization Token Endpoint' - def authorize + def authorize(content_type: 'application/x-www-form-urlencoded') id_token = JSON::JWT.new( iss: @instance.client_id, sub: @instance.client_id, @@ -36,7 +36,7 @@ def authorize header = { - content_type: 'application/x-www-form-urlencoded', + content_type: content_type, accept: 'application/json' } @@ -47,9 +47,23 @@ def authorize response end - test :return_access_token do + test :require_content_type do metadata do id '01' + name 'Bulk Data authorization request shall use content type application/x-www-form-urlencoded' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' + description %( + After generating an authentication JWT, the client requests a new access token via HTTP POST to the FHIR authorization server’s token endpoint URL, using content-type application/x-www-form-urlencoded + ) + end + + response = authorize(content_type: 'application/json') + assert_response_bad_or_unauthorized(response) + end + + test :return_access_token do + metadata do + id '02' name 'Bulk Data Token Endpoint shall return access token' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#issuing-access-tokens' description %( diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index 1639d4f6a..81357787c 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -24,13 +24,44 @@ } end + describe 'require correct content-type' do + before do + @test = @sequence_class[:require_content_type] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'pass with incorrect content-type' do + stub_request(:post, @instance.oauth_token_endpoint) + .with(headers: { content_type: 'application/json' }) + .to_return( + status: 400 + ) + + @sequence.run_test(@test) + end + + it 'fail with correct content-type' do + stub_request(:post, @instance.oauth_token_endpoint) + .with(headers: { content_type: 'application/json' }) + .to_return( + status: 200 + ) + + error = assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + + assert_match(/^Bad response code/, error.message) + end + end + describe 'return access token tests' do before do @test = @sequence_class[:return_access_token] @sequence = @sequence_class.new(@instance, @client) end - it 'success when server returns access token' do + it 'pass when server returns access token' do stub_request(:post, @instance.oauth_token_endpoint) .to_return( status: 200, From 360100790347d024daa789937dd2e4a357e7b867 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 20 Nov 2019 11:48:21 -0600 Subject: [PATCH 128/173] Add test for grant_type --- .../bulk_data_authorization_sequence.rb | 41 ++++++++++-- .../test/authorization_sequence_test.rb | 62 ++++++++++++++++++- 2 files changed, 96 insertions(+), 7 deletions(-) diff --git a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb index 548b3e707..033ae8f5f 100644 --- a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb @@ -11,7 +11,9 @@ class BulkDataAuthorizationSequence < SequenceBase description 'Test Bulk Data Authorization Token Endpoint' - def authorize(content_type: 'application/x-www-form-urlencoded') + def authorize(content_type: 'application/x-www-form-urlencoded', + scope: 'system/*.read', + grant_type: 'client_credentials') id_token = JSON::JWT.new( iss: @instance.client_id, sub: @instance.client_id, @@ -28,8 +30,8 @@ def authorize(content_type: 'application/x-www-form-urlencoded') payload = { - 'scope' => 'system/*.read', - 'grant_type' => 'client_credentials', + 'scope' => scope, + 'grant_type' => grant_type, 'client_assertion_type' => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', 'client_assertion' => client_assertion.to_s } @@ -50,7 +52,7 @@ def authorize(content_type: 'application/x-www-form-urlencoded') test :require_content_type do metadata do id '01' - name 'Bulk Data authorization request shall use content type application/x-www-form-urlencoded' + name 'Bulk Data authorization request shall use content_type "application/x-www-form-urlencoded"' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( After generating an authentication JWT, the client requests a new access token via HTTP POST to the FHIR authorization server’s token endpoint URL, using content-type application/x-www-form-urlencoded @@ -61,9 +63,38 @@ def authorize(content_type: 'application/x-www-form-urlencoded') assert_response_bad_or_unauthorized(response) end - test :return_access_token do + test :require_system_scope do metadata do id '02' + name 'Bulk Data authorization request shall use "system" scope' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#scopes' + description %( + clients SHALL use “system” scopes. + System scopes have the format system/(:resourceType|*).(read|write|*) + ) + end + + response = authorize(scope: 'user/*.read') + assert_response_bad_or_unauthorized(response) + end + + test :require_grant_type do + metadata do + id '03' + name 'Bulk Data authorization request shall use grand_type "client_credentials"' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' + description %( + grant_type required Fixed value: client_credentials + ) + end + + response = authorize(grant_type: 'invalid_grant_type') + assert_response_bad_or_unauthorized(response) + end + + test :return_access_token do + metadata do + id '04' name 'Bulk Data Token Endpoint shall return access token' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#issuing-access-tokens' description %( diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index 81357787c..f964a46a6 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -30,7 +30,7 @@ @sequence = @sequence_class.new(@instance, @client) end - it 'pass with incorrect content-type' do + it 'pass with status code 400' do stub_request(:post, @instance.oauth_token_endpoint) .with(headers: { content_type: 'application/json' }) .to_return( @@ -40,7 +40,7 @@ @sequence.run_test(@test) end - it 'fail with correct content-type' do + it 'fail with status code 200' do stub_request(:post, @instance.oauth_token_endpoint) .with(headers: { content_type: 'application/json' }) .to_return( @@ -55,6 +55,64 @@ end end + describe 'require system scope' do + before do + @test = @sequence_class[:require_system_scope] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'pass with status code 400' do + stub_request(:post, @instance.oauth_token_endpoint) + .to_return( + status: 400 + ) + + @sequence.run_test(@test) + end + + it 'fail with status code 200' do + stub_request(:post, @instance.oauth_token_endpoint) + .to_return( + status: 200 + ) + + error = assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + + assert_match(/^Bad response code/, error.message) + end + end + + describe 'require grant type' do + before do + @test = @sequence_class[:require_grant_type] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'pass with stastus code 400' do + stub_request(:post, @instance.oauth_token_endpoint) + .to_return( + status: 400 + ) + + @sequence.run_test(@test) + end + + it 'fail with status code 200' do + stub_request(:post, @instance.oauth_token_endpoint) + .to_return( + status: 200 + ) + + error = assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + + assert_match(/^Bad response code/, error.message) + end + end + describe 'return access token tests' do before do @test = @sequence_class[:return_access_token] From a0a783a7e5c08bb6b7eb35e84b2e3488207d8adf Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 20 Nov 2019 11:49:42 -0600 Subject: [PATCH 129/173] fix rubocop --- .../bulk_data/bulk_data_authorization_sequence.rb | 10 +++++----- .../bulk_data/test/authorization_sequence_test.rb | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb index 033ae8f5f..9a0a5dfb9 100644 --- a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb @@ -12,8 +12,8 @@ class BulkDataAuthorizationSequence < SequenceBase description 'Test Bulk Data Authorization Token Endpoint' def authorize(content_type: 'application/x-www-form-urlencoded', - scope: 'system/*.read', - grant_type: 'client_credentials') + scope: 'system/*.read', + grant_type: 'client_credentials') id_token = JSON::JWT.new( iss: @instance.client_id, sub: @instance.client_id, @@ -69,14 +69,14 @@ def authorize(content_type: 'application/x-www-form-urlencoded', name 'Bulk Data authorization request shall use "system" scope' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#scopes' description %( - clients SHALL use “system” scopes. + clients SHALL use “system” scopes. System scopes have the format system/(:resourceType|*).(read|write|*) ) end response = authorize(scope: 'user/*.read') assert_response_bad_or_unauthorized(response) - end + end test :require_grant_type do metadata do @@ -90,7 +90,7 @@ def authorize(content_type: 'application/x-www-form-urlencoded', response = authorize(grant_type: 'invalid_grant_type') assert_response_bad_or_unauthorized(response) - end + end test :return_access_token do metadata do diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index f964a46a6..bf4b438fd 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -111,7 +111,7 @@ assert_match(/^Bad response code/, error.message) end - end + end describe 'return access token tests' do before do From c743cb9ec719ad12ee9549109a5c08211db60aa6 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Wed, 20 Nov 2019 16:13:34 -0500 Subject: [PATCH 130/173] Update lib/app/utils/logged_rest_client.rb Co-Authored-By: Stephen MacVicar --- lib/app/utils/logged_rest_client.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/app/utils/logged_rest_client.rb b/lib/app/utils/logged_rest_client.rb index f1ad29306..ad70b5234 100644 --- a/lib/app/utils/logged_rest_client.rb +++ b/lib/app/utils/logged_rest_client.rb @@ -15,7 +15,7 @@ def self.requests def self.record_response(request, response) # You can call this directly with a hash # If intercepted from RestClient it will use a class - reply = if response.class == Hash + reply = if response.instance_of? Hash { code: response[:code], headers: response[:headers], From 46a39ca36075b1ad40a3c2e95751f33be3bb7255 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Wed, 20 Nov 2019 16:13:52 -0500 Subject: [PATCH 131/173] Update generator/bdt/bdt_generator.rb Co-Authored-By: Stephen MacVicar --- generator/bdt/bdt_generator.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/generator/bdt/bdt_generator.rb b/generator/bdt/bdt_generator.rb index ff253814e..bd4250d4c 100644 --- a/generator/bdt/bdt_generator.rb +++ b/generator/bdt/bdt_generator.rb @@ -21,7 +21,9 @@ def generate metadata = extract_metadata(revised_structure) - metadata[:groups].map { |g| g[:sequences] }.flatten.each { |s| generate_sequence(s) } + metadata[:groups] + .flat_map { |group| group[:sequences] } + .each { |sequence| generate_sequence(sequence) } generate_module(metadata) copy_base end From 5a7a24e5875cac545dbf799cbb0100389b6e51d1 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 21 Nov 2019 08:13:22 -0500 Subject: [PATCH 132/173] refactor complex bdt generator methods --- generator/bdt/bdt_generator.rb | 79 ++++++++++++++++------------------ 1 file changed, 37 insertions(+), 42 deletions(-) diff --git a/generator/bdt/bdt_generator.rb b/generator/bdt/bdt_generator.rb index bd4250d4c..b6a0bbec0 100644 --- a/generator/bdt/bdt_generator.rb +++ b/generator/bdt/bdt_generator.rb @@ -48,45 +48,37 @@ def generate_module(module_info) end def extract_metadata(source) - metadata = { + { name: 'test', - groups: [] + groups: source['children'].map { |group| new_group(group) } } + end - source['children'].each do |group| - new_group = { - name: group['name'], - sequences: [] - } - - group['children'].each do |sequence| - new_sequence = { - name: sequence['name'], - description: BDT_DESCRIPTIONS[sequence['name']], - tests: [] - } - - sequence['children'].each do |test| - new_test = { - name: clean_test_name(test['name']), - path: test['path'], - id: test['id'], - description: test['description'] - } - - new_sequence[:tests] << new_test - end - - new_sequence[:id] = new_sequence[:tests].first&.dig(:id)&.split('-')&.first - new_sequence[:sequence_class_name] = 'BDT' + new_sequence[:id].split('_').map(&:capitalize).join + 'Sequence' - - new_group[:sequences] << new_sequence - end + def new_group(group_metadata) + { + name: group_metadata['name'], + sequences: group_metadata['children'].map { |sequence| new_sequence(sequence) } + } + end - metadata[:groups] << new_group + def new_sequence(sequence_metadata) + { + name: sequence_metadata['name'], + description: BDT_DESCRIPTIONS[sequence_metadata['name']], + tests: sequence_metadata['children'].map { |test| new_test(test) } + }.tap do |sequence| + sequence[:id] = sequence[:tests].first&.dig(:id)&.split('-')&.first + sequence[:sequence_class_name] = 'BDT' + sequence[:id].camelize + 'Sequence' end + end - metadata + def new_test(test_metadata) + { + name: clean_test_name(test_metadata['name']), + path: test_metadata['path'], + id: test_metadata['id'], + description: test_metadata['description'] + } end def copy_base @@ -98,18 +90,21 @@ def copy_base # This organizes into a single bulk data group # With a sequence per def revise_structure_sequence(structure) - bulk = { 'name' => 'Bulk Data Test', 'type' => 'group', 'children' => [] } - - structure['children'].each do |seq_level| - tests = [] - seq_level['children'].each do |test_level| - tests.concat(collapse_sequence(test_level)) + sequences = structure['children'].map do |sequence| + sequence['children'] = sequence['children'].flat_map do |tests| + collapse_sequence(tests) end - seq_level['children'] = tests - bulk['children'] << seq_level + sequence end - structure['children'] = [bulk] + structure['children'] = [ + { + 'name' => 'Bulk Data Test', + 'type' => 'group', + 'children' => sequences + } + ] + structure end From a8ce9c6badcceb50d8806218497333c392970808 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 21 Nov 2019 08:17:10 -0500 Subject: [PATCH 133/173] remove commented code --- generator/bdt/templates/bdt_base.rb | 19 ------------------- lib/app/endpoint/home.rb | 7 ------- lib/modules/bdt/bdt_base.rb | 19 ------------------- 3 files changed, 45 deletions(-) diff --git a/generator/bdt/templates/bdt_base.rb b/generator/bdt/templates/bdt_base.rb index a121a6561..5ca8a601d 100644 --- a/generator/bdt/templates/bdt_base.rb +++ b/generator/bdt/templates/bdt_base.rb @@ -56,12 +56,6 @@ class BDTBase < SequenceBase } }.freeze - # "succeeded" - # "failed" - # "waiting" - # "not-implemented" - # "not-supported" - def settings { 'baseURL' => @instance.bulk_url, @@ -99,18 +93,6 @@ def run_bdt(path) assert false, warning end end - # request = { - # method: :post, - # url: url, - # headers: headers, - # payload: payload - # } - # response = { - # code: response.code, - # headers: response.headers, - # body: response.body - # } - # LoggedRestClient.record_response() requests = {} @@ -122,7 +104,6 @@ def run_bdt(path) headers: value['headers'], payload: value['body'] } - # binding.pry if value['method'] == 'POST' requests['request_' + key.chomp('Request').strip] = last_request end diff --git a/lib/app/endpoint/home.rb b/lib/app/endpoint/home.rb index 2fb74830b..8d6f05d70 100644 --- a/lib/app/endpoint/home.rb +++ b/lib/app/endpoint/home.rb @@ -46,13 +46,6 @@ class Home < Endpoint @instance.send("#{key}=", value) if @instance.respond_to?("#{key}=") end - # preset = JSON.parse(params['preset']) unless params['preset'].nil? - # @instance.client_id = preset['client_id'] unless preset['client_id'].nil? - # @instance.scopes = preset['scopes'] unless preset['scopes'].nil? - # unless preset['client_secret'].nil? - # @instance.confidential_client = true - # @instance.client_secret = preset['client_secret'] - # end end @instance.initiate_login_uri = "#{request.base_url}#{base_path}/oauth2/#{@instance.client_endpoint_key}/launch" diff --git a/lib/modules/bdt/bdt_base.rb b/lib/modules/bdt/bdt_base.rb index a121a6561..5ca8a601d 100644 --- a/lib/modules/bdt/bdt_base.rb +++ b/lib/modules/bdt/bdt_base.rb @@ -56,12 +56,6 @@ class BDTBase < SequenceBase } }.freeze - # "succeeded" - # "failed" - # "waiting" - # "not-implemented" - # "not-supported" - def settings { 'baseURL' => @instance.bulk_url, @@ -99,18 +93,6 @@ def run_bdt(path) assert false, warning end end - # request = { - # method: :post, - # url: url, - # headers: headers, - # payload: payload - # } - # response = { - # code: response.code, - # headers: response.headers, - # body: response.body - # } - # LoggedRestClient.record_response() requests = {} @@ -122,7 +104,6 @@ def run_bdt(path) headers: value['headers'], payload: value['body'] } - # binding.pry if value['method'] == 'POST' requests['request_' + key.chomp('Request').strip] = last_request end From 8910be35c4b3f48b2ba6e66f0833971857f7b290 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 21 Nov 2019 08:18:18 -0500 Subject: [PATCH 134/173] add bdt sequences to .gitattributes --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 67fa9b319..e6b108939 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ lib/modules/uscore_v*/* linguist-generated=true +lib/modules/bdt/* linguist-generated=true resources/terminology/validators/* linguist-generated=true From 2da754fa87e2aaa686332c8150742f3367bcfe2f Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Thu, 21 Nov 2019 09:08:31 -0600 Subject: [PATCH 135/173] change expiration from 1 hour to 5 minutes --- lib/modules/bulk_data/bulk_data_authorization_sequence.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb index 9a0a5dfb9..5745abfa4 100644 --- a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb @@ -18,7 +18,7 @@ def authorize(content_type: 'application/x-www-form-urlencoded', iss: @instance.client_id, sub: @instance.client_id, aud: @instance.oauth_token_endpoint, - exp: 1.hour.from_now, + exp: 5.minute.from_now, jti: SecureRandom.hex(32) ) From 75aa7c25de92fd655ce1e34912cbf03ede9fa782 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 21 Nov 2019 09:26:39 -0500 Subject: [PATCH 136/173] replace remaining instances of downcase with underscore --- generator/uscore/uscore_generator.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index cece78037..081fecbb4 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -177,7 +177,7 @@ def create_include_test(sequence) include_test[:test_code] = search_params sequence[:include_params].each do |include| resource_name = include.split(':').last.capitalize - resource_variable = "#{resource_name.downcase}_results" # kind of a hack, but works for now - would have to otherwise figure out resource type of target profile + resource_variable = "#{resource_name.underscore}_results" # kind of a hack, but works for now - would have to otherwise figure out resource type of target profile include_test[:test_code] += %( search_params['_include'] = '#{include}' reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) @@ -201,7 +201,7 @@ def create_revinclude_test(sequence) revinclude_test[:test_code] = search_params sequence[:revincludes].each do |revinclude| resource_name = revinclude.split(':').first - resource_variable = "#{resource_name.downcase}_results" + resource_variable = "#{resource_name.underscore}_results" revinclude_test[:test_code] += %( search_params['_revinclude'] = '#{revinclude}' reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) @@ -360,7 +360,7 @@ def create_references_resolved_test(sequence) def resolve_element_path(search_param_description) element_path = search_param_description[:path].gsub('.class', '.local_class') # match fhir_models because class is protected keyword in ruby path_parts = element_path.split('.') - resource_val = "@#{path_parts.shift.downcase}_ary" + resource_val = "@#{path_parts.shift.underscore}_ary" "get_value_for_search_param(resolve_element_from_path(#{resource_val}, '#{path_parts.join('.')}'))" end From 90677563b40367aadb9204ddbd65207f707ef4b8 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Thu, 21 Nov 2019 09:27:31 -0500 Subject: [PATCH 137/173] regenerate us core sequences --- .../us_core_allergyintolerance_sequence.rb | 2 +- .../uscore_v3.1.0/us_core_careplan_sequence.rb | 14 +++++++------- .../us_core_diagnosticreport_lab_sequence.rb | 12 ++++++------ .../us_core_diagnosticreport_note_sequence.rb | 12 ++++++------ .../us_core_documentreference_sequence.rb | 16 ++++++++-------- .../us_core_medicationrequest_sequence.rb | 16 ++++++++-------- .../us_core_practitionerrole_sequence.rb | 8 ++++---- 7 files changed, 40 insertions(+), 40 deletions(-) diff --git a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb index 84f875eff..430062f75 100644 --- a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb @@ -97,7 +97,7 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'clinical-status': get_value_for_search_param(resolve_element_from_path(@allergyintolerance_ary, 'clinicalStatus')) + 'clinical-status': get_value_for_search_param(resolve_element_from_path(@allergy_intolerance_ary, 'clinicalStatus')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb index b39e6a9c1..b66d370ad 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -108,8 +108,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) + 'category': get_value_for_search_param(resolve_element_from_path(@care_plan_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@care_plan_ary, 'period')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -141,9 +141,9 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')), - 'status': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')), - 'date': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'period')) + 'category': get_value_for_search_param(resolve_element_from_path(@care_plan_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@care_plan_ary, 'status')), + 'date': get_value_for_search_param(resolve_element_from_path(@care_plan_ary, 'period')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -175,8 +175,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'category')), - 'status': get_value_for_search_param(resolve_element_from_path(@careplan_ary, 'status')) + 'category': get_value_for_search_param(resolve_element_from_path(@care_plan_ary, 'category')), + 'status': get_value_for_search_param(resolve_element_from_path(@care_plan_ary, 'status')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb index a0ed33e90..8e4796404 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -110,7 +110,7 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) + 'code': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'code')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -133,8 +133,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + 'category': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'effectiveDateTime')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -188,7 +188,7 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'status': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) + 'status': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'status')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -212,8 +212,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + 'code': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'effectiveDateTime')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb index 3ea5c0042..476138d9d 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -110,7 +110,7 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')) + 'code': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'code')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -133,8 +133,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + 'category': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'effectiveDateTime')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -188,7 +188,7 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'status': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'status')) + 'status': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'status')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -212,8 +212,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'code')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnosticreport_ary, 'effectiveDateTime')) + 'code': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'code')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'effectiveDateTime')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb index b878c07b8..da01607f6 100644 --- a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb @@ -117,7 +117,7 @@ def validate_resource_item(resource, property, value) assert !@document_reference.nil?, 'Expected valid DocumentReference resource to be present' search_params = { - '_id': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'id')) + '_id': get_value_for_search_param(resolve_element_from_path(@document_reference_ary, 'id')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -140,7 +140,7 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'type': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')) + 'type': get_value_for_search_param(resolve_element_from_path(@document_reference_ary, 'type')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -163,8 +163,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'date')) + 'category': get_value_for_search_param(resolve_element_from_path(@document_reference_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@document_reference_ary, 'date')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -187,7 +187,7 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'category')) + 'category': get_value_for_search_param(resolve_element_from_path(@document_reference_ary, 'category')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -211,8 +211,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'type': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'type')), - 'period': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'context.period')) + 'type': get_value_for_search_param(resolve_element_from_path(@document_reference_ary, 'type')), + 'period': get_value_for_search_param(resolve_element_from_path(@document_reference_ary, 'context.period')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -244,7 +244,7 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'status': get_value_for_search_param(resolve_element_from_path(@documentreference_ary, 'status')) + 'status': get_value_for_search_param(resolve_element_from_path(@document_reference_ary, 'status')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb index 7db8a399b..e0be3b071 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb @@ -110,8 +110,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'intent': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')), - 'status': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'status')) + 'intent': get_value_for_search_param(resolve_element_from_path(@medication_request_ary, 'intent')), + 'status': get_value_for_search_param(resolve_element_from_path(@medication_request_ary, 'status')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -135,8 +135,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'intent': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')), - 'encounter': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'encounter')) + 'intent': get_value_for_search_param(resolve_element_from_path(@medication_request_ary, 'intent')), + 'encounter': get_value_for_search_param(resolve_element_from_path(@medication_request_ary, 'encounter')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -160,8 +160,8 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'intent': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')), - 'authoredon': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'authoredOn')) + 'intent': get_value_for_search_param(resolve_element_from_path(@medication_request_ary, 'intent')), + 'authoredon': get_value_for_search_param(resolve_element_from_path(@medication_request_ary, 'authoredOn')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -229,7 +229,7 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'intent': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + 'intent': get_value_for_search_param(resolve_element_from_path(@medication_request_ary, 'intent')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -252,7 +252,7 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'intent': get_value_for_search_param(resolve_element_from_path(@medicationrequest_ary, 'intent')) + 'intent': get_value_for_search_param(resolve_element_from_path(@medication_request_ary, 'intent')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } diff --git a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb index 71c30e2d9..f1981db67 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb @@ -87,7 +87,7 @@ def validate_resource_item(resource, property, value) end search_params = { - 'specialty': get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + 'specialty': get_value_for_search_param(resolve_element_from_path(@practitioner_role_ary, 'specialty')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -120,7 +120,7 @@ def validate_resource_item(resource, property, value) assert !@practitioner_role.nil?, 'Expected valid PractitionerRole resource to be present' search_params = { - 'practitioner': get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'practitioner')) + 'practitioner': get_value_for_search_param(resolve_element_from_path(@practitioner_role_ary, 'practitioner')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -171,7 +171,7 @@ def validate_resource_item(resource, property, value) end search_params = { - 'specialty': get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + 'specialty': get_value_for_search_param(resolve_element_from_path(@practitioner_role_ary, 'specialty')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } @@ -200,7 +200,7 @@ def validate_resource_item(resource, property, value) end search_params = { - 'specialty': get_value_for_search_param(resolve_element_from_path(@practitionerrole_ary, 'specialty')) + 'specialty': get_value_for_search_param(resolve_element_from_path(@practitioner_role_ary, 'specialty')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } From 21dfdea72533561a7d80caa8dc71344debf5b0db Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Thu, 21 Nov 2019 14:54:53 -0600 Subject: [PATCH 138/173] Added all tests for authorization --- .../bulk_data_authorization_sequence.rb | 188 ++++++++++++++++-- ...bulk_data_capability_statement_sequence.rb | 1 + .../test/authorization_sequence_test.rb | 113 ++++++----- 3 files changed, 228 insertions(+), 74 deletions(-) diff --git a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb index 5745abfa4..af676490a 100644 --- a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb @@ -11,36 +11,43 @@ class BulkDataAuthorizationSequence < SequenceBase description 'Test Bulk Data Authorization Token Endpoint' - def authorize(content_type: 'application/x-www-form-urlencoded', + def authorize(bulk_private_key: @instance.bulk_private_key, + content_type: 'application/x-www-form-urlencoded', scope: 'system/*.read', - grant_type: 'client_credentials') + grant_type: 'client_credentials', + client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', + iss: @instance.client_id, + sub: @instance.client_id, + aud: @instance.oauth_token_endpoint, + exp: 5.minutes.from_now, + jti: SecureRandom.hex(32)) id_token = JSON::JWT.new( - iss: @instance.client_id, - sub: @instance.client_id, - aud: @instance.oauth_token_endpoint, - exp: 5.minute.from_now, - jti: SecureRandom.hex(32) - ) + iss: iss, + sub: sub, + aud: aud, + exp: exp, + jti: jti + ).compact - jwk = JSON::JWK.new(JSON.parse(@instance.bulk_private_key)) + jwk = JSON::JWK.new(JSON.parse(bulk_private_key)) id_token.header[:kid] = jwk['kid'] - private_key = jwk.to_key - client_assertion = id_token.sign(private_key, 'RS384') + jwk_private_key = jwk.to_key + client_assertion = id_token.sign(jwk_private_key, 'RS384') payload = { 'scope' => scope, 'grant_type' => grant_type, - 'client_assertion_type' => 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', + 'client_assertion_type' => client_assertion_type, 'client_assertion' => client_assertion.to_s - } + }.compact header = { content_type: content_type, accept: 'application/json' - } + }.compact uri = Addressable::URI.new uri.query_values = payload @@ -70,6 +77,7 @@ def authorize(content_type: 'application/x-www-form-urlencoded', link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#scopes' description %( clients SHALL use “system” scopes. + System scopes have the format system/(:resourceType|*).(read|write|*) ) end @@ -84,21 +92,160 @@ def authorize(content_type: 'application/x-www-form-urlencoded', name 'Bulk Data authorization request shall use grand_type "client_credentials"' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( - grant_type required Fixed value: client_credentials + * grant_type required Fixed value: client_credentials ) end - response = authorize(grant_type: 'invalid_grant_type') + response = authorize(grant_type: 'not_a_grant_type') assert_response_bad_or_unauthorized(response) end - test :return_access_token do + test :require_client_assertion_type do metadata do id '04' + name 'Bulk Data authorization request shall use client_assertion_type "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' + description %( + * client_assertion_type required Fixed value: urn:ietf:params:oauth:client-assertion-type:jwt-bearer + ) + end + + response = authorize(client_assertion_type: 'not_a_assertion_type') + assert_response_bad_or_unauthorized(response) + end + + test :require_jwt_iss do + metadata do + id '05' + name 'Bulk Data authorization request shall use client_id as JWT issuer ' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' + description %( + * iss required Issuer of the JWT -- the client's client_id, as determined during registration with the FHIR authorization server (note that this is the same as the value for the sub claim) + ) + end + + response = authorize(iss: 'not_a_iss') + assert_response_bad_or_unauthorized(response) + end + + test :require_jwt_sub do + metadata do + id '06' + name 'Bulk Data authorization request shall use client_id as JWT subject ' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' + description %( + * sub required The service's client_id, as determined during registration with the FHIR authorization server (note that this is the same as the value for the iss claim) + ) + end + + response = authorize(sub: 'not_a_sub') + assert_response_bad_or_unauthorized(response) + end + + test :require_jwt_aud do + metadata do + id '07' + name 'Bulk Data authorization request shall use token url as JWT audience ' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' + description %( + * aud required The FHIR authorization server's "token URL" (the same URL to which this authentication JWT will be posted ) + ) + end + + response = authorize(aud: 'not_a_token_url') + assert_response_bad_or_unauthorized(response) + end + + test :require_jwt_exp do + metadata do + id '08' + name 'Bulk Data authorization request shall have JWT expiration time' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' + description %( + * exp required Expiration time integer for this authentication JWT, expressed in seconds since the "Epoch" (1970-01-01T00:00:00Z UTC). This time SHALL be no more than five minutes in the future. + ) + end + + response = authorize(exp: nil) + assert_response_bad_or_unauthorized(response) + end + + test :require_jwt_exp_value do + metadata do + id '09' + name 'Bulk Data authorization request shall have JWT expiration time no more than 5 minutes in the future' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' + description %( + * exp required Expiration time integer for this authentication JWT, expressed in seconds since the "Epoch" (1970-01-01T00:00:00Z UTC). This time SHALL be no more than five minutes in the future. + ) + end + + response = authorize(exp: 10.minutes.from_now) + assert_response_bad_or_unauthorized(response) + end + + test :require_jwt_jti do + metadata do + id '10' + name 'Bulk Data authorization request shall have JWT ID' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' + description %( + * jti required A nonce string value that uniquely identifies this authentication JWT. + ) + end + + response = authorize(jti: nil) + assert_response_bad_or_unauthorized(response) + end + + test :correct_signature do + metadata do + id '10' + name 'Bulk Data authorization request shall be signed by client private key' + link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' + description %( + The authentication JWT SHALL include the following claims, and SHALL be signed with the client’s private key + + The EHR’s authorization server SHALL validate the JWT according to the processing requirements defined in Section 3 of RFC7523 including validation of the signature on the JWT. + ) + end + + invalid_private_key = { + "kty": 'RSA', + "alg": 'RS384', + "n": 'yh9VjpVXyYWKEg8pwCLWtvIcqxCFn5-6iTmm_ocqmfmJ7hb2S_RWIHNyTea6LlnWP_FaL46WQYI0SgSIaos3C8pxxskrMWJQkqra0w8rjJhL3D-avvVf5Mugv6rUYboFbRlTmqGmwQl1lCm5wJEcwFwFis2phf8Xydjdoo2HxP8q94zfCrZt1zXrHpqMLMaN8Hc-Zuuq2vZmqEfsiwxdCBPvfHJTj3ht10MC7HPrJc9T5LiAaaxaQUVzM91Q85z7wQcdIGSjr3MJJuyWhD-z878AXH49K_eft_S-B8Uotu9jwLZqNyk7_in1PeJYBVB-SyKRNa9dBuQc5TvFNqVT2Q', + "e": 'AQAB', + "d": 'x88wEhMaxJIpyu6IdHM8VYCEzKs5nXIWwl9m8YmHmM1yCBdVBgMWPWBDKDWl6fpPbcjXQdowObRQordWcBUNpq9LyJrIAzrQsh0K08jUYVmQ7LtH6-zADnsqfy-OYsm1YYO-_Uc-hOgn_v88rNwHUzXlGLF1G4zw5E5p068b_6YKtVFhmQpdvbvrAg55pAlCpQzOKYwqepJgG1BPQz0ta6ymYWIiPsDpr02VkkfEeIOV24ymCPfu9vayEfxGdHyN4NWE3xRujBXONVBemsAMU0tFxuN-vBZklM9Pqv803kILpHTC9L9OFkzisY-7P5bahErhIiLJUeHeeZnGTi0cXQ', + "p": '6_Lg8H29uGVQjmhRgmwzQ-Q__ybRbKIlIf7ieyHrAmIIbT8LtQlPCEzCFnflz_j5hoRq0DbvpLEZYcMjiJnGXrDxhInwOWPf-2eo5jGJtm64bkT8xBEZ5A6SWadAO9Dmy9KMoB136mQpiEHqYvLLg7E-RVAUKkw2LspYcZB6-r8', + "q": '20yOKIYq1lQBP48DqA88iIm9DINNhz66tfxEfWu4fjAsku0wbFRqsidw0XW1I6BHgrCnRLSev_m9Rj-MjpcUyZsEsGqSuVhXDOWocS_eZapkTD79ugU2P_lMT0qErlF5Bfmg7kUByTJODyDrpT2hAX7q-wb77029ANlCDugWz2c', + "dp": 'k1x-tlSiAB9uv3JRrfYr0nQksBOraoCeVmwdQS_-2d8mSiy9ABVPQezGr0e0xT5HgYcEOwSEiUR-iLtaXv9DkHJMdS29VeqVwiuMpjA8RS9DisMVZtMTa4baSpoVmQYwjw3x_DJLaZ2i_tHENIZVKuuw65NG9N_iWzjPIiZNWHs', + "dq": 'LFSNaCO3BRx2JCME2jQ6SF-Pl7fzNCO6Go-kSLY91URnvku0PjHSX7EZXT4uH8WGrySGq5zXendBi7HM-AYSba6ohAEHJ_BzqGfEZR0IGAUZwU_6emATV1tN0bl-mL5feJW9smzAr6s7nFNLT1vl8Cd32MbQps9QJZvFfr3r3oE', + "qi": 'H45gESn1kzqIjLqf1iiESlXb-04s_rLO43BCN-57LMIPckAW4AQPx4bq4-58Jig_U3h6eJX7-2W4QP3UyyGHPIBQH7HaCxnqUZ7ilRzLQBneBZCrtPtlIxExdD_a2Aqzgb5JdND92ZutlPdCUKxZSBVQtmLVg4wh8O-GCA3bSqI', + "key_ops": [ + 'sign' + ], + "ext": true, + "kid": '510c84dd7c5a7c285911d0f405522c5a' + } + + response = authorize(bulk_private_key: invalid_private_key.to_json) + assert_response_bad_or_unauthorized(response) + end + + test :return_access_token do + metadata do + id '11' name 'Bulk Data Token Endpoint shall return access token' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#issuing-access-tokens' description %( - With valid token request from Bulk Data client, Token endpoint shall return access token. + If the access token request is valid and authorized, the authorization server SHALL issue an access token in response. + + The access token response SHALL be a JSON object with the following properties: + + * access_token required The access token issued by the authorization server. + * token_type required Fixed value: bearer. + * expires_in required The lifetime in seconds of the access token. The recommended value is 300, for a five-minute token lifetime. + * scope required Scope of access authorized. Note that this can be different from the scopes requested by the app. ) end @@ -107,7 +254,10 @@ def authorize(content_type: 'application/x-www-form-urlencoded', assert_response_ok(response) response_body = JSON.parse(response.body) @access_token = response_body['access_token'] - assert !@access_token.nil?, 'access_token is empty' + assert @access_token.present?, 'access_token is empty' + assert response_body['token_type'] == 'bearer', 'token_type expected to be "bearer"' + assert response_body['expires_in'].present?, 'expires_in is empty' + assert response_body['scope'].present?, 'scope is empty' end end end diff --git a/lib/modules/bulk_data/bulk_data_capability_statement_sequence.rb b/lib/modules/bulk_data/bulk_data_capability_statement_sequence.rb index 51155bbcc..8b52e3795 100644 --- a/lib/modules/bulk_data/bulk_data_capability_statement_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_capability_statement_sequence.rb @@ -107,6 +107,7 @@ def assert_operation(op_name); end description %( These OperationDefinitions have been defined for this implementation guide. + * Export: export any data from a FHIR server * Patient Export: export patient data from a FHIR server * Group Export: export data for groups of patients from a FHIR server diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index bf4b438fd..3d28b0934 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -20,33 +20,37 @@ @access_token = { 'token_type' => 'bearer', 'expires_in' => 900, - 'access_token' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYmVhcmVyIiwiZXhwaXJlc19pbiI6OTAwLCJpYXQiOjE1NzM5NDU1MDQsImV4cCI6MTU3Mzk0NjQwNH0.Ds-9HxQPJshkPYYBowJXltTaX2T6MSv_qYnZLjteTH8' + 'access_token' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYmVhcmVyIiwiZXhwaXJlc19pbiI6OTAwLCJpYXQiOjE1NzM5NDU1MDQsImV4cCI6MTU3Mzk0NjQwNH0.Ds-9HxQPJshkPYYBowJXltTaX2T6MSv_qYnZLjteTH8', + 'scope' => 'system/*.read' + } end - describe 'require correct content-type' do + def self.it_test_rquired_parameter(test_id, request_headers: nil) before do - @test = @sequence_class[:require_content_type] + @test = @sequence_class[test_id] @sequence = @sequence_class.new(@instance, @client) end - it 'pass with status code 400' do - stub_request(:post, @instance.oauth_token_endpoint) - .with(headers: { content_type: 'application/json' }) + it 'pass with stastus code 400' do + a_request = stub_request(:post, @instance.oauth_token_endpoint) .to_return( status: 400 ) + a_request.with(headers: request_headers) if request_headers.present? + @sequence.run_test(@test) end it 'fail with status code 200' do - stub_request(:post, @instance.oauth_token_endpoint) - .with(headers: { content_type: 'application/json' }) + a_request = stub_request(:post, @instance.oauth_token_endpoint) .to_return( status: 200 ) + a_request.with(headers: request_headers) if request_headers.present? + error = assert_raises(Inferno::AssertionException) do @sequence.run_test(@test) end @@ -55,62 +59,44 @@ end end - describe 'require system scope' do - before do - @test = @sequence_class[:require_system_scope] - @sequence = @sequence_class.new(@instance, @client) - end - - it 'pass with status code 400' do - stub_request(:post, @instance.oauth_token_endpoint) - .to_return( - status: 400 - ) - - @sequence.run_test(@test) - end + describe 'require correct content-type' do + it_test_rquired_parameter(:require_content_type, request_headers: { content_type: 'application/json' }) + end - it 'fail with status code 200' do - stub_request(:post, @instance.oauth_token_endpoint) - .to_return( - status: 200 - ) + describe 'require system scope' do + it_test_rquired_parameter(:require_system_scope) + end - error = assert_raises(Inferno::AssertionException) do - @sequence.run_test(@test) - end + describe 'require grant type' do + it_test_rquired_parameter(:require_grant_type) + end - assert_match(/^Bad response code/, error.message) - end + describe 'require client assertion type' do + it_test_rquired_parameter(:require_client_assertion_type) end - describe 'require grant type' do - before do - @test = @sequence_class[:require_grant_type] - @sequence = @sequence_class.new(@instance, @client) - end + describe 'require JWT iss' do + it_test_rquired_parameter(:require_jwt_iss) + end - it 'pass with stastus code 400' do - stub_request(:post, @instance.oauth_token_endpoint) - .to_return( - status: 400 - ) + describe 'require JWT sub' do + it_test_rquired_parameter(:require_jwt_sub) + end - @sequence.run_test(@test) - end + describe 'require JWT aud' do + it_test_rquired_parameter(:require_jwt_aud) + end - it 'fail with status code 200' do - stub_request(:post, @instance.oauth_token_endpoint) - .to_return( - status: 200 - ) + describe 'require JWT exp' do + it_test_rquired_parameter(:require_jwt_exp) + end - error = assert_raises(Inferno::AssertionException) do - @sequence.run_test(@test) - end + describe 'require JWT jti' do + it_test_rquired_parameter(:require_jwt_jti) + end - assert_match(/^Bad response code/, error.message) - end + describe 'sign with private key' do + it_test_rquired_parameter(:correct_signature) end describe 'return access token tests' do @@ -145,7 +131,7 @@ it 'fail when server returns empty access_token' do invalid_access_token = @access_token.clone - invalid_access_token['access_token'] = nil + invalid_access_token.delete('access_token') stub_request(:post, @instance.oauth_token_endpoint) .to_return( @@ -159,5 +145,22 @@ assert_match(/access_token is empty/, error.message) end + + it 'fail when server returns empty token_type' do + invalid_access_token = @access_token.clone + invalid_access_token.delete('token_type') + + stub_request(:post, @instance.oauth_token_endpoint) + .to_return( + status: 200, + body: invalid_access_token.to_json + ) + + error = assert_raises(Inferno::AssertionException) do + @sequence.run_test(@test) + end + + assert_match(/^token_type expected to be/, error.message) + end end end From 8796e3ca919724b17b4c0f311a13c5a98f1fe326 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Thu, 21 Nov 2019 15:32:20 -0600 Subject: [PATCH 139/173] bug fix. rename some field to bulk_ --- lib/app/models/testing_instance.rb | 3 +++ lib/app/views/default.erb | 11 ++++++++- .../bulk_data_authorization_sequence.rb | 23 +++++++++++-------- .../bulk_data/bulk_data_discovery_sequence.rb | 6 ++--- .../test/authorization_sequence_test.rb | 21 ++++++++++------- .../bulk_data/test/discovery_sequence_test.rb | 4 ++-- 6 files changed, 45 insertions(+), 23 deletions(-) diff --git a/lib/app/models/testing_instance.rb b/lib/app/models/testing_instance.rb index 8edb2535b..f8b061692 100644 --- a/lib/app/models/testing_instance.rb +++ b/lib/app/models/testing_instance.rb @@ -57,8 +57,11 @@ class TestingInstance property :group_id, String + property :bulk_token_endpoint, String + property :bulk_client_id, String property :bulk_public_key, String property :bulk_private_key, String + property :bulk_access_token, String has n, :sequence_results has n, :resource_references diff --git a/lib/app/views/default.erb b/lib/app/views/default.erb index bc1ec9341..36dee6396 100644 --- a/lib/app/views/default.erb +++ b/lib/app/views/default.erb @@ -227,6 +227,16 @@ instance: instance, value: instance.group_id, })%> + <%= erb(:prerequisite_field,{},{prerequisite: :bulk_token_endpoint, + label: 'Bulk Token Endpoint', + instance: instance, + value: instance.bulk_token_endpoint, + })%> + <%= erb(:prerequisite_field,{},{prerequisite: :bulk_client_id, + label: 'Bulk Client ID', + instance: instance, + value: instance.bulk_client_id, + })%>
    -
    <% end %> diff --git a/lib/modules/bdt_module.yml b/lib/modules/bdt_module.yml index 59dabb833..3505bb2c8 100644 --- a/lib/modules/bdt_module.yml +++ b/lib/modules/bdt_module.yml @@ -1,5 +1,10 @@ name: bdt -title: Bulk Data Tests (via BDT) +title: Bulk Data Export Tests +tags: + - name: SMART Bulk Data Tester + description: | + Tests provided by the SMART Bulk Data Tester from Boston Children's Hospital. + url: http://bulk-data-tester.smarthealthit.org/ description: BDT Integration fhir_version: r4 default_test_set: developer @@ -7,7 +12,12 @@ test_sets: developer: view: default tests: - - name: Bulk Data Test + - name: Bulk Data Export Tests + tags: + - name: SMART Bulk Data Tester + description: | + Tests provided by the SMART Bulk Data Tester from Boston Children's Hospital. + url: http://bulk-data-tester.smarthealthit.org/ run_all: true sequences: - BDTAuthSequence diff --git a/lib/version.rb b/lib/version.rb index 05e8842d4..a3275557a 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Inferno - VERSION = '2.7.0' + VERSION = '2.8.0-pre1' end diff --git a/public/css/styles.css b/public/css/styles.css index ddc64e213..e1f28d9d3 100644 --- a/public/css/styles.css +++ b/public/css/styles.css @@ -173,6 +173,11 @@ body { background-color: #999; } +.form-check .badge.module-tag { + background-color: #114988; + +} + .index-page legend { font-family: 'Roboto Condensed', sans-serif; font-size: 2rem; @@ -311,6 +316,12 @@ body { margin: 15px 0 10px; } +.sequence-header .badge-dark { + font-size: .8rem; + background-color: #114988; + +} + .sequence-header-details { float: right; margin-top: 10px; From 60885b49459b9eaeee71e6e4d844e718cb1d1963 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Mon, 25 Nov 2019 21:09:42 -0500 Subject: [PATCH 148/173] Reorder attribute lists to be alphabetical. --- lib/app/models/module.rb | 6 +++--- lib/app/models/module/tag.rb | 2 +- lib/app/models/module/test_group.rb | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/app/models/module.rb b/lib/app/models/module.rb index ac11aef1f..3de71356c 100644 --- a/lib/app/models/module.rb +++ b/lib/app/models/module.rb @@ -10,14 +10,14 @@ module Inferno class Module @modules = {} - attr_accessor :name - attr_accessor :description attr_accessor :default_test_set + attr_accessor :description attr_accessor :fhir_version attr_accessor :hide_optional - attr_accessor :title + attr_accessor :name attr_accessor :tags attr_accessor :test_sets + attr_accessor :title def initialize(params) @name = params[:name] diff --git a/lib/app/models/module/tag.rb b/lib/app/models/module/tag.rb index 2042dd26f..50766ce56 100644 --- a/lib/app/models/module/tag.rb +++ b/lib/app/models/module/tag.rb @@ -3,8 +3,8 @@ module Inferno class Module class Tag - attr_accessor :name attr_accessor :description + attr_accessor :name attr_accessor :url def initialize(name, description, url) diff --git a/lib/app/models/module/test_group.rb b/lib/app/models/module/test_group.rb index d594e21d8..fbc25976f 100644 --- a/lib/app/models/module/test_group.rb +++ b/lib/app/models/module/test_group.rb @@ -5,13 +5,13 @@ module Inferno class Module class TestGroup - attr_accessor :test_set - attr_accessor :name - attr_accessor :overview + attr_accessor :id attr_accessor :input_instructions attr_accessor :lock_variables - attr_accessor :id + attr_accessor :name + attr_accessor :overview attr_accessor :test_cases + attr_accessor :test_set attr_accessor :run_all attr_accessor :run_skipped attr_accessor :test_case_names From 95eb52e7d0ab4a118d671e760ca7a2bd4520970e Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Mon, 25 Nov 2019 21:12:34 -0500 Subject: [PATCH 149/173] Improve comment in config.yml. --- config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config.yml b/config.yml index 7ebd43214..52f8b1ce3 100644 --- a/config.yml +++ b/config.yml @@ -90,4 +90,5 @@ presets: bulk_system_export_endpoint: /$export bulk_patient_export_endpoint: /Patient/$export bulk_group_export_endpoint: /Group/5/$export - #https://bulk-data.smarthealthit.org/?auth_type=jwks&jwks=eyJrZXlzIjpbeyJrdHkiOiJFQyIsImNydiI6IlAtMzg0IiwieCI6InRWekRXUTVxTTFla1JrTzlhY1YyT3JEV19KeWVTNmJhRHJYUHM5dlBPR094YTV6NTVDV3Rwd2dfQkR5T1l0OG4iLCJ5IjoiaHBYSUNaTU5lekQxb01OYWtPcWxHTmgzV1FnQ2RLZlFVcERObGh4X2RLUW8weW1NUGVYS3hpc01tVnFXT2stTCIsImtleV9vcHMiOlsidmVyaWZ5Il0sImV4dCI6dHJ1ZSwia2lkIjoiYzk1MjlhMGFhZWZhNWVhNjU5ZDY1YzQ5MzllY2E5NzYiLCJhbGciOiJFUzM4NCJ9LHsia3R5IjoiRUMiLCJjcnYiOiJQLTM4NCIsImQiOiJtOWdKcUdhaDhDOC12bW9zNS02YnA5MDJUUEZHSHZjdFVJekdkMjJMUHlFNm81RDJXRVUxbVdFbTc0bEVleWJQIiwieCI6InRWekRXUTVxTTFla1JrTzlhY1YyT3JEV19KeWVTNmJhRHJYUHM5dlBPR094YTV6NTVDV3Rwd2dfQkR5T1l0OG4iLCJ5IjoiaHBYSUNaTU5lekQxb01OYWtPcWxHTmgzV1FnQ2RLZlFVcERObGh4X2RLUW8weW1NUGVYS3hpc01tVnFXT2stTCIsImtleV9vcHMiOlsic2lnbiJdLCJleHQiOnRydWUsImtpZCI6ImM5NTI5YTBhYWVmYTVlYTY1OWQ2NWM0OTM5ZWNhOTc2IiwiYWxnIjoiRVMzODQifV19&page=1000&stu=4 + # A UI for this launch configuration can be accessed at: + # https://bulk-data.smarthealthit.org/?auth_type=jwks&jwks=eyJrZXlzIjpbeyJrdHkiOiJFQyIsImNydiI6IlAtMzg0IiwieCI6InRWekRXUTVxTTFla1JrTzlhY1YyT3JEV19KeWVTNmJhRHJYUHM5dlBPR094YTV6NTVDV3Rwd2dfQkR5T1l0OG4iLCJ5IjoiaHBYSUNaTU5lekQxb01OYWtPcWxHTmgzV1FnQ2RLZlFVcERObGh4X2RLUW8weW1NUGVYS3hpc01tVnFXT2stTCIsImtleV9vcHMiOlsidmVyaWZ5Il0sImV4dCI6dHJ1ZSwia2lkIjoiYzk1MjlhMGFhZWZhNWVhNjU5ZDY1YzQ5MzllY2E5NzYiLCJhbGciOiJFUzM4NCJ9LHsia3R5IjoiRUMiLCJjcnYiOiJQLTM4NCIsImQiOiJtOWdKcUdhaDhDOC12bW9zNS02YnA5MDJUUEZHSHZjdFVJekdkMjJMUHlFNm81RDJXRVUxbVdFbTc0bEVleWJQIiwieCI6InRWekRXUTVxTTFla1JrTzlhY1YyT3JEV19KeWVTNmJhRHJYUHM5dlBPR094YTV6NTVDV3Rwd2dfQkR5T1l0OG4iLCJ5IjoiaHBYSUNaTU5lekQxb01OYWtPcWxHTmgzV1FnQ2RLZlFVcERObGh4X2RLUW8weW1NUGVYS3hpc01tVnFXT2stTCIsImtleV9vcHMiOlsic2lnbiJdLCJleHQiOnRydWUsImtpZCI6ImM5NTI5YTBhYWVmYTVlYTY1OWQ2NWM0OTM5ZWNhOTc2IiwiYWxnIjoiRVMzODQifV19&page=1000&stu=4 From 8fb860406377bd63a942688f157cee111d5bae19 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Mon, 25 Nov 2019 21:57:14 -0500 Subject: [PATCH 150/173] Rename BDT module. --- lib/modules/bdt_module.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/modules/bdt_module.yml b/lib/modules/bdt_module.yml index 3505bb2c8..012584c43 100644 --- a/lib/modules/bdt_module.yml +++ b/lib/modules/bdt_module.yml @@ -1,12 +1,11 @@ name: bdt -title: Bulk Data Export Tests +title: FHIR Bulk Data Access Implementation Guide v1.0.0 tags: - name: SMART Bulk Data Tester description: | Tests provided by the SMART Bulk Data Tester from Boston Children's Hospital. url: http://bulk-data-tester.smarthealthit.org/ description: BDT Integration -fhir_version: r4 default_test_set: developer test_sets: developer: From 84877c00c80a7ec6448fde8a2f98db48f85af17e Mon Sep 17 00:00:00 2001 From: Chase Date: Fri, 15 Nov 2019 10:52:32 -0500 Subject: [PATCH 151/173] set patient+category as first search for diagnosticreport sequences and fix bug with fetching valueset values --- generator/uscore/metadata_extractor.rb | 16 +++++--- .../us_core_diagnosticreport_lab_sequence.rb | 41 ++++++++++--------- .../us_core_diagnosticreport_note_sequence.rb | 41 ++++++++++--------- 3 files changed, 53 insertions(+), 45 deletions(-) diff --git a/generator/uscore/metadata_extractor.rb b/generator/uscore/metadata_extractor.rb index aefdf171a..ddee42c03 100644 --- a/generator/uscore/metadata_extractor.rb +++ b/generator/uscore/metadata_extractor.rb @@ -212,7 +212,7 @@ def add_search_param_descriptions(profile_definition, sequence) if !profile_element.nil? param_metadata[:type] = profile_element['type'].first['code'] param_metadata[:contains_multiple] = (profile_element['max'] == '*') - add_valid_codes(profile_definition, profile_element, FHIR.const_get(sequence[:resource])::METADATA[param.to_s], param_metadata, path) + add_valid_codes(profile_definition, profile_element, FHIR.const_get(sequence[:resource])::METADATA[param.to_s], param_metadata) else # search is a variable type eg.) Condition.onsetDateTime - element in profile def is Condition.onset[x] param_metadata[:type] = search_param_definition['type'] @@ -228,9 +228,9 @@ def add_search_param_descriptions(profile_definition, sequence) end end - def add_valid_codes(profile_definition, profile_element, fhir_metadata, param_metadata, path) + def add_valid_codes(profile_definition, profile_element, fhir_metadata, param_metadata) if param_metadata[:contains_multiple] - add_values_from_slices(param_metadata, profile_definition, path) + add_values_from_slices(param_metadata, profile_definition, param_metadata[:path]) elsif param_metadata[:type] == 'CodeableConcept' add_values_from_fixed_codes(param_metadata, profile_definition, profile_element) add_values_from_patterncodeableconcept(param_metadata, profile_element) @@ -256,8 +256,9 @@ def add_values_from_valueset_binding(param_metadata, profile_element) return unless valueset_binding value_set = resources_by_type['ValueSet'].find { |res| res['url'] == valueset_binding['valueSet'] } - codes = value_set['compose']['include'].reject { |code| code['concept'].nil? } if value_set.present? - param_metadata[:values] += codes.map { |code| code['concept'].first['code'] } if codes.present? + systems = value_set['compose']['include'].reject { |code| code['concept'].nil? } if value_set.present? + + param_metadata[:values] += systems.flat_map { |system| system['concept'].map { |code| code['code'] } } if systems.present? end def add_values_from_patterncodeableconcept(param_metadata, profile_element) @@ -303,6 +304,11 @@ def add_special_cases(metadata) medication_request_sequence = metadata[:sequences].find { |sequence| sequence[:resource] == 'MedicationRequest' } set_first_search(medication_request_sequence, ['patient', 'intent']) + diagnostic_report_sequences = metadata[:sequences].select { |sequence| sequence[:resource] == 'DiagnosticReport' } + diagnostic_report_sequences.each do |sequence| + set_first_search(sequence, ['patient', 'category']) + end + metadata end diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb index 34018ad88..6f0e0f875 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -67,7 +67,7 @@ def validate_resource_item(resource, property, value) assert_response_unauthorized reply end - test 'Server returns expected results from DiagnosticReport search by patient' do + test 'Server returns expected results from DiagnosticReport search by patient+category' do metadata do id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -77,7 +77,8 @@ def validate_resource_item(resource, property, value) end search_params = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'category': 'LAB' } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -96,7 +97,7 @@ def validate_resource_item(resource, property, value) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end - test 'Server returns expected results from DiagnosticReport search by patient+code' do + test 'Server returns expected results from DiagnosticReport search by patient' do metadata do id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -109,17 +110,15 @@ def validate_resource_item(resource, property, value) assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'code')) + 'patient': @instance.patient_id } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) assert_response_ok(reply) end - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do + test 'Server returns expected results from DiagnosticReport search by patient+code' do metadata do id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -133,25 +132,16 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'effectiveDateTime')) + 'code': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'code')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, search_params[:date]) - comparator_search_params = { 'patient': search_params[:patient], 'category': search_params[:category], 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end end - test 'Server returns expected results from DiagnosticReport search by patient+category' do + test 'Server returns expected results from DiagnosticReport search by patient+category+date' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -165,12 +155,22 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': 'LAB' + 'category': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'effectiveDateTime')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, search_params[:date]) + comparator_search_params = { 'patient': search_params[:patient], 'category': search_params[:category], 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end end test 'Server returns expected results from DiagnosticReport search by patient+status' do @@ -288,7 +288,8 @@ def validate_resource_item(resource, property, value) end search_params = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'category': 'LAB' } search_params['_revinclude'] = 'Provenance:target' diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb index f5577e8fc..e570e183c 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -67,7 +67,7 @@ def validate_resource_item(resource, property, value) assert_response_unauthorized reply end - test 'Server returns expected results from DiagnosticReport search by patient' do + test 'Server returns expected results from DiagnosticReport search by patient+category' do metadata do id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -77,7 +77,8 @@ def validate_resource_item(resource, property, value) end search_params = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'code': 'LP29684-5' } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @@ -96,7 +97,7 @@ def validate_resource_item(resource, property, value) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end - test 'Server returns expected results from DiagnosticReport search by patient+code' do + test 'Server returns expected results from DiagnosticReport search by patient' do metadata do id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -109,17 +110,15 @@ def validate_resource_item(resource, property, value) assert !@diagnostic_report.nil?, 'Expected valid DiagnosticReport resource to be present' search_params = { - 'patient': @instance.patient_id, - 'code': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'code')) + 'patient': @instance.patient_id } - search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) assert_response_ok(reply) end - test 'Server returns expected results from DiagnosticReport search by patient+category+date' do + test 'Server returns expected results from DiagnosticReport search by patient+code' do metadata do id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -133,25 +132,16 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'category')), - 'date': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'effectiveDateTime')) + 'code': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'code')) } search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) assert_response_ok(reply) - - ['gt', 'lt', 'le'].each do |comparator| - comparator_val = date_comparator_value(comparator, search_params[:date]) - comparator_search_params = { 'patient': search_params[:patient], 'category': search_params[:category], 'date': comparator_val } - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) - assert_response_ok(reply) - end end - test 'Server returns expected results from DiagnosticReport search by patient+category' do + test 'Server returns expected results from DiagnosticReport search by patient+category+date' do metadata do id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' @@ -165,12 +155,22 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'code': 'LP29684-5' + 'category': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'category')), + 'date': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'effectiveDateTime')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) assert_response_ok(reply) + + ['gt', 'lt', 'le'].each do |comparator| + comparator_val = date_comparator_value(comparator, search_params[:date]) + comparator_search_params = { 'patient': search_params[:patient], 'category': search_params[:category], 'date': comparator_val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), comparator_search_params) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, comparator_search_params) + assert_response_ok(reply) + end end test 'Server returns expected results from DiagnosticReport search by patient+status' do @@ -288,7 +288,8 @@ def validate_resource_item(resource, property, value) end search_params = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'code': 'LP29684-5' } search_params['_revinclude'] = 'Provenance:target' From a546b430b91628c5a8b0c7c28b652c347bf5dadc Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 26 Nov 2019 14:57:21 -0500 Subject: [PATCH 152/173] add tests for missing well-known configuration --- lib/modules/smart/smart_discovery_sequence.rb | 6 ++-- .../test/smart_discovery_sequence_test.rb | 32 +++++++++++++++++++ 2 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 lib/modules/smart/test/smart_discovery_sequence_test.rb diff --git a/lib/modules/smart/smart_discovery_sequence.rb b/lib/modules/smart/smart_discovery_sequence.rb index 65d154470..a5824d948 100644 --- a/lib/modules/smart/smart_discovery_sequence.rb +++ b/lib/modules/smart/smart_discovery_sequence.rb @@ -106,9 +106,10 @@ class SMARTDiscoverySequence < SequenceBase assert @well_known_configuration.present?, 'No .well-known/smart-configuration body' end - test 'Configuration from well-known endpoint contains required fields' do + test :required_well_known_fields do metadata do id '02' + name 'Configuration from well-known endpoint contains required fields' link 'http://hl7.org/fhir/smart-app-launch/conformance/index.html#metadata' description %( The JSON from .well-known/smart-configuration contains the following @@ -120,9 +121,10 @@ class SMARTDiscoverySequence < SequenceBase assert missing_fields.empty?, "The following required fields are missing: #{missing_fields.join(', ')}" end - test 'Configuration from well-known endpoint contains recommended fields' do + test :recommended_well_known_fields do metadata do id '03' + name 'Configuration from well-known endpoint contains recommended fields' link 'http://hl7.org/fhir/smart-app-launch/conformance/index.html#metadata' optional description %( diff --git a/lib/modules/smart/test/smart_discovery_sequence_test.rb b/lib/modules/smart/test/smart_discovery_sequence_test.rb new file mode 100644 index 000000000..96058c243 --- /dev/null +++ b/lib/modules/smart/test/smart_discovery_sequence_test.rb @@ -0,0 +1,32 @@ +# frozen_string_literal: true + +require_relative '../../../../test/test_helper' + +describe Inferno::Sequence::SMARTDiscoverySequence do + before do + @sequence_class = Inferno::Sequence::SMARTDiscoverySequence + @instance = Inferno::Models::TestingInstance.new + end + + describe 'required well-known configuration fields' do + before do + @test = @sequence_class[:required_well_known_fields] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips when no well-known configuration has been found' do + assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + end + end + + describe 'recommended well-known configuration fields' do + before do + @test = @sequence_class[:recommended_well_known_fields] + @sequence = @sequence_class.new(@instance, @client) + end + + it 'skips when no well-known configuration has been found' do + assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + end + end +end From 09f151f830356daaf218bb1bedfe5d6c14a726fa Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 18 Nov 2019 14:23:30 -0500 Subject: [PATCH 153/173] remove hardcoded first search values that were added from merge --- generator/uscore/uscore_generator.rb | 18 --------- .../pediatric_bmi_for_age_sequence.rb | 34 ++++++++-------- .../pediatric_weight_for_height_sequence.rb | 34 ++++++++-------- .../us_core_careplan_sequence.rb | 34 ++++++++-------- .../us_core_careteam_sequence.rb | 40 ++++++++++--------- .../us_core_diagnosticreport_lab_sequence.rb | 34 ++++++++-------- .../us_core_diagnosticreport_note_sequence.rb | 34 ++++++++-------- .../us_core_observation_lab_sequence.rb | 34 ++++++++-------- .../us_core_pulse_oximetry_sequence.rb | 34 ++++++++-------- .../us_core_smokingstatus_sequence.rb | 34 ++++++++-------- 10 files changed, 165 insertions(+), 165 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index dec338d24..741594d53 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -520,25 +520,7 @@ def get_comparator_searches(search_params, sequence) end def search_param_constants(search_parameters, sequence) - return { patient: '@instance.patient_id', category: 'assess-plan' } if search_parameters == ['patient', 'category'] && - sequence[:resource] == 'CarePlan' - return { patient: '@instance.patient_id', status: 'active' } if search_parameters == ['patient', 'status'] && - sequence[:resource] == 'CareTeam' return { '_id': '@instance.patient_id' } if search_parameters == ['_id'] && sequence[:resource] == 'Patient' - return { patient: '@instance.patient_id', code: '72166-2' } if search_parameters == ['patient', 'code'] && - sequence[:profile] == PROFILE_URIS[:smoking_status] - return { patient: '@instance.patient_id', category: 'laboratory' } if search_parameters == ['patient', 'category'] && - sequence[:profile] == PROFILE_URIS[:lab_results] - return { patient: '@instance.patient_id', code: '77606-2' } if search_parameters == ['patient', 'code'] && - sequence[:profile] == PROFILE_URIS[:pediatric_weight_height] - return { patient: '@instance.patient_id', code: '59576-9' } if search_parameters == ['patient', 'code'] && - sequence[:profile] == PROFILE_URIS[:pediatric_bmi_age] - return { patient: '@instance.patient_id', category: 'LAB' } if search_parameters == ['patient', 'category'] && - sequence[:profile] == PROFILE_URIS[:diagnostic_report_lab] - return { patient: '@instance.patient_id', code: 'LP29684-5' } if search_parameters == ['patient', 'category'] && - sequence[:profile] == PROFILE_URIS[:diagnostic_report_note] - return { patient: '@instance.patient_id', code: '59408-5' } if search_parameters == ['patient', 'code'] && - sequence[:profile] == PROFILE_URIS[:pulse_oximetry] end def create_search_validation(sequence) diff --git a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb index 7276f6f28..707bb1801 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb @@ -76,25 +76,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { - 'patient': @instance.patient_id, - 'code': '59576-9' - } + code_val = ['59576-9'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_bmi_age]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do @@ -269,8 +270,9 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'code': '59576-9' + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb index 66fd2b470..45204b455 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb @@ -76,25 +76,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { - 'patient': @instance.patient_id, - 'code': '77606-2' - } + code_val = ['77606-2'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pediatric_weight_height]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do @@ -269,8 +270,9 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'code': '77606-2' + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb index b66d370ad..75fd3fe15 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -72,25 +72,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { - 'patient': @instance.patient_id, - 'category': 'assess-plan' - } + category_val = ['assess-plan'] + category_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'category': val } + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @care_plan = reply&.resource&.entry&.first&.resource + @care_plan_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) + save_delayed_sequence_references(@care_plan_ary) + validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @care_plan = reply&.resource&.entry&.first&.resource - @care_plan_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('CarePlan'), reply) - save_delayed_sequence_references(@care_plan_ary) - validate_search_reply(versioned_resource_class('CarePlan'), reply, search_params) end test 'Server returns expected results from CarePlan search by patient+category+date' do @@ -244,8 +245,9 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': 'assess-plan' + 'category': get_value_for_search_param(resolve_element_from_path(@care_plan_ary, 'category')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb index add2024d0..4f9fc7edb 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb @@ -62,25 +62,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { - 'patient': @instance.patient_id, - 'status': 'active' - } - - reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) - - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? - + status_val = ['proposed', 'active', 'suspended', 'inactive', 'entered-in-error'] + status_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'status': val } + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) + + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found + + @care_team = reply&.resource&.entry&.first&.resource + @care_team_ary = fetch_all_bundled_resources(reply&.resource) + + save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) + save_delayed_sequence_references(@care_team_ary) + validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @care_team = reply&.resource&.entry&.first&.resource - @care_team_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('CareTeam'), reply) - save_delayed_sequence_references(@care_team_ary) - validate_search_reply(versioned_resource_class('CareTeam'), reply, search_params) end test :read_interaction do @@ -142,8 +143,9 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'status': 'active' + 'status': get_value_for_search_param(resolve_element_from_path(@care_team_ary, 'status')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb index 6f0e0f875..0517e3750 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -76,25 +76,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { - 'patient': @instance.patient_id, - 'category': 'LAB' - } + category_val = ['LAB'] + category_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'category': val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @diagnostic_report = reply&.resource&.entry&.first&.resource + @diagnostic_report_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) + save_delayed_sequence_references(@diagnostic_report_ary) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @diagnostic_report = reply&.resource&.entry&.first&.resource - @diagnostic_report_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_lab]) - save_delayed_sequence_references(@diagnostic_report_ary) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end test 'Server returns expected results from DiagnosticReport search by patient' do @@ -289,8 +290,9 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': 'LAB' + 'category': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'category')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb index e570e183c..b458b3064 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -76,25 +76,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { - 'patient': @instance.patient_id, - 'code': 'LP29684-5' - } + category_val = ['LP29684-5', 'LP29708-2', 'LP7839-6'] + category_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'category': val } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @diagnostic_report = reply&.resource&.entry&.first&.resource + @diagnostic_report_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) + save_delayed_sequence_references(@diagnostic_report_ary) + validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @diagnostic_report = reply&.resource&.entry&.first&.resource - @diagnostic_report_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('DiagnosticReport'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:diagnostic_report_note]) - save_delayed_sequence_references(@diagnostic_report_ary) - validate_search_reply(versioned_resource_class('DiagnosticReport'), reply, search_params) end test 'Server returns expected results from DiagnosticReport search by patient' do @@ -289,8 +290,9 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'code': 'LP29684-5' + 'category': get_value_for_search_param(resolve_element_from_path(@diagnostic_report_ary, 'category')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb index 9ca24bc22..08cc97a5a 100644 --- a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb @@ -76,25 +76,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { - 'patient': @instance.patient_id, - 'category': 'laboratory' - } + category_val = ['laboratory'] + category_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'category': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:lab_results]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+code' do @@ -269,8 +270,9 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'category': 'laboratory' + 'category': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'category')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb index 33679a9fc..f53742385 100644 --- a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb @@ -76,25 +76,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { - 'patient': @instance.patient_id, - 'code': '59408-5' - } + code_val = ['2708-6', '59408-5'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:pulse_oximetry]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do @@ -269,8 +270,9 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'code': '59408-5' + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) diff --git a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb index 27d354ce5..1fc7d4186 100644 --- a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb @@ -76,25 +76,26 @@ def validate_resource_item(resource, property, value) versions :r4 end - search_params = { - 'patient': @instance.patient_id, - 'code': '72166-2' - } + code_val = ['72166-2'] + code_val.each do |val| + search_params = { 'patient': @instance.patient_id, 'code': val } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) + assert_response_ok(reply) + assert_bundle_response(reply) - reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) - assert_response_ok(reply) - assert_bundle_response(reply) + resource_count = reply&.resource&.entry&.length || 0 + @resources_found = true if resource_count.positive? + next unless @resources_found - resource_count = reply&.resource&.entry&.length || 0 - @resources_found = true if resource_count.positive? + @observation = reply&.resource&.entry&.first&.resource + @observation_ary = fetch_all_bundled_resources(reply&.resource) + save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) + save_delayed_sequence_references(@observation_ary) + validate_search_reply(versioned_resource_class('Observation'), reply, search_params) + break + end skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found - - @observation = reply&.resource&.entry&.first&.resource - @observation_ary = fetch_all_bundled_resources(reply&.resource) - save_resource_ids_in_bundle(versioned_resource_class('Observation'), reply, Inferno::ValidationUtil::US_CORE_R4_URIS[:smoking_status]) - save_delayed_sequence_references(@observation_ary) - validate_search_reply(versioned_resource_class('Observation'), reply, search_params) end test 'Server returns expected results from Observation search by patient+category+date' do @@ -269,8 +270,9 @@ def validate_resource_item(resource, property, value) search_params = { 'patient': @instance.patient_id, - 'code': '72166-2' + 'code': get_value_for_search_param(resolve_element_from_path(@observation_ary, 'code')) } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } search_params['_revinclude'] = 'Provenance:target' reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) From 5397d03dd778238a874474921c54ec73f2e1d3cc Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 18 Nov 2019 16:10:55 -0500 Subject: [PATCH 154/173] change each loop --- generator/uscore/metadata_extractor.rb | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/generator/uscore/metadata_extractor.rb b/generator/uscore/metadata_extractor.rb index ddee42c03..320c08811 100644 --- a/generator/uscore/metadata_extractor.rb +++ b/generator/uscore/metadata_extractor.rb @@ -304,10 +304,11 @@ def add_special_cases(metadata) medication_request_sequence = metadata[:sequences].find { |sequence| sequence[:resource] == 'MedicationRequest' } set_first_search(medication_request_sequence, ['patient', 'intent']) - diagnostic_report_sequences = metadata[:sequences].select { |sequence| sequence[:resource] == 'DiagnosticReport' } - diagnostic_report_sequences.each do |sequence| - set_first_search(sequence, ['patient', 'category']) - end + metadata[:sequences] + .select { |sequence| sequence[:resource] == 'DiagnosticReport' } + .each do |sequence| + set_first_search(sequence, ['patient', 'category']) + end metadata end From 21f3373ac1339cf0b305400a1cb01781e068e81c Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Tue, 26 Nov 2019 15:01:43 -0500 Subject: [PATCH 155/173] update SMART discovery sequence to skip tests if no well-known configuration was found --- lib/modules/smart/smart_discovery_sequence.rb | 4 ++++ lib/modules/smart/test/smart_discovery_sequence_test.rb | 8 ++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/modules/smart/smart_discovery_sequence.rb b/lib/modules/smart/smart_discovery_sequence.rb index a5824d948..396e4ac15 100644 --- a/lib/modules/smart/smart_discovery_sequence.rb +++ b/lib/modules/smart/smart_discovery_sequence.rb @@ -117,6 +117,8 @@ class SMARTDiscoverySequence < SequenceBase ) end + skip_if @well_known_configuration.blank?, 'No well-known SMART configuration found.' + missing_fields = REQUIRED_WELL_KNOWN_FIELDS - @well_known_configuration.keys assert missing_fields.empty?, "The following required fields are missing: #{missing_fields.join(', ')}" end @@ -135,6 +137,8 @@ class SMARTDiscoverySequence < SequenceBase ) end + skip_if @well_known_configuration.blank?, 'No well-known SMART configuration found.' + missing_fields = RECOMMENDED_WELL_KNOWN_FIELDS - @well_known_configuration.keys assert missing_fields.empty?, "The following recommended fields are missing: #{missing_fields.join(', ')}" end diff --git a/lib/modules/smart/test/smart_discovery_sequence_test.rb b/lib/modules/smart/test/smart_discovery_sequence_test.rb index 96058c243..52c0ac688 100644 --- a/lib/modules/smart/test/smart_discovery_sequence_test.rb +++ b/lib/modules/smart/test/smart_discovery_sequence_test.rb @@ -15,7 +15,9 @@ end it 'skips when no well-known configuration has been found' do - assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No well-known SMART configuration found.', exception.message end end @@ -26,7 +28,9 @@ end it 'skips when no well-known configuration has been found' do - assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + exception = assert_raises(Inferno::SkipException) { @sequence.run_test(@test) } + + assert_equal 'No well-known SMART configuration found.', exception.message end end end From 40a524ab69ab222868e4362297a49b278c3f9770 Mon Sep 17 00:00:00 2001 From: Chase Date: Fri, 15 Nov 2019 15:37:21 -0500 Subject: [PATCH 156/173] set unauthorized search params back to first search --- generator/uscore/uscore_generator.rb | 11 +++++++++-- .../uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb | 3 +-- .../pediatric_weight_for_height_sequence.rb | 3 +-- .../us_core_allergyintolerance_sequence.rb | 5 ++++- .../uscore_v3.1.0/us_core_careplan_sequence.rb | 3 +-- .../uscore_v3.1.0/us_core_careteam_sequence.rb | 3 +-- .../uscore_v3.1.0/us_core_condition_sequence.rb | 5 ++++- .../us_core_diagnosticreport_lab_sequence.rb | 3 +-- .../us_core_diagnosticreport_note_sequence.rb | 3 +-- .../us_core_documentreference_sequence.rb | 5 ++++- .../uscore_v3.1.0/us_core_encounter_sequence.rb | 5 ++++- lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb | 5 ++++- .../uscore_v3.1.0/us_core_immunization_sequence.rb | 5 ++++- .../us_core_implantable_device_sequence.rb | 5 ++++- .../uscore_v3.1.0/us_core_location_sequence.rb | 6 +++++- .../us_core_medicationrequest_sequence.rb | 3 +-- .../uscore_v3.1.0/us_core_observation_lab_sequence.rb | 3 +-- .../uscore_v3.1.0/us_core_organization_sequence.rb | 6 +++++- lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb | 5 ++++- .../uscore_v3.1.0/us_core_practitioner_sequence.rb | 6 +++++- .../us_core_practitionerrole_sequence.rb | 6 +++++- .../uscore_v3.1.0/us_core_procedure_sequence.rb | 5 ++++- .../uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb | 3 +-- .../uscore_v3.1.0/us_core_smokingstatus_sequence.rb | 3 +-- 24 files changed, 75 insertions(+), 35 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 741594d53..cff7d7c11 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -145,13 +145,20 @@ def create_authorization_test(sequence) first_search = find_first_search(sequence) return if first_search.nil? + search_parameters = first_search[:names] + search_params = if search_parameters == ['patient'] || sequence[:delayed_sequence] || search_param_constants(search_parameters, sequence) + get_search_params(search_parameters, sequence) + else + non_patient_search_param = search_parameters.find { |param| param != 'patient' } + non_patient_value = sequence[:search_param_descriptions][non_patient_search_param.to_sym][:values].first + "search_params = { 'patient': @instance.patient_id, '#{non_patient_search_param}': #{non_patient_value} }" + end authorization_test[:test_code] = %( skip_if_not_supported(:#{sequence[:resource]}, [:search]) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + #{search_params} reply = get_resource_by_params(versioned_resource_class('#{sequence[:resource]}'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply) diff --git a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb index 707bb1801..0066822a5 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb @@ -60,8 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + search_params = { 'patient': @instance.patient_id, 'code': 59576 - 9 } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb index 45204b455..c9acd70a7 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb @@ -60,8 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + search_params = { 'patient': @instance.patient_id, 'code': 77606 - 2 } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb index 430062f75..2327d0856 100644 --- a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb @@ -47,7 +47,10 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'patient': @instance.patient_id + } + reply = get_resource_by_params(versioned_resource_class('AllergyIntolerance'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb index 75fd3fe15..8f551708a 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -56,8 +56,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + search_params = { 'patient': @instance.patient_id, 'category': assess - plan } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb index 4f9fc7edb..fa5f811cd 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb @@ -46,8 +46,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + search_params = { 'patient': @instance.patient_id, 'status': proposed } reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb index c09e2e2cd..0ba5fd9c0 100644 --- a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb @@ -61,7 +61,10 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'patient': @instance.patient_id + } + reply = get_resource_by_params(versioned_resource_class('Condition'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb index 0517e3750..8af088dbc 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -60,8 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + search_params = { 'patient': @instance.patient_id, 'category': LAB } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb index b458b3064..1e4038b66 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -60,8 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + search_params = { 'patient': @instance.patient_id, 'category': LP29684 - 5 } reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb index 00f6953be..831488d6d 100644 --- a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb @@ -69,7 +69,10 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'patient': @instance.patient_id + } + reply = get_resource_by_params(versioned_resource_class('DocumentReference'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb index 3cfca80b6..9fbc6db80 100644 --- a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb @@ -69,7 +69,10 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'patient': @instance.patient_id + } + reply = get_resource_by_params(versioned_resource_class('Encounter'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb index ac70143e3..7bf44921a 100644 --- a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb @@ -53,7 +53,10 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'patient': @instance.patient_id + } + reply = get_resource_by_params(versioned_resource_class('Goal'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb index 0bc5a0d30..e8205b13f 100644 --- a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb @@ -53,7 +53,10 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'patient': @instance.patient_id + } + reply = get_resource_by_params(versioned_resource_class('Immunization'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb index aa6ea7023..4d064c0fb 100644 --- a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb @@ -47,7 +47,10 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'patient': @instance.patient_id + } + reply = get_resource_by_params(versioned_resource_class('Device'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb index a133f935c..3941f7979 100644 --- a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb @@ -89,7 +89,11 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'name': get_value_for_search_param(resolve_element_from_path(@location_ary, 'name')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + reply = get_resource_by_params(versioned_resource_class('Location'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb index e0be3b071..3bbdfcf7c 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb @@ -58,8 +58,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + search_params = { 'patient': @instance.patient_id, 'intent': proposal } reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb index 08cc97a5a..3266ee851 100644 --- a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb @@ -60,8 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + search_params = { 'patient': @instance.patient_id, 'category': laboratory } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb index 467ef9512..fe0bd9a75 100644 --- a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb @@ -77,7 +77,11 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'name': get_value_for_search_param(resolve_element_from_path(@organization_ary, 'name')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + reply = get_resource_by_params(versioned_resource_class('Organization'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb index ca5e00f0a..f128f69d7 100644 --- a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb @@ -76,7 +76,10 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + '_id': @instance.patient_id + } + reply = get_resource_by_params(versioned_resource_class('Patient'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb index 506e8e36b..8894ee4b7 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb @@ -78,7 +78,11 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'name': get_value_for_search_param(resolve_element_from_path(@practitioner_ary, 'name')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + reply = get_resource_by_params(versioned_resource_class('Practitioner'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb index f1981db67..365402fb6 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb @@ -71,7 +71,11 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'specialty': get_value_for_search_param(resolve_element_from_path(@practitioner_role_ary, 'specialty')) + } + search_params.each { |param, value| skip "Could not resolve #{param} in given resource" if value.nil? } + reply = get_resource_by_params(versioned_resource_class('PractitionerRole'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb index 80203e627..a4fc9f474 100644 --- a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb @@ -57,7 +57,10 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { patient: @instance.patient_id } + search_params = { + 'patient': @instance.patient_id + } + reply = get_resource_by_params(versioned_resource_class('Procedure'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb index f53742385..1ebd4d409 100644 --- a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb @@ -60,8 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + search_params = { 'patient': @instance.patient_id, 'code': 2708 - 6 } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb index 1fc7d4186..db2199c45 100644 --- a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb @@ -60,8 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - - search_params = { patient: @instance.patient_id } + search_params = { 'patient': @instance.patient_id, 'code': 72166 - 2 } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply From df4c2373f32b2fa398a714a7e98ff282feea4bf2 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 18 Nov 2019 10:04:15 -0500 Subject: [PATCH 157/173] regenerate tests --- generator/uscore/uscore_generator.rb | 2 +- lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb | 2 +- .../uscore_v3.1.0/pediatric_weight_for_height_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index cff7d7c11..ae237ea56 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -151,7 +151,7 @@ def create_authorization_test(sequence) else non_patient_search_param = search_parameters.find { |param| param != 'patient' } non_patient_value = sequence[:search_param_descriptions][non_patient_search_param.to_sym][:values].first - "search_params = { 'patient': @instance.patient_id, '#{non_patient_search_param}': #{non_patient_value} }" + "search_params = { 'patient': @instance.patient_id, '#{non_patient_search_param}': '#{non_patient_value}' }" end authorization_test[:test_code] = %( skip_if_not_supported(:#{sequence[:resource]}, [:search]) diff --git a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb index 0066822a5..656dd3bf4 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb @@ -60,7 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'code': 59576 - 9 } + search_params = { 'patient': @instance.patient_id, 'code': '59576-9' } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb index c9acd70a7..56f7a9c95 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb @@ -60,7 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'code': 77606 - 2 } + search_params = { 'patient': @instance.patient_id, 'code': '77606-2' } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb index 8f551708a..2b1111d5b 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -56,7 +56,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'category': assess - plan } + search_params = { 'patient': @instance.patient_id, 'category': 'assess-plan' } reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb index fa5f811cd..7ffdf11bb 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb @@ -46,7 +46,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'status': proposed } + search_params = { 'patient': @instance.patient_id, 'status': 'proposed' } reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb index 3bbdfcf7c..500e75955 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb @@ -58,7 +58,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'intent': proposal } + search_params = { 'patient': @instance.patient_id, 'intent': 'proposal' } reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb index 3266ee851..d9c3a5c10 100644 --- a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb @@ -60,7 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'category': laboratory } + search_params = { 'patient': @instance.patient_id, 'category': 'laboratory' } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb index 1ebd4d409..974a45310 100644 --- a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb @@ -60,7 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'code': 2708 - 6 } + search_params = { 'patient': @instance.patient_id, 'code': '2708-6' } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb index db2199c45..fe204557b 100644 --- a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb @@ -60,7 +60,7 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'code': 72166 - 2 } + search_params = { 'patient': @instance.patient_id, 'code': '72166-2' } reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply From e3ac60bd7ebdfd3b4d191bb10ee1efb8430034c3 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 18 Nov 2019 10:46:30 -0500 Subject: [PATCH 158/173] fix unit tests --- generator/uscore/uscore_generator.rb | 5 ++++- .../uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb | 3 ++- .../uscore_v3.1.0/test/pediatric_weight_for_height_test.rb | 3 ++- lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb | 3 ++- lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb | 3 ++- lib/modules/uscore_v3.1.0/test/us_core_location_test.rb | 6 +++++- .../uscore_v3.1.0/test/us_core_medicationrequest_test.rb | 3 ++- .../uscore_v3.1.0/test/us_core_observation_lab_test.rb | 3 ++- lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb | 6 +++++- lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb | 2 +- lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb | 6 +++++- .../uscore_v3.1.0/test/us_core_practitionerrole_test.rb | 6 +++++- .../uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb | 3 ++- .../uscore_v3.1.0/test/us_core_smokingstatus_test.rb | 3 ++- 14 files changed, 41 insertions(+), 14 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index ae237ea56..35844001c 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -147,10 +147,13 @@ def create_authorization_test(sequence) search_parameters = first_search[:names] search_params = if search_parameters == ['patient'] || sequence[:delayed_sequence] || search_param_constants(search_parameters, sequence) + unit_test_params = get_search_param_hash(search_parameters, sequence) get_search_params(search_parameters, sequence) else non_patient_search_param = search_parameters.find { |param| param != 'patient' } non_patient_value = sequence[:search_param_descriptions][non_patient_search_param.to_sym][:values].first + unit_test_params = { patient: '@instance.patient_id' } + unit_test_params[non_patient_search_param] = non_patient_value "search_params = { 'patient': @instance.patient_id, '#{non_patient_search_param}': '#{non_patient_value}' }" end authorization_test[:test_code] = %( @@ -168,7 +171,7 @@ def create_authorization_test(sequence) unit_test_generator.generate_authorization_test( test_key: test_key, resource_type: sequence[:resource], - search_params: { patient: '@instance.patient_id' }, + search_params: unit_test_params, class_name: sequence[:class_name] ) end diff --git a/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb b/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb index 9ecb2bb24..b03231bc1 100644 --- a/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb +++ b/lib/modules/uscore_v3.1.0/test/pediatric_bmi_for_age_test.rb @@ -24,7 +24,8 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'code': '59576-9' } end diff --git a/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb b/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb index 3afcdc779..1801b680d 100644 --- a/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb +++ b/lib/modules/uscore_v3.1.0/test/pediatric_weight_for_height_test.rb @@ -24,7 +24,8 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'code': '77606-2' } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb index 39978b592..78e02a109 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_careplan_test.rb @@ -24,7 +24,8 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'category': 'assess-plan' } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb index 322b3e5cc..5d9e66602 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_careteam_test.rb @@ -24,7 +24,8 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'status': 'proposed' } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb index 5a0b5ad9f..156e82dca 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb @@ -111,8 +111,12 @@ @test = @sequence_class[:unauthorized_search] @sequence = @sequence_class.new(@instance, @client) + @location_ary = load_json_fixture(:us_core_location_location_ary) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'@location_ary', @location_ary) + @query = { - 'patient': @instance.patient_id + 'name': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@location_ary, 'name')) } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb index 7b3d815d7..16ad54608 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_medicationrequest_test.rb @@ -24,7 +24,8 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'intent': 'proposal' } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb index 31bcfad76..968613fdf 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_observation_lab_test.rb @@ -24,7 +24,8 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'category': 'laboratory' } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb index bc2ccf771..aa015a8e0 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb @@ -111,8 +111,12 @@ @test = @sequence_class[:unauthorized_search] @sequence = @sequence_class.new(@instance, @client) + @organization_ary = load_json_fixture(:us_core_organization_organization_ary) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'@organization_ary', @organization_ary) + @query = { - 'patient': @instance.patient_id + 'name': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@organization_ary, 'name')) } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb index 6789fa998..25e9d4cd4 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_patient_test.rb @@ -24,7 +24,7 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + '_id': @instance.patient_id } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb index bbb73442f..9d16faa70 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb @@ -111,8 +111,12 @@ @test = @sequence_class[:unauthorized_search] @sequence = @sequence_class.new(@instance, @client) + @practitioner_ary = load_json_fixture(:us_core_practitioner_practitioner_ary) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'@practitioner_ary', @practitioner_ary) + @query = { - 'patient': @instance.patient_id + 'name': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@practitioner_ary, 'name')) } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb index 9999e248d..a2ed4ef61 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb @@ -111,8 +111,12 @@ @test = @sequence_class[:unauthorized_search] @sequence = @sequence_class.new(@instance, @client) + @practitionerrole_ary = load_json_fixture(:us_core_practitionerrole_practitionerrole_ary) + .map { |resource| FHIR.from_contents(resource.to_json) } + @sequence.instance_variable_set(:'@practitionerrole_ary', @practitionerrole_ary) + @query = { - 'patient': @instance.patient_id + 'specialty': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@practitionerrole_ary, 'specialty')) } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb index 3eeed265d..51d780619 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_pulse_oximetry_test.rb @@ -24,7 +24,8 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'code': '2708-6' } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb index db4acecb0..765b487b4 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_smokingstatus_test.rb @@ -24,7 +24,8 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'code': '72166-2' } end From 3bc5553fdf656b7d2f4f0aaa87f1593383ed9d85 Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 19 Nov 2019 10:42:39 -0500 Subject: [PATCH 159/173] move logic into get_search_param_hash --- generator/uscore/uscore_generator.rb | 21 +++++++------------ .../pediatric_bmi_for_age_sequence.rb | 7 ++++++- .../pediatric_weight_for_height_sequence.rb | 7 ++++++- .../us_core_careplan_sequence.rb | 7 ++++++- .../us_core_careteam_sequence.rb | 7 ++++++- .../us_core_medicationrequest_sequence.rb | 7 ++++++- .../us_core_observation_lab_sequence.rb | 7 ++++++- .../us_core_pulse_oximetry_sequence.rb | 7 ++++++- .../us_core_smokingstatus_sequence.rb | 7 ++++++- 9 files changed, 56 insertions(+), 21 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 35844001c..6dacf96ad 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -146,16 +146,9 @@ def create_authorization_test(sequence) return if first_search.nil? search_parameters = first_search[:names] - search_params = if search_parameters == ['patient'] || sequence[:delayed_sequence] || search_param_constants(search_parameters, sequence) - unit_test_params = get_search_param_hash(search_parameters, sequence) - get_search_params(search_parameters, sequence) - else - non_patient_search_param = search_parameters.find { |param| param != 'patient' } - non_patient_value = sequence[:search_param_descriptions][non_patient_search_param.to_sym][:values].first - unit_test_params = { patient: '@instance.patient_id' } - unit_test_params[non_patient_search_param] = non_patient_value - "search_params = { 'patient': @instance.patient_id, '#{non_patient_search_param}': '#{non_patient_value}' }" - end + search_params = get_search_params(search_parameters, sequence, true) + unit_test_params = get_search_param_hash(search_parameters, sequence, true) + authorization_test[:test_code] = %( skip_if_not_supported(:#{sequence[:resource]}, [:search]) @@ -465,8 +458,8 @@ def get_first_search_with_fixed_values(sequence, search_parameters, save_resourc skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found) end - def get_search_params(search_parameters, sequence) - search_params = get_search_param_hash(search_parameters, sequence) + def get_search_params(search_parameters, sequence, grab_first_value = false) + search_params = get_search_param_hash(search_parameters, sequence, grab_first_value) search_param_string = %( search_params = { #{search_params.map { |param, value| search_param_to_string(param, value) }.join(",\n")} @@ -487,7 +480,7 @@ def search_param_to_string(param, value) "'#{param}': #{value_string || value}" end - def get_search_param_hash(search_parameters, sequence) + def get_search_param_hash(search_parameters, sequence, grab_first_value = false) search_params = search_param_constants(search_parameters, sequence) return search_params if search_params.present? @@ -495,6 +488,8 @@ def get_search_param_hash(search_parameters, sequence) params[param] = if param == 'patient' '@instance.patient_id' + elsif grab_first_value && !sequence[:delayed_sequence] + sequence[:search_param_descriptions][param.to_sym][:values].first else resolve_element_path(sequence[:search_param_descriptions][param.to_sym]) end diff --git a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb index 656dd3bf4..5ee49ea16 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb @@ -60,7 +60,12 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'code': '59576-9' } + + search_params = { + 'patient': @instance.patient_id, + 'code': '59576-9' + } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb index 56f7a9c95..8278a9094 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb @@ -60,7 +60,12 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'code': '77606-2' } + + search_params = { + 'patient': @instance.patient_id, + 'code': '77606-2' + } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb index 2b1111d5b..481f675a9 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -56,7 +56,12 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'category': 'assess-plan' } + + search_params = { + 'patient': @instance.patient_id, + 'category': 'assess-plan' + } + reply = get_resource_by_params(versioned_resource_class('CarePlan'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb index 7ffdf11bb..c512dfd26 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb @@ -46,7 +46,12 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'status': 'proposed' } + + search_params = { + 'patient': @instance.patient_id, + 'status': 'proposed' + } + reply = get_resource_by_params(versioned_resource_class('CareTeam'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb index 500e75955..67540dad6 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb @@ -58,7 +58,12 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'intent': 'proposal' } + + search_params = { + 'patient': @instance.patient_id, + 'intent': 'proposal' + } + reply = get_resource_by_params(versioned_resource_class('MedicationRequest'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb index d9c3a5c10..df716c7ff 100644 --- a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb @@ -60,7 +60,12 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'category': 'laboratory' } + + search_params = { + 'patient': @instance.patient_id, + 'category': 'laboratory' + } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb index 974a45310..6c77540e3 100644 --- a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb @@ -60,7 +60,12 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'code': '2708-6' } + + search_params = { + 'patient': @instance.patient_id, + 'code': '2708-6' + } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb index fe204557b..033888fa0 100644 --- a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb @@ -60,7 +60,12 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'code': '72166-2' } + + search_params = { + 'patient': @instance.patient_id, + 'code': '72166-2' + } + reply = get_resource_by_params(versioned_resource_class('Observation'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply From b51b31e6b3e37fd27d4634b1fb62bb796fa1e5cb Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 26 Nov 2019 16:22:34 -0500 Subject: [PATCH 160/173] fixing some rebase errors --- .../unit_tests/authorization_unit_test.rb.erb | 3 +- .../uscore/us_core_unit_test_generator.rb | 5 +- generator/uscore/uscore_generator.rb | 3 +- .../test/fixtures/us_core_goal.json | 26 ++++++++ .../test/fixtures/us_core_location.json | 44 ++++++++++++++ .../test/fixtures/us_core_organization.json | 57 ++++++++++++++++++ .../test/fixtures/us_core_practitioner.json | 45 ++++++++++++++ .../fixtures/us_core_practitionerrole.json | 59 +++++++++++++++++++ .../test/us_core_diagnosticreport_lab_test.rb | 3 +- .../us_core_diagnosticreport_note_test.rb | 3 +- .../test/us_core_location_test.rb | 3 +- .../test/us_core_organization_test.rb | 3 +- .../test/us_core_practitioner_test.rb | 3 +- .../test/us_core_practitionerrole_test.rb | 7 +-- .../us_core_diagnosticreport_lab_sequence.rb | 7 ++- .../us_core_diagnosticreport_note_sequence.rb | 7 ++- 16 files changed, 259 insertions(+), 19 deletions(-) create mode 100755 lib/modules/uscore_v3.1.0/test/fixtures/us_core_goal.json create mode 100755 lib/modules/uscore_v3.1.0/test/fixtures/us_core_location.json create mode 100755 lib/modules/uscore_v3.1.0/test/fixtures/us_core_organization.json create mode 100755 lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitioner.json create mode 100755 lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitionerrole.json diff --git a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb index a324ded1c..f7535d032 100644 --- a/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb +++ b/generator/uscore/templates/unit_tests/authorization_unit_test.rb.erb @@ -4,8 +4,7 @@ describe 'unauthorized search test' do @sequence = @sequence_class.new(@instance, @client) <% if dynamic_search_params.present? %> <% dynamic_search_params.each do |_param, search_param| %> - <%= search_param[:variable_name] %> = load_json_fixture(:<%= "#{name}_#{search_param[:variable_name][1..-1]}" %>) - .map { |resource| FHIR.from_contents(resource.to_json) } + <%= search_param[:variable_name] %> = FHIR.from_contents(load_fixture(:<%= sequence_name %>)) @sequence.instance_variable_set(:'<%= search_param[:variable_name] %>', <%= search_param[:variable_name] %>) <% end %> <% end %> diff --git a/generator/uscore/us_core_unit_test_generator.rb b/generator/uscore/us_core_unit_test_generator.rb index 22af6d5b0..4070b4ff2 100644 --- a/generator/uscore/us_core_unit_test_generator.rb +++ b/generator/uscore/us_core_unit_test_generator.rb @@ -26,13 +26,14 @@ def generate(sequence, path, module_name) File.write(file_name, unit_tests) end - def generate_authorization_test(test_key:, resource_type:, search_params:, class_name:) + def generate_authorization_test(test_key:, resource_type:, search_params:, class_name:, sequence_name:) template = ERB.new(File.read(File.join(__dir__, 'templates', 'unit_tests', 'authorization_unit_test.rb.erb'))) test = template.result_with_hash( test_key: test_key, resource_type: resource_type, search_param_string: search_params_to_string(search_params), - dynamic_search_params: dynamic_search_params(search_params) + dynamic_search_params: dynamic_search_params(search_params), + sequence_name: sequence_name ) tests[class_name] << test end diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 6dacf96ad..716c0c715 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -165,7 +165,8 @@ def create_authorization_test(sequence) test_key: test_key, resource_type: sequence[:resource], search_params: unit_test_params, - class_name: sequence[:class_name] + class_name: sequence[:class_name], + sequence_name: sequence[:name] ) end diff --git a/lib/modules/uscore_v3.1.0/test/fixtures/us_core_goal.json b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_goal.json new file mode 100755 index 000000000..014a80f61 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_goal.json @@ -0,0 +1,26 @@ +{ + "resourceType": "Goal", + "id": "goal-1", + "meta": { + "profile": [ + "http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal" + ] + }, + "text": { + "status": "generated", + "div": "

    Generated Narrative with Details

    id: goal-1

    meta:

    lifecycleStatus: active

    description: Patient is targeting a pulse oximetry of 92% and a weight of 195 lbs (Details )

    subject: Amy Shaw. Generated Summary: id: example; Medical Record Number = 1032702 (USUAL); active; Amy V. Shaw ; ph: 555-555-5555(HOME), amy.shaw@example.com; gender: female; birthDate: 2007-02-20

    Targets

    -Due[x]
    *2016-04-05
    " + }, + "lifecycleStatus": "active", + "description": { + "text": "Patient is targeting a pulse oximetry of 92% and a weight of 195 lbs" + }, + "subject": { + "reference": "Patient/example", + "display": "Amy Shaw" + }, + "target": [ + { + "dueDate": "2016-04-05" + } + ] +} \ No newline at end of file diff --git a/lib/modules/uscore_v3.1.0/test/fixtures/us_core_location.json b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_location.json new file mode 100755 index 000000000..e76477bf9 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_location.json @@ -0,0 +1,44 @@ +{ + "resourceType": "Location", + "id": "hl7east", + "meta": { + "profile": [ + "http://hl7.org/fhir/us/core/StructureDefinition/us-core-location" + ] + }, + "text": { + "status": "generated", + "div": "

    Generated Narrative with Details

    id: hl7east

    meta:

    identifier: 29

    status: active

    name: Health Level Seven International - Amherst

    description: HL7 Headquarters - East

    telecom: ph: (+1) 734-677-7777

    address: 3300 Washtenaw Avenue, Suite 227 Amherst MA 01002 USA

    Positions

    -LongitudeLatitude
    *-72.51985442.373222

    managingOrganization: Health Level Seven International

    " + }, + "identifier": [ + { + "system": "http://www.acme.org/location", + "value": "29" + } + ], + "status": "active", + "name": "Health Level Seven International - Amherst", + "description": "HL7 Headquarters - East", + "telecom": [ + { + "system": "phone", + "value": "(+1) 734-677-7777" + } + ], + "address": { + "line": [ + "3300 Washtenaw Avenue, Suite 227" + ], + "city": "Amherst", + "state": "MA", + "postalCode": "01002", + "country": "USA" + }, + "position": { + "longitude": -72.519854, + "latitude": 42.373222 + }, + "managingOrganization": { + "display": "Health Level Seven International" + } +} \ No newline at end of file diff --git a/lib/modules/uscore_v3.1.0/test/fixtures/us_core_organization.json b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_organization.json new file mode 100755 index 000000000..0f0d9cd83 --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_organization.json @@ -0,0 +1,57 @@ +{ + "resourceType": "Organization", + "id": "acme-lab", + "meta": { + "profile": [ + "http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization" + ] + }, + "text": { + "status": "generated", + "div": "

    Generated Narrative with Details

    id: acme-lab

    meta:

    identifier: 1144221847, 12D4567890

    active: true

    type: Healthcare Provider (Details : {http://terminology.hl7.org/CodeSystem/organization-type code 'prov' = 'Healthcare Provider', given as 'Healthcare Provider'})

    name: Acme Labs

    telecom: ph: (+1) 734-677-7777, hq@acme.org

    address: 3300 Washtenaw Avenue, Suite 227 Amherst MA 01002 USA

    " + }, + "identifier": [ + { + "system": "http://hl7.org.fhir/sid/us-npi", + "value": "1144221847" + }, + { + "system": "urn:oid:2.16.840.1.113883.4.7", + "value": "12D4567890" + } + ], + "active": true, + "type": [ + { + "coding": [ + { + "system": "http://terminology.hl7.org/CodeSystem/organization-type", + "code": "prov", + "display": "Healthcare Provider" + } + ] + } + ], + "name": "Acme Labs", + "telecom": [ + { + "system": "phone", + "value": "(+1) 734-677-7777" + }, + { + "system": "email", + "value": "hq@acme.org" + } + ], + "address": [ + { + "line": [ + "3300 Washtenaw Avenue, Suite 227" + ], + "city": "Amherst", + "state": "MA", + "postalCode": "01002", + "country": "USA" + } + ] +} \ No newline at end of file diff --git a/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitioner.json b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitioner.json new file mode 100755 index 000000000..c1a1bb45b --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitioner.json @@ -0,0 +1,45 @@ +{ + "resourceType": "Practitioner", + "id": "practitioner-1", + "meta": { + "profile": [ + "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner" + ] + }, + "text": { + "status": "generated", + "div": "

    Generated Narrative with Details

    id: practitioner-1

    meta:

    identifier: 9941339108, 25456

    name: Ronald Bone

    address: 1003 Healthcare Drive Amherst MA 01002 (HOME)

    " + }, + "identifier": [ + { + "system": "http://hl7.org.fhir/sid/us-npi", + "value": "9941339108" + }, + { + "system": "http://www.acme.org/practitioners", + "value": "25456" + } + ], + "name": [ + { + "family": "Bone", + "given": [ + "Ronald" + ], + "prefix": [ + "Dr" + ] + } + ], + "address": [ + { + "use": "home", + "line": [ + "1003 Healthcare Drive" + ], + "city": "Amherst", + "state": "MA", + "postalCode": "01002" + } + ] +} \ No newline at end of file diff --git a/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitionerrole.json b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitionerrole.json new file mode 100755 index 000000000..aa436372a --- /dev/null +++ b/lib/modules/uscore_v3.1.0/test/fixtures/us_core_practitionerrole.json @@ -0,0 +1,59 @@ +{ + "resourceType": "PractitionerRole", + "id": "PractitionerRole-1", + "meta": { + "profile": [ + "http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole" + ] + }, + "text": { + "status": "generated", + "div": "

    Generated Narrative with Details

    id: PractitionerRole-1

    meta:

    practitioner: Brenda Jennings Richard MD

    organization: Acme Lab. Generated Summary: id: acme-lab; 1144221847, 12D4567890; active; Healthcare Provider; name: Acme Labs; ph: (+1) 734-677-7777, hq@acme.org

    code: Primary Care (Details : {http://nucc.org/provider-taxonomy code '261QP2300X' = 'Primary Care', given as 'Primary Care'})

    specialty: General Practice (Details : {http://nucc.org/provider-taxonomy code '208D00000X' = 'General Practice', given as 'General Practice'})

    location: Health Level Seven International. Generated Summary: id: hl7east; 29; status: active; name: Health Level Seven International - Amherst; description: HL7 Headquarters - East; ph: (+1) 734-677-7777

    endpoint:

    " + }, + "practitioner": { + "reference": "Practitioner/Practitioner-1011", + "display": "Brenda Jennings Richard MD" + }, + "organization": { + "reference": "Organization/acme-lab", + "display": "Acme Lab" + }, + "code": [ + { + "coding": [ + { + "system": "http://nucc.org/provider-taxonomy", + "code": "261QP2300X", + "display": "Primary Care" + } + ] + } + ], + "specialty": [ + { + "coding": [ + { + "system": "http://nucc.org/provider-taxonomy", + "code": "208D00000X", + "display": "General Practice" + } + ] + } + ], + "location": [ + { + "reference": "Location/hl7east", + "display": "Health Level Seven International" + } + ], + "endpoint": [ + { + "reference": "http://52.90.126.238:8080/fhir/baseDstu3/Endpoint/Endpoint-71", + "display": "Westwood Physicians Organization ADT" + }, + { + "reference": "http://52.90.126.238:8080/fhir/baseDstu3/Endpoint/Endpoint-71", + "display": "Brenda.Jennings.Richard.MD@direct.example.org" + } + ] +} \ No newline at end of file diff --git a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb index d6c78bf6a..72332e6ae 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_lab_test.rb @@ -24,7 +24,8 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'category': 'LAB' } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb index b19fa63e8..011d15a2f 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_diagnosticreport_note_test.rb @@ -24,7 +24,8 @@ @sequence = @sequence_class.new(@instance, @client) @query = { - 'patient': @instance.patient_id + 'patient': @instance.patient_id, + 'category': 'LP29684-5' } end diff --git a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb index 156e82dca..d145a1d2d 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_location_test.rb @@ -111,8 +111,7 @@ @test = @sequence_class[:unauthorized_search] @sequence = @sequence_class.new(@instance, @client) - @location_ary = load_json_fixture(:us_core_location_location_ary) - .map { |resource| FHIR.from_contents(resource.to_json) } + @location_ary = FHIR.from_contents(load_fixture(:us_core_location)) @sequence.instance_variable_set(:'@location_ary', @location_ary) @query = { diff --git a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb index aa015a8e0..ff099e832 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_organization_test.rb @@ -111,8 +111,7 @@ @test = @sequence_class[:unauthorized_search] @sequence = @sequence_class.new(@instance, @client) - @organization_ary = load_json_fixture(:us_core_organization_organization_ary) - .map { |resource| FHIR.from_contents(resource.to_json) } + @organization_ary = FHIR.from_contents(load_fixture(:us_core_organization)) @sequence.instance_variable_set(:'@organization_ary', @organization_ary) @query = { diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb index 9d16faa70..21304d9df 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitioner_test.rb @@ -111,8 +111,7 @@ @test = @sequence_class[:unauthorized_search] @sequence = @sequence_class.new(@instance, @client) - @practitioner_ary = load_json_fixture(:us_core_practitioner_practitioner_ary) - .map { |resource| FHIR.from_contents(resource.to_json) } + @practitioner_ary = FHIR.from_contents(load_fixture(:us_core_practitioner)) @sequence.instance_variable_set(:'@practitioner_ary', @practitioner_ary) @query = { diff --git a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb index a2ed4ef61..03fbc914b 100644 --- a/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb +++ b/lib/modules/uscore_v3.1.0/test/us_core_practitionerrole_test.rb @@ -111,12 +111,11 @@ @test = @sequence_class[:unauthorized_search] @sequence = @sequence_class.new(@instance, @client) - @practitionerrole_ary = load_json_fixture(:us_core_practitionerrole_practitionerrole_ary) - .map { |resource| FHIR.from_contents(resource.to_json) } - @sequence.instance_variable_set(:'@practitionerrole_ary', @practitionerrole_ary) + @practitioner_role_ary = FHIR.from_contents(load_fixture(:us_core_practitionerrole)) + @sequence.instance_variable_set(:'@practitioner_role_ary', @practitioner_role_ary) @query = { - 'specialty': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@practitionerrole_ary, 'specialty')) + 'specialty': @sequence.get_value_for_search_param(@sequence.resolve_element_from_path(@practitioner_role_ary, 'specialty')) } end diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb index 8af088dbc..e7be91559 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -60,7 +60,12 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'category': LAB } + + search_params = { + 'patient': @instance.patient_id, + 'category': 'LAB' + } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb index 1e4038b66..27eb09c34 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -60,7 +60,12 @@ def validate_resource_item(resource, property, value) @client.set_no_auth omit 'Do not test if no bearer token set' if @instance.token.blank? - search_params = { 'patient': @instance.patient_id, 'category': LP29684 - 5 } + + search_params = { + 'patient': @instance.patient_id, + 'category': 'LP29684-5' + } + reply = get_resource_by_params(versioned_resource_class('DiagnosticReport'), search_params) @client.set_bearer_token(@instance.token) assert_response_unauthorized reply From d53e52ea858bf65cd687168195cf8fded589d156 Mon Sep 17 00:00:00 2001 From: Chase Date: Wed, 13 Nov 2019 13:31:21 -0500 Subject: [PATCH 161/173] test descriptions first pass --- generator/uscore/templates/sequence.rb.erb | 1 + generator/uscore/uscore_generator.rb | 62 +++- .../pediatric_bmi_for_age_sequence.rb | 90 ++++- .../pediatric_weight_for_height_sequence.rb | 90 ++++- .../us_core_allergyintolerance_sequence.rb | 29 +- .../us_core_careplan_sequence.rb | 43 ++- .../us_core_careteam_sequence.rb | 28 +- .../us_core_condition_sequence.rb | 41 ++- .../us_core_diagnosticreport_lab_sequence.rb | 55 ++- .../us_core_diagnosticreport_note_sequence.rb | 55 ++- .../us_core_documentreference_sequence.rb | 72 +++- .../us_core_encounter_sequence.rb | 71 +++- .../uscore_v3.1.0/us_core_goal_sequence.rb | 35 +- .../us_core_immunization_sequence.rb | 39 +- .../us_core_implantable_device_sequence.rb | 43 ++- .../us_core_location_sequence.rb | 48 ++- .../us_core_medication_sequence.rb | 16 +- .../us_core_medicationrequest_sequence.rb | 53 ++- .../us_core_observation_lab_sequence.rb | 70 +++- .../us_core_organization_sequence.rb | 49 ++- .../uscore_v3.1.0/us_core_patient_sequence.rb | 76 +++- .../us_core_practitioner_sequence.rb | 33 +- .../us_core_practitionerrole_sequence.rb | 40 ++- .../us_core_procedure_sequence.rb | 39 +- .../us_core_provenance_sequence.rb | 33 +- .../us_core_pulse_oximetry_sequence.rb | 334 +++++++++++++++++- .../us_core_smokingstatus_sequence.rb | 42 ++- 27 files changed, 1548 insertions(+), 39 deletions(-) diff --git a/generator/uscore/templates/sequence.rb.erb b/generator/uscore/templates/sequence.rb.erb index 06d63a17a..849e6b3dd 100644 --- a/generator/uscore/templates/sequence.rb.erb +++ b/generator/uscore/templates/sequence.rb.erb @@ -30,6 +30,7 @@ module Inferno link '<%=test[:link]%>'<%if test[:optional]%> optional<%end%> description %( + <%=test[:description]%> ) versions :r4 end diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 716c0c715..283ea266a 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -109,7 +109,8 @@ def create_read_test(sequence) tests_that: "Can read #{sequence[:resource]} from the server", key: test_key, index: sequence[:tests].length + 1, - link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html', + description: "Reference to #{sequence[:resource]} can be resolved and read." } read_test[:test_code] = %( @@ -139,7 +140,8 @@ def create_authorization_test(sequence) tests_that: "Server rejects #{sequence[:resource]} search without authorization", key: test_key, index: sequence[:tests].length + 1, - link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior', + description: 'A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code.' } first_search = find_first_search(sequence) @@ -174,7 +176,8 @@ def create_include_test(sequence) include_test = { tests_that: "Server returns the appropriate resource from the following _includes: #{sequence[:include_params].join(', ')}", index: sequence[:tests].length + 1, - link: 'https://www.hl7.org/fhir/search.html#include' + link: 'https://www.hl7.org/fhir/search.html#include', + description: "A Server SHOULD be capable of supporting the following _includes: #{sequence[:include_params].join(', ')}" } first_search = find_first_search(sequence) search_params = first_search.nil? ? 'search_params = {}' : get_search_params(first_search[:names], sequence) @@ -198,7 +201,8 @@ def create_revinclude_test(sequence) revinclude_test = { tests_that: "Server returns the appropriate resources from the following _revincludes: #{sequence[:revincludes].join(',')}", index: sequence[:tests].length + 1, - link: 'https://www.hl7.org/fhir/search.html#revinclude' + link: 'https://www.hl7.org/fhir/search.html#revinclude', + description: "A Server SHALL be capable of supporting the following _revincludes: #{sequence[:revincludes].join(', ')}" } first_search = find_first_search(sequence) search_params = first_search.nil? ? "\nsearch_params = {}" : get_search_params(first_search[:names], sequence) @@ -223,9 +227,17 @@ def create_search_test(sequence, search_param) tests_that: "Server returns expected results from #{sequence[:resource]} search by #{search_param[:names].join('+')}", index: sequence[:tests].length + 1, link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html', - optional: search_param[:expectation] != 'SHALL' + optional: search_param[:expectation] != 'SHALL', + description: %( + A server #{search_param[:expectation]} be able to support searching by #{search_param[:names].join('+')} on the #{sequence[:resource]} resource + ) } + find_comparators(search_param[:names], sequence).each do |param, comparators| + search_test[:description] += %( + including support for these #{param} comparators: #{comparators.keys.join(', ')}) + end + is_first_search = search_param == find_first_search(sequence) search_test[:test_code] = @@ -252,7 +264,8 @@ def create_interaction_test(sequence, interaction) tests_that: "#{sequence[:resource]} #{interaction[:code]} interaction supported", key: test_key, index: sequence[:tests].length + 1, - link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html', + description: "All servers #{interaction[:expectation]} make available #{interaction[:code]} interactions on #{sequence[:resource]}" } interaction_test[:test_code] = %( @@ -277,10 +290,19 @@ def create_must_support_test(sequence) test = { tests_that: "At least one of every must support element is provided in any #{sequence[:resource]} for this patient.", index: sequence[:tests].length + 1, - link: 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support', - test_code: '' + link: 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support', + test_code: '', + description: %( + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all #{sequence[:resource]} resources returned from prior searches too see if any of them provide the following must support elements: + ) } + sequence[:must_supports].select { |must_support| must_support[:type] == 'element' }.each do |element| + test[:description] += %( + #{element[:path]} + ) + end test[:test_code] += %( skip 'No resources appear to be available for this patient. Please use patients with more information' unless @#{sequence[:resource].underscore}_ary&.any?) @@ -339,7 +361,10 @@ def create_resource_profile_test(sequence) test = { tests_that: "#{sequence[:resource]} resources associated with Patient conform to US Core R4 profiles", index: sequence[:tests].length + 1, - link: sequence[:profile] + link: sequence[:profile], + description: %( + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification.) } test[:test_code] = %( skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found @@ -352,7 +377,8 @@ def create_references_resolved_test(sequence) test = { tests_that: 'All references can be resolved', index: sequence[:tests].length + 1, - link: 'https://www.hl7.org/fhir/DSTU2/references.html' + link: 'https://www.hl7.org/fhir/DSTU2/references.html', + description: 'This test checks if references found in resources from prior searches can be resolved.' } test[:test_code] = %( @@ -503,12 +529,10 @@ def get_comparator_searches(search_params, sequence) "'#{param}': #{param_value_name(param)}" end search_assignments_str = "{ #{search_assignments.join(', ')} }" - search_params.each do |param| + param_comparators = find_comparators(search_params, sequence) + param_comparators.each do |param, comparators| param_val_name = param_value_name(param) param_info = sequence[:search_param_descriptions][param.to_sym] - comparators = param_info[:comparators].select { |_comparator, expectation| ['SHALL', 'SHOULD'].include? expectation } - next if comparators.empty? - type = param_info[:type] case type when 'Period', 'date' @@ -525,6 +549,16 @@ def get_comparator_searches(search_params, sequence) search_code end + def find_comparators(search_params, sequence) + param_comparators = {} + search_params.each do |param| + param_info = sequence[:search_param_descriptions][param.to_sym] + comparators = param_info[:comparators].select { |_comparator, expectation| ['SHALL', 'SHOULD'].include? expectation } + param_comparators[param] = comparators if comparators.present? + end + param_comparators + end + def search_param_constants(search_parameters, sequence) return { '_id': '@instance.patient_id' } if search_parameters == ['_id'] && sequence[:resource] == 'Patient' end diff --git a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb index 5ee49ea16..85b24a01c 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb @@ -52,6 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Observation search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -76,6 +77,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+code on the Observation resource + ) versions :r4 end @@ -107,6 +111,10 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category+date on the Observation resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -139,6 +147,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category on the Observation resource + ) versions :r4 end @@ -163,6 +174,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+code+date on the Observation resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -196,6 +211,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+category+status on the Observation resource + ) versions :r4 end @@ -221,6 +239,7 @@ def validate_resource_item(resource, property, value) name 'Observation read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Observation ) versions :r4 end @@ -237,6 +256,7 @@ def validate_resource_item(resource, property, value) name 'Observation vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Observation ) versions :r4 end @@ -253,6 +273,7 @@ def validate_resource_item(resource, property, value) name 'Observation history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Observation ) versions :r4 end @@ -268,6 +289,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -291,6 +313,9 @@ def validate_resource_item(resource, property, value) id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-bmi-for-age' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -302,8 +327,70 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Observation for this patient.' do metadata do id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Observation resources returned from prior searches too see if any of them provide the following must support elements: + + Observation.status + + Observation.category + + Observation.category + + Observation.category.coding + + Observation.category.coding.system + + Observation.category.coding.code + + Observation.subject + + Observation.effectiveDateTime + + Observation.effectivePeriod + + Observation.valueQuantity + + Observation.valueQuantity.value + + Observation.valueQuantity.unit + + Observation.valueQuantity.system + + Observation.valueQuantity.code + + Observation.dataAbsentReason + + Observation.component + + Observation.component.code + + Observation.component.valueQuantity + + Observation.component.valueCodeableConcept + + Observation.component.valueString + + Observation.component.valueBoolean + + Observation.component.valueInteger + + Observation.component.valueRange + + Observation.component.valueRatio + + Observation.component.valueSampledData + + Observation.component.valueTime + + Observation.component.valueDateTime + + Observation.component.valuePeriod + + Observation.component.dataAbsentReason + ) versions :r4 end @@ -359,6 +446,7 @@ def validate_resource_item(resource, property, value) id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb index 8278a9094..e43dcbba5 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb @@ -52,6 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Observation search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -76,6 +77,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+code on the Observation resource + ) versions :r4 end @@ -107,6 +111,10 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category+date on the Observation resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -139,6 +147,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category on the Observation resource + ) versions :r4 end @@ -163,6 +174,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+code+date on the Observation resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -196,6 +211,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+category+status on the Observation resource + ) versions :r4 end @@ -221,6 +239,7 @@ def validate_resource_item(resource, property, value) name 'Observation read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Observation ) versions :r4 end @@ -237,6 +256,7 @@ def validate_resource_item(resource, property, value) name 'Observation vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Observation ) versions :r4 end @@ -253,6 +273,7 @@ def validate_resource_item(resource, property, value) name 'Observation history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Observation ) versions :r4 end @@ -268,6 +289,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -291,6 +313,9 @@ def validate_resource_item(resource, property, value) id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/pediatric-weight-for-height' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -302,8 +327,70 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Observation for this patient.' do metadata do id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Observation resources returned from prior searches too see if any of them provide the following must support elements: + + Observation.status + + Observation.category + + Observation.category + + Observation.category.coding + + Observation.category.coding.system + + Observation.category.coding.code + + Observation.subject + + Observation.effectiveDateTime + + Observation.effectivePeriod + + Observation.valueQuantity + + Observation.valueQuantity.value + + Observation.valueQuantity.unit + + Observation.valueQuantity.system + + Observation.valueQuantity.code + + Observation.dataAbsentReason + + Observation.component + + Observation.component.code + + Observation.component.valueQuantity + + Observation.component.valueCodeableConcept + + Observation.component.valueString + + Observation.component.valueBoolean + + Observation.component.valueInteger + + Observation.component.valueRange + + Observation.component.valueRatio + + Observation.component.valueSampledData + + Observation.component.valueTime + + Observation.component.valueDateTime + + Observation.component.valuePeriod + + Observation.component.dataAbsentReason + ) versions :r4 end @@ -359,6 +446,7 @@ def validate_resource_item(resource, property, value) id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb index 2327d0856..cd1b87150 100644 --- a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb @@ -38,6 +38,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects AllergyIntolerance search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -61,6 +62,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient on the AllergyIntolerance resource + ) versions :r4 end @@ -91,6 +95,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+clinical-status on the AllergyIntolerance resource + ) versions :r4 end @@ -115,6 +122,7 @@ def validate_resource_item(resource, property, value) name 'AllergyIntolerance read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on AllergyIntolerance ) versions :r4 end @@ -131,6 +139,7 @@ def validate_resource_item(resource, property, value) name 'AllergyIntolerance vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on AllergyIntolerance ) versions :r4 end @@ -147,6 +156,7 @@ def validate_resource_item(resource, property, value) name 'AllergyIntolerance history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on AllergyIntolerance ) versions :r4 end @@ -162,6 +172,7 @@ def validate_resource_item(resource, property, value) id '07' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -183,6 +194,9 @@ def validate_resource_item(resource, property, value) id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -194,8 +208,20 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any AllergyIntolerance for this patient.' do metadata do id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all AllergyIntolerance resources returned from prior searches too see if any of them provide the following must support elements: + + AllergyIntolerance.clinicalStatus + + AllergyIntolerance.verificationStatus + + AllergyIntolerance.code + + AllergyIntolerance.patient + ) versions :r4 end @@ -226,6 +252,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb index 481f675a9..2f3629d31 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -48,6 +48,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects CarePlan search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -72,6 +73,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category on the CarePlan resource + ) versions :r4 end @@ -104,6 +108,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+category+date on the CarePlan resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -137,6 +145,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+category+status+date on the CarePlan resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -171,6 +183,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+category+status on the CarePlan resource + ) versions :r4 end @@ -196,6 +211,7 @@ def validate_resource_item(resource, property, value) name 'CarePlan read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on CarePlan ) versions :r4 end @@ -212,6 +228,7 @@ def validate_resource_item(resource, property, value) name 'CarePlan vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on CarePlan ) versions :r4 end @@ -228,6 +245,7 @@ def validate_resource_item(resource, property, value) name 'CarePlan history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on CarePlan ) versions :r4 end @@ -243,6 +261,7 @@ def validate_resource_item(resource, property, value) id '09' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -266,6 +285,9 @@ def validate_resource_item(resource, property, value) id '10' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -277,8 +299,26 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any CarePlan for this patient.' do metadata do id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all CarePlan resources returned from prior searches too see if any of them provide the following must support elements: + + CarePlan.text + + CarePlan.text.status + + CarePlan.status + + CarePlan.intent + + CarePlan.category + + CarePlan.category + + CarePlan.subject + ) versions :r4 end @@ -312,6 +352,7 @@ def validate_resource_item(resource, property, value) id '12' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb index c512dfd26..f8ecefb28 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb @@ -38,6 +38,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects CareTeam search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -62,6 +63,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+status on the CareTeam resource + ) versions :r4 end @@ -94,6 +98,7 @@ def validate_resource_item(resource, property, value) name 'CareTeam read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on CareTeam ) versions :r4 end @@ -110,6 +115,7 @@ def validate_resource_item(resource, property, value) name 'CareTeam vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on CareTeam ) versions :r4 end @@ -126,6 +132,7 @@ def validate_resource_item(resource, property, value) name 'CareTeam history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on CareTeam ) versions :r4 end @@ -141,6 +148,7 @@ def validate_resource_item(resource, property, value) id '06' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -164,6 +172,9 @@ def validate_resource_item(resource, property, value) id '07' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careteam' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -175,8 +186,22 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any CareTeam for this patient.' do metadata do id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all CareTeam resources returned from prior searches too see if any of them provide the following must support elements: + + CareTeam.status + + CareTeam.subject + + CareTeam.participant + + CareTeam.participant.role + + CareTeam.participant.member + ) versions :r4 end @@ -208,6 +233,7 @@ def validate_resource_item(resource, property, value) id '09' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb index 0ba5fd9c0..95205694f 100644 --- a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb @@ -52,6 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Condition search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -75,6 +76,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient on the Condition resource + ) versions :r4 end @@ -105,6 +109,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+category on the Condition resource + ) versions :r4 end @@ -129,6 +136,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+onset-date on the Condition resource + + including support for these onset-date comparators: gt, lt, le ) versions :r4 end @@ -161,6 +172,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+clinical-status on the Condition resource + ) versions :r4 end @@ -185,6 +199,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+code on the Condition resource + ) versions :r4 end @@ -209,6 +226,7 @@ def validate_resource_item(resource, property, value) name 'Condition read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Condition ) versions :r4 end @@ -225,6 +243,7 @@ def validate_resource_item(resource, property, value) name 'Condition vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Condition ) versions :r4 end @@ -241,6 +260,7 @@ def validate_resource_item(resource, property, value) name 'Condition history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Condition ) versions :r4 end @@ -256,6 +276,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -277,6 +298,9 @@ def validate_resource_item(resource, property, value) id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -288,8 +312,22 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Condition for this patient.' do metadata do id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Condition resources returned from prior searches too see if any of them provide the following must support elements: + + Condition.clinicalStatus + + Condition.verificationStatus + + Condition.category + + Condition.code + + Condition.subject + ) versions :r4 end @@ -321,6 +359,7 @@ def validate_resource_item(resource, property, value) id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb index e7be91559..00c569a9a 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -52,6 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects DiagnosticReport search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -76,6 +77,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category on the DiagnosticReport resource + ) versions :r4 end @@ -107,6 +111,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient on the DiagnosticReport resource + ) versions :r4 end @@ -128,6 +135,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+code on the DiagnosticReport resource + ) versions :r4 end @@ -151,6 +161,10 @@ def validate_resource_item(resource, property, value) id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category+date on the DiagnosticReport resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -184,6 +198,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+status on the DiagnosticReport resource + ) versions :r4 end @@ -208,6 +225,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+code+date on the DiagnosticReport resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -241,6 +262,7 @@ def validate_resource_item(resource, property, value) name 'DiagnosticReport read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on DiagnosticReport ) versions :r4 end @@ -257,6 +279,7 @@ def validate_resource_item(resource, property, value) name 'DiagnosticReport vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on DiagnosticReport ) versions :r4 end @@ -273,6 +296,7 @@ def validate_resource_item(resource, property, value) name 'DiagnosticReport history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on DiagnosticReport ) versions :r4 end @@ -288,6 +312,7 @@ def validate_resource_item(resource, property, value) id '11' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -311,6 +336,9 @@ def validate_resource_item(resource, property, value) id '12' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -322,8 +350,32 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do metadata do id '13' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all DiagnosticReport resources returned from prior searches too see if any of them provide the following must support elements: + + DiagnosticReport.status + + DiagnosticReport.category + + DiagnosticReport.category + + DiagnosticReport.code + + DiagnosticReport.subject + + DiagnosticReport.effectiveDateTime + + DiagnosticReport.effectivePeriod + + DiagnosticReport.issued + + DiagnosticReport.performer + + DiagnosticReport.result + ) versions :r4 end @@ -360,6 +412,7 @@ def validate_resource_item(resource, property, value) id '14' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb index 27eb09c34..6e956541c 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -52,6 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects DiagnosticReport search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -76,6 +77,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category on the DiagnosticReport resource + ) versions :r4 end @@ -107,6 +111,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient on the DiagnosticReport resource + ) versions :r4 end @@ -128,6 +135,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+code on the DiagnosticReport resource + ) versions :r4 end @@ -151,6 +161,10 @@ def validate_resource_item(resource, property, value) id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category+date on the DiagnosticReport resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -184,6 +198,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+status on the DiagnosticReport resource + ) versions :r4 end @@ -208,6 +225,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+code+date on the DiagnosticReport resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -241,6 +262,7 @@ def validate_resource_item(resource, property, value) name 'DiagnosticReport read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on DiagnosticReport ) versions :r4 end @@ -257,6 +279,7 @@ def validate_resource_item(resource, property, value) name 'DiagnosticReport vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on DiagnosticReport ) versions :r4 end @@ -273,6 +296,7 @@ def validate_resource_item(resource, property, value) name 'DiagnosticReport history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on DiagnosticReport ) versions :r4 end @@ -288,6 +312,7 @@ def validate_resource_item(resource, property, value) id '11' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -311,6 +336,9 @@ def validate_resource_item(resource, property, value) id '12' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -322,8 +350,32 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any DiagnosticReport for this patient.' do metadata do id '13' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all DiagnosticReport resources returned from prior searches too see if any of them provide the following must support elements: + + DiagnosticReport.status + + DiagnosticReport.category + + DiagnosticReport.code + + DiagnosticReport.subject + + DiagnosticReport.encounter + + DiagnosticReport.effectiveDateTime + + DiagnosticReport.effectivePeriod + + DiagnosticReport.issued + + DiagnosticReport.performer + + DiagnosticReport.presentedForm + ) versions :r4 end @@ -360,6 +412,7 @@ def validate_resource_item(resource, property, value) id '14' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb index 831488d6d..50c5cf373 100644 --- a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb @@ -60,6 +60,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects DocumentReference search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -83,6 +84,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient on the DocumentReference resource + ) versions :r4 end @@ -112,6 +116,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by _id on the DocumentReference resource + ) versions :r4 end @@ -134,6 +141,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+type on the DocumentReference resource + ) versions :r4 end @@ -157,6 +167,10 @@ def validate_resource_item(resource, property, value) id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category+date on the DocumentReference resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -181,6 +195,9 @@ def validate_resource_item(resource, property, value) id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category on the DocumentReference resource + ) versions :r4 end @@ -205,6 +222,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+type+period on the DocumentReference resource + + including support for these period comparators: gt, lt, le ) versions :r4 end @@ -238,6 +259,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+status on the DocumentReference resource + ) versions :r4 end @@ -262,6 +286,7 @@ def validate_resource_item(resource, property, value) name 'DocumentReference read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on DocumentReference ) versions :r4 end @@ -278,6 +303,7 @@ def validate_resource_item(resource, property, value) name 'DocumentReference vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on DocumentReference ) versions :r4 end @@ -294,6 +320,7 @@ def validate_resource_item(resource, property, value) name 'DocumentReference history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on DocumentReference ) versions :r4 end @@ -309,6 +336,7 @@ def validate_resource_item(resource, property, value) id '12' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -330,6 +358,9 @@ def validate_resource_item(resource, property, value) id '13' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -341,8 +372,46 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any DocumentReference for this patient.' do metadata do id '14' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all DocumentReference resources returned from prior searches too see if any of them provide the following must support elements: + + DocumentReference.identifier + + DocumentReference.status + + DocumentReference.type + + DocumentReference.category + + DocumentReference.subject + + DocumentReference.date + + DocumentReference.author + + DocumentReference.custodian + + DocumentReference.content + + DocumentReference.content.attachment + + DocumentReference.content.attachment.contentType + + DocumentReference.content.attachment.data + + DocumentReference.content.attachment.url + + DocumentReference.content.format + + DocumentReference.context + + DocumentReference.context.encounter + + DocumentReference.context.period + ) versions :r4 end @@ -386,6 +455,7 @@ def validate_resource_item(resource, property, value) id '15' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb index 9fbc6db80..efa99e757 100644 --- a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb @@ -60,6 +60,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Encounter search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -83,6 +84,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient on the Encounter resource + ) versions :r4 end @@ -112,6 +116,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by _id on the Encounter resource + ) versions :r4 end @@ -134,6 +141,10 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by date+patient on the Encounter resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -166,6 +177,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by identifier on the Encounter resource + ) versions :r4 end @@ -189,6 +203,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+status on the Encounter resource + ) versions :r4 end @@ -213,6 +230,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by class+patient on the Encounter resource + ) versions :r4 end @@ -237,6 +257,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+type on the Encounter resource + ) versions :r4 end @@ -261,6 +284,7 @@ def validate_resource_item(resource, property, value) name 'Encounter read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Encounter ) versions :r4 end @@ -277,6 +301,7 @@ def validate_resource_item(resource, property, value) name 'Encounter vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Encounter ) versions :r4 end @@ -293,6 +318,7 @@ def validate_resource_item(resource, property, value) name 'Encounter history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Encounter ) versions :r4 end @@ -308,6 +334,7 @@ def validate_resource_item(resource, property, value) id '12' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -329,6 +356,9 @@ def validate_resource_item(resource, property, value) id '13' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -340,8 +370,46 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Encounter for this patient.' do metadata do id '14' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Encounter resources returned from prior searches too see if any of them provide the following must support elements: + + Encounter.identifier + + Encounter.identifier.system + + Encounter.identifier.value + + Encounter.status + + Encounter.class + + Encounter.type + + Encounter.subject + + Encounter.participant + + Encounter.participant.type + + Encounter.participant.period + + Encounter.participant.individual + + Encounter.period + + Encounter.reasonCode + + Encounter.hospitalization + + Encounter.hospitalization.dischargeDisposition + + Encounter.location + + Encounter.location.location + ) versions :r4 end @@ -385,6 +453,7 @@ def validate_resource_item(resource, property, value) id '15' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb index 7bf44921a..70ecddb71 100644 --- a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb @@ -44,6 +44,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Goal search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -67,6 +68,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient on the Goal resource + ) versions :r4 end @@ -97,6 +101,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+target-date on the Goal resource + + including support for these target-date comparators: gt, lt, le ) versions :r4 end @@ -129,6 +137,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+lifecycle-status on the Goal resource + ) versions :r4 end @@ -153,6 +164,7 @@ def validate_resource_item(resource, property, value) name 'Goal read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Goal ) versions :r4 end @@ -169,6 +181,7 @@ def validate_resource_item(resource, property, value) name 'Goal vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Goal ) versions :r4 end @@ -185,6 +198,7 @@ def validate_resource_item(resource, property, value) name 'Goal history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Goal ) versions :r4 end @@ -200,6 +214,7 @@ def validate_resource_item(resource, property, value) id '08' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -221,6 +236,9 @@ def validate_resource_item(resource, property, value) id '09' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-goal' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -232,8 +250,22 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Goal for this patient.' do metadata do id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Goal resources returned from prior searches too see if any of them provide the following must support elements: + + Goal.lifecycleStatus + + Goal.description + + Goal.subject + + Goal.target + + Goal.target.dueDate + ) versions :r4 end @@ -265,6 +297,7 @@ def validate_resource_item(resource, property, value) id '11' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb index e8205b13f..6f49f4472 100644 --- a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb @@ -44,6 +44,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Immunization search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -67,6 +68,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient on the Immunization resource + ) versions :r4 end @@ -97,6 +101,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+date on the Immunization resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -129,6 +137,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+status on the Immunization resource + ) versions :r4 end @@ -153,6 +164,7 @@ def validate_resource_item(resource, property, value) name 'Immunization read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Immunization ) versions :r4 end @@ -169,6 +181,7 @@ def validate_resource_item(resource, property, value) name 'Immunization vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Immunization ) versions :r4 end @@ -185,6 +198,7 @@ def validate_resource_item(resource, property, value) name 'Immunization history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Immunization ) versions :r4 end @@ -200,6 +214,7 @@ def validate_resource_item(resource, property, value) id '08' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -221,6 +236,9 @@ def validate_resource_item(resource, property, value) id '09' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-immunization' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -232,8 +250,26 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Immunization for this patient.' do metadata do id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Immunization resources returned from prior searches too see if any of them provide the following must support elements: + + Immunization.status + + Immunization.statusReason + + Immunization.vaccineCode + + Immunization.patient + + Immunization.occurrenceDateTime + + Immunization.occurrenceString + + Immunization.primarySource + ) versions :r4 end @@ -267,6 +303,7 @@ def validate_resource_item(resource, property, value) id '11' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb index 4d064c0fb..0c923c14e 100644 --- a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb @@ -38,6 +38,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Device search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -61,6 +62,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient on the Device resource + ) versions :r4 end @@ -91,6 +95,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+type on the Device resource + ) versions :r4 end @@ -115,6 +122,7 @@ def validate_resource_item(resource, property, value) name 'Device read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Device ) versions :r4 end @@ -131,6 +139,7 @@ def validate_resource_item(resource, property, value) name 'Device vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Device ) versions :r4 end @@ -147,6 +156,7 @@ def validate_resource_item(resource, property, value) name 'Device history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Device ) versions :r4 end @@ -162,6 +172,7 @@ def validate_resource_item(resource, property, value) id '07' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -183,6 +194,9 @@ def validate_resource_item(resource, property, value) id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-implantable-device' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -194,8 +208,34 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Device for this patient.' do metadata do id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Device resources returned from prior searches too see if any of them provide the following must support elements: + + Device.udiCarrier + + Device.udiCarrier.deviceIdentifier + + Device.udiCarrier.carrierAIDC + + Device.udiCarrier.carrierHRF + + Device.distinctIdentifier + + Device.manufactureDate + + Device.expirationDate + + Device.lotNumber + + Device.serialNumber + + Device.type + + Device.patient + ) versions :r4 end @@ -233,6 +273,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb index 3941f7979..f84506ab8 100644 --- a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb @@ -57,6 +57,7 @@ def validate_resource_item(resource, property, value) name 'Can read Location from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + Reference to Location can be resolved and read. ) versions :r4 end @@ -80,6 +81,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Location search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -104,6 +106,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by name on the Location resource + ) versions :r4 end @@ -134,6 +139,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by address on the Location resource + ) versions :r4 end @@ -157,6 +165,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by address-city on the Location resource + ) versions :r4 end @@ -180,6 +191,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by address-state on the Location resource + ) versions :r4 end @@ -203,6 +217,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by address-postalcode on the Location resource + ) versions :r4 end @@ -226,6 +243,7 @@ def validate_resource_item(resource, property, value) name 'Location vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Location ) versions :r4 end @@ -242,6 +260,7 @@ def validate_resource_item(resource, property, value) name 'Location history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Location ) versions :r4 end @@ -257,6 +276,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -279,6 +299,9 @@ def validate_resource_item(resource, property, value) id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-location' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -290,8 +313,30 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Location for this patient.' do metadata do id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Location resources returned from prior searches too see if any of them provide the following must support elements: + + Location.status + + Location.name + + Location.telecom + + Location.address + + Location.address.line + + Location.address.city + + Location.address.state + + Location.address.postalCode + + Location.managingOrganization + ) versions :r4 end @@ -327,6 +372,7 @@ def validate_resource_item(resource, property, value) id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb index 58f54e25e..6eb03bf9d 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb @@ -25,6 +25,7 @@ class USCore310MedicationSequence < SequenceBase name 'Can read Medication from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + Reference to Medication can be resolved and read. ) versions :r4 end @@ -48,6 +49,7 @@ class USCore310MedicationSequence < SequenceBase name 'Medication vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Medication ) versions :r4 end @@ -64,6 +66,7 @@ class USCore310MedicationSequence < SequenceBase name 'Medication history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Medication ) versions :r4 end @@ -79,6 +82,7 @@ class USCore310MedicationSequence < SequenceBase id '04' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -97,6 +101,9 @@ class USCore310MedicationSequence < SequenceBase id '05' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -108,8 +115,14 @@ class USCore310MedicationSequence < SequenceBase test 'At least one of every must support element is provided in any Medication for this patient.' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Medication resources returned from prior searches too see if any of them provide the following must support elements: + + Medication.code + ) versions :r4 end @@ -137,6 +150,7 @@ class USCore310MedicationSequence < SequenceBase id '07' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb index 67540dad6..4c5c4ae72 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb @@ -50,6 +50,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects MedicationRequest search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -74,6 +75,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+intent on the MedicationRequest resource + ) versions :r4 end @@ -105,6 +109,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+intent+status on the MedicationRequest resource + ) versions :r4 end @@ -130,6 +137,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+intent+encounter on the MedicationRequest resource + ) versions :r4 end @@ -155,6 +165,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+intent+authoredon on the MedicationRequest resource + + including support for these authoredon comparators: gt, lt, le ) versions :r4 end @@ -180,6 +194,7 @@ def validate_resource_item(resource, property, value) name 'MedicationRequest read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on MedicationRequest ) versions :r4 end @@ -196,6 +211,7 @@ def validate_resource_item(resource, property, value) name 'MedicationRequest vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on MedicationRequest ) versions :r4 end @@ -212,6 +228,7 @@ def validate_resource_item(resource, property, value) name 'MedicationRequest history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on MedicationRequest ) versions :r4 end @@ -227,6 +244,7 @@ def validate_resource_item(resource, property, value) id '09' link 'https://www.hl7.org/fhir/search.html#include' description %( + A Server SHOULD be capable of supporting the following _includes: MedicationRequest:medication ) versions :r4 end @@ -250,6 +268,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -273,6 +292,9 @@ def validate_resource_item(resource, property, value) id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -284,8 +306,36 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any MedicationRequest for this patient.' do metadata do id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all MedicationRequest resources returned from prior searches too see if any of them provide the following must support elements: + + MedicationRequest.status + + MedicationRequest.intent + + MedicationRequest.reportedBoolean + + MedicationRequest.reportedReference + + MedicationRequest.medicationCodeableConcept + + MedicationRequest.medicationReference + + MedicationRequest.subject + + MedicationRequest.encounter + + MedicationRequest.authoredOn + + MedicationRequest.requester + + MedicationRequest.dosageInstruction + + MedicationRequest.dosageInstruction.text + ) versions :r4 end @@ -324,6 +374,7 @@ def validate_resource_item(resource, property, value) id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb index df716c7ff..fd8bd2d49 100644 --- a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb @@ -52,6 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Observation search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -76,6 +77,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category on the Observation resource + ) versions :r4 end @@ -107,6 +111,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+code on the Observation resource + ) versions :r4 end @@ -130,6 +137,10 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category+date on the Observation resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -163,6 +174,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+code+date on the Observation resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -196,6 +211,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+category+status on the Observation resource + ) versions :r4 end @@ -221,6 +239,7 @@ def validate_resource_item(resource, property, value) name 'Observation read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Observation ) versions :r4 end @@ -237,6 +256,7 @@ def validate_resource_item(resource, property, value) name 'Observation vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Observation ) versions :r4 end @@ -253,6 +273,7 @@ def validate_resource_item(resource, property, value) name 'Observation history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Observation ) versions :r4 end @@ -268,6 +289,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -291,6 +313,9 @@ def validate_resource_item(resource, property, value) id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -302,8 +327,50 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Observation for this patient.' do metadata do id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Observation resources returned from prior searches too see if any of them provide the following must support elements: + + Observation.status + + Observation.category + + Observation.category + + Observation.code + + Observation.subject + + Observation.effectiveDateTime + + Observation.effectivePeriod + + Observation.valueQuantity + + Observation.valueCodeableConcept + + Observation.valueString + + Observation.valueBoolean + + Observation.valueInteger + + Observation.valueRange + + Observation.valueRatio + + Observation.valueSampledData + + Observation.valueTime + + Observation.valueDateTime + + Observation.valuePeriod + + Observation.dataAbsentReason + ) versions :r4 end @@ -349,6 +416,7 @@ def validate_resource_item(resource, property, value) id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb index fe0bd9a75..f6f6fc970 100644 --- a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb @@ -45,6 +45,7 @@ def validate_resource_item(resource, property, value) name 'Can read Organization from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + Reference to Organization can be resolved and read. ) versions :r4 end @@ -68,6 +69,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Organization search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -92,6 +94,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by name on the Organization resource + ) versions :r4 end @@ -122,6 +127,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by address on the Organization resource + ) versions :r4 end @@ -145,6 +153,7 @@ def validate_resource_item(resource, property, value) name 'Organization vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Organization ) versions :r4 end @@ -161,6 +170,7 @@ def validate_resource_item(resource, property, value) name 'Organization history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Organization ) versions :r4 end @@ -176,6 +186,7 @@ def validate_resource_item(resource, property, value) id '07' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -198,6 +209,9 @@ def validate_resource_item(resource, property, value) id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -209,8 +223,40 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Organization for this patient.' do metadata do id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Organization resources returned from prior searches too see if any of them provide the following must support elements: + + Organization.identifier + + Organization.identifier.system + + Organization.identifier.value + + Organization.identifier + + Organization.identifier + + Organization.active + + Organization.name + + Organization.telecom + + Organization.address + + Organization.address.line + + Organization.address.city + + Organization.address.state + + Organization.address.postalCode + + Organization.address.country + ) versions :r4 end @@ -251,6 +297,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb index f128f69d7..4b7238fef 100644 --- a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb @@ -67,6 +67,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Patient search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -90,6 +91,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by _id on the Patient resource + ) versions :r4 end @@ -119,6 +123,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by identifier on the Patient resource + ) versions :r4 end @@ -141,6 +148,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by name on the Patient resource + ) versions :r4 end @@ -163,6 +173,9 @@ def validate_resource_item(resource, property, value) id '05' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by gender+name on the Patient resource + ) versions :r4 end @@ -186,6 +199,9 @@ def validate_resource_item(resource, property, value) id '06' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by birthdate+name on the Patient resource + ) versions :r4 end @@ -210,6 +226,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by birthdate+family on the Patient resource + ) versions :r4 end @@ -234,6 +253,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by family+gender on the Patient resource + ) versions :r4 end @@ -258,6 +280,7 @@ def validate_resource_item(resource, property, value) name 'Patient read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Patient ) versions :r4 end @@ -274,6 +297,7 @@ def validate_resource_item(resource, property, value) name 'Patient vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Patient ) versions :r4 end @@ -290,6 +314,7 @@ def validate_resource_item(resource, property, value) name 'Patient history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Patient ) versions :r4 end @@ -305,6 +330,7 @@ def validate_resource_item(resource, property, value) id '12' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -326,6 +352,9 @@ def validate_resource_item(resource, property, value) id '13' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -337,8 +366,52 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Patient for this patient.' do metadata do id '14' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Patient resources returned from prior searches too see if any of them provide the following must support elements: + + Patient.identifier + + Patient.identifier.system + + Patient.identifier.value + + Patient.name + + Patient.name.family + + Patient.name.given + + Patient.telecom + + Patient.telecom.system + + Patient.telecom.value + + Patient.telecom.use + + Patient.gender + + Patient.birthDate + + Patient.address + + Patient.address.line + + Patient.address.city + + Patient.address.state + + Patient.address.postalCode + + Patient.address.period + + Patient.communication + + Patient.communication.language + ) versions :r4 end @@ -399,6 +472,7 @@ def validate_resource_item(resource, property, value) id '15' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb index 8894ee4b7..ff5fc329a 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb @@ -46,6 +46,7 @@ def validate_resource_item(resource, property, value) name 'Can read Practitioner from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + Reference to Practitioner can be resolved and read. ) versions :r4 end @@ -69,6 +70,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Practitioner search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -93,6 +95,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by name on the Practitioner resource + ) versions :r4 end @@ -123,6 +128,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by identifier on the Practitioner resource + ) versions :r4 end @@ -146,6 +154,7 @@ def validate_resource_item(resource, property, value) name 'Practitioner vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Practitioner ) versions :r4 end @@ -162,6 +171,7 @@ def validate_resource_item(resource, property, value) name 'Practitioner history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Practitioner ) versions :r4 end @@ -177,6 +187,7 @@ def validate_resource_item(resource, property, value) id '07' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -199,6 +210,9 @@ def validate_resource_item(resource, property, value) id '08' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -210,8 +224,24 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Practitioner for this patient.' do metadata do id '09' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Practitioner resources returned from prior searches too see if any of them provide the following must support elements: + + Practitioner.identifier + + Practitioner.identifier.system + + Practitioner.identifier.value + + Practitioner.identifier + + Practitioner.name + + Practitioner.name.family + ) versions :r4 end @@ -244,6 +274,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb index 365402fb6..227c2ab35 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb @@ -39,6 +39,7 @@ def validate_resource_item(resource, property, value) name 'Can read PractitionerRole from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + Reference to PractitionerRole can be resolved and read. ) versions :r4 end @@ -62,6 +63,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects PractitionerRole search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -86,6 +88,9 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by specialty on the PractitionerRole resource + ) versions :r4 end @@ -116,6 +121,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by practitioner on the PractitionerRole resource + ) versions :r4 end @@ -139,6 +147,7 @@ def validate_resource_item(resource, property, value) name 'PractitionerRole vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on PractitionerRole ) versions :r4 end @@ -155,6 +164,7 @@ def validate_resource_item(resource, property, value) name 'PractitionerRole history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on PractitionerRole ) versions :r4 end @@ -170,6 +180,7 @@ def validate_resource_item(resource, property, value) id '07' link 'https://www.hl7.org/fhir/search.html#include' description %( + A Server SHOULD be capable of supporting the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner ) versions :r4 end @@ -199,6 +210,7 @@ def validate_resource_item(resource, property, value) id '08' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -221,6 +233,9 @@ def validate_resource_item(resource, property, value) id '09' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -232,8 +247,30 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any PractitionerRole for this patient.' do metadata do id '10' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all PractitionerRole resources returned from prior searches too see if any of them provide the following must support elements: + + PractitionerRole.practitioner + + PractitionerRole.organization + + PractitionerRole.code + + PractitionerRole.specialty + + PractitionerRole.location + + PractitionerRole.telecom + + PractitionerRole.telecom.system + + PractitionerRole.telecom.value + + PractitionerRole.endpoint + ) versions :r4 end @@ -269,6 +306,7 @@ def validate_resource_item(resource, property, value) id '11' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb index a4fc9f474..8c9a3fe92 100644 --- a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb @@ -48,6 +48,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Procedure search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -71,6 +72,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient on the Procedure resource + ) versions :r4 end @@ -100,6 +104,10 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+date on the Procedure resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -132,6 +140,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+code+date on the Procedure resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -165,6 +177,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+status on the Procedure resource + ) versions :r4 end @@ -189,6 +204,7 @@ def validate_resource_item(resource, property, value) name 'Procedure read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Procedure ) versions :r4 end @@ -205,6 +221,7 @@ def validate_resource_item(resource, property, value) name 'Procedure vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Procedure ) versions :r4 end @@ -221,6 +238,7 @@ def validate_resource_item(resource, property, value) name 'Procedure history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Procedure ) versions :r4 end @@ -236,6 +254,7 @@ def validate_resource_item(resource, property, value) id '09' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -257,6 +276,9 @@ def validate_resource_item(resource, property, value) id '10' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -268,8 +290,22 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Procedure for this patient.' do metadata do id '11' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Procedure resources returned from prior searches too see if any of them provide the following must support elements: + + Procedure.status + + Procedure.code + + Procedure.subject + + Procedure.performedDateTime + + Procedure.performedPeriod + ) versions :r4 end @@ -301,6 +337,7 @@ def validate_resource_item(resource, property, value) id '12' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb index 1313536dd..327ca1854 100644 --- a/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb @@ -25,6 +25,7 @@ class USCore310ProvenanceSequence < SequenceBase name 'Can read Provenance from the server' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + Reference to Provenance can be resolved and read. ) versions :r4 end @@ -48,6 +49,7 @@ class USCore310ProvenanceSequence < SequenceBase name 'Provenance vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Provenance ) versions :r4 end @@ -64,6 +66,7 @@ class USCore310ProvenanceSequence < SequenceBase name 'Provenance history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Provenance ) versions :r4 end @@ -79,6 +82,9 @@ class USCore310ProvenanceSequence < SequenceBase id '04' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-provenance' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -90,8 +96,32 @@ class USCore310ProvenanceSequence < SequenceBase test 'At least one of every must support element is provided in any Provenance for this patient.' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Provenance resources returned from prior searches too see if any of them provide the following must support elements: + + Provenance.target + + Provenance.recorded + + Provenance.agent + + Provenance.agent.type + + Provenance.agent.who + + Provenance.agent.onBehalfOf + + Provenance.agent + + Provenance.agent.type + + Provenance.agent + + Provenance.agent.type + ) versions :r4 end @@ -128,6 +158,7 @@ class USCore310ProvenanceSequence < SequenceBase id '06' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb index 6c77540e3..eb3c5e9d7 100644 --- a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb @@ -52,6 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Observation search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -76,6 +77,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+code on the Observation resource + ) versions :r4 end @@ -107,6 +111,10 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category+date on the Observation resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -139,6 +147,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category on the Observation resource + ) versions :r4 end @@ -163,6 +174,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+code+date on the Observation resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -196,6 +211,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+category+status on the Observation resource + ) versions :r4 end @@ -221,6 +239,7 @@ def validate_resource_item(resource, property, value) name 'Observation read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Observation ) versions :r4 end @@ -237,6 +256,7 @@ def validate_resource_item(resource, property, value) name 'Observation vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Observation ) versions :r4 end @@ -253,6 +273,7 @@ def validate_resource_item(resource, property, value) name 'Observation history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Observation ) versions :r4 end @@ -268,6 +289,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -291,6 +313,9 @@ def validate_resource_item(resource, property, value) id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-pulse-oximetry' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -302,8 +327,314 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Observation for this patient.' do metadata do id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Observation resources returned from prior searches too see if any of them provide the following must support elements: + + Observation.status + + Observation.category + + Observation.category + + Observation.category.coding + + Observation.category.coding.system + + Observation.category.coding.code + + Observation.code + + Observation.code.coding + + Observation.code.coding + + Observation.code.coding.system + + Observation.code.coding.code + + Observation.subject + + Observation.effectiveDateTime + + Observation.effectivePeriod + + Observation.valueQuantity + + Observation.valueQuantity + + Observation.valueQuantity.value + + Observation.valueQuantity.unit + + Observation.valueQuantity.system + + Observation.valueQuantity.code + + Observation.dataAbsentReason + + Observation.component + + Observation.component.code + + Observation.component.valueQuantity + + Observation.component.valueCodeableConcept + + Observation.component.valueString + + Observation.component.valueBoolean + + Observation.component.valueInteger + + Observation.component.valueRange + + Observation.component.valueRatio + + Observation.component.valueSampledData + + Observation.component.valueTime + + Observation.component.valueDateTime + + Observation.component.valuePeriod + + Observation.component.dataAbsentReason + + Observation.component + + Observation.component.code + + Observation.component.valueQuantity + + Observation.component.valueCodeableConcept + + Observation.component.valueString + + Observation.component.valueBoolean + + Observation.component.valueInteger + + Observation.component.valueRange + + Observation.component.valueRatio + + Observation.component.valueSampledData + + Observation.component.valueTime + + Observation.component.valueDateTime + + Observation.component.valuePeriod + + Observation.component.valueQuantity.value + + Observation.component.valueCodeableConcept.value + + Observation.component.valueString.value + + Observation.component.valueBoolean.value + + Observation.component.valueInteger.value + + Observation.component.valueRange.value + + Observation.component.valueRatio.value + + Observation.component.valueSampledData.value + + Observation.component.valueTime.value + + Observation.component.valueDateTime.value + + Observation.component.valuePeriod.value + + Observation.component.valueQuantity.unit + + Observation.component.valueCodeableConcept.unit + + Observation.component.valueString.unit + + Observation.component.valueBoolean.unit + + Observation.component.valueInteger.unit + + Observation.component.valueRange.unit + + Observation.component.valueRatio.unit + + Observation.component.valueSampledData.unit + + Observation.component.valueTime.unit + + Observation.component.valueDateTime.unit + + Observation.component.valuePeriod.unit + + Observation.component.valueQuantity.system + + Observation.component.valueCodeableConcept.system + + Observation.component.valueString.system + + Observation.component.valueBoolean.system + + Observation.component.valueInteger.system + + Observation.component.valueRange.system + + Observation.component.valueRatio.system + + Observation.component.valueSampledData.system + + Observation.component.valueTime.system + + Observation.component.valueDateTime.system + + Observation.component.valuePeriod.system + + Observation.component.valueQuantity.code + + Observation.component.valueCodeableConcept.code + + Observation.component.valueString.code + + Observation.component.valueBoolean.code + + Observation.component.valueInteger.code + + Observation.component.valueRange.code + + Observation.component.valueRatio.code + + Observation.component.valueSampledData.code + + Observation.component.valueTime.code + + Observation.component.valueDateTime.code + + Observation.component.valuePeriod.code + + Observation.component.dataAbsentReason + + Observation.component + + Observation.component.code + + Observation.component.valueQuantity + + Observation.component.valueCodeableConcept + + Observation.component.valueString + + Observation.component.valueBoolean + + Observation.component.valueInteger + + Observation.component.valueRange + + Observation.component.valueRatio + + Observation.component.valueSampledData + + Observation.component.valueTime + + Observation.component.valueDateTime + + Observation.component.valuePeriod + + Observation.component.valueQuantity.value + + Observation.component.valueCodeableConcept.value + + Observation.component.valueString.value + + Observation.component.valueBoolean.value + + Observation.component.valueInteger.value + + Observation.component.valueRange.value + + Observation.component.valueRatio.value + + Observation.component.valueSampledData.value + + Observation.component.valueTime.value + + Observation.component.valueDateTime.value + + Observation.component.valuePeriod.value + + Observation.component.valueQuantity.unit + + Observation.component.valueCodeableConcept.unit + + Observation.component.valueString.unit + + Observation.component.valueBoolean.unit + + Observation.component.valueInteger.unit + + Observation.component.valueRange.unit + + Observation.component.valueRatio.unit + + Observation.component.valueSampledData.unit + + Observation.component.valueTime.unit + + Observation.component.valueDateTime.unit + + Observation.component.valuePeriod.unit + + Observation.component.valueQuantity.system + + Observation.component.valueCodeableConcept.system + + Observation.component.valueString.system + + Observation.component.valueBoolean.system + + Observation.component.valueInteger.system + + Observation.component.valueRange.system + + Observation.component.valueRatio.system + + Observation.component.valueSampledData.system + + Observation.component.valueTime.system + + Observation.component.valueDateTime.system + + Observation.component.valuePeriod.system + + Observation.component.valueQuantity.code + + Observation.component.valueCodeableConcept.code + + Observation.component.valueString.code + + Observation.component.valueBoolean.code + + Observation.component.valueInteger.code + + Observation.component.valueRange.code + + Observation.component.valueRatio.code + + Observation.component.valueSampledData.code + + Observation.component.valueTime.code + + Observation.component.valueDateTime.code + + Observation.component.valuePeriod.code + + Observation.component.dataAbsentReason + ) versions :r4 end @@ -481,6 +812,7 @@ def validate_resource_item(resource, property, value) id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb index 033888fa0..30172785a 100644 --- a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb @@ -52,6 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Observation search without authorization' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' description %( + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end @@ -76,6 +77,9 @@ def validate_resource_item(resource, property, value) id '02' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+code on the Observation resource + ) versions :r4 end @@ -107,6 +111,10 @@ def validate_resource_item(resource, property, value) id '03' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category+date on the Observation resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -139,6 +147,9 @@ def validate_resource_item(resource, property, value) id '04' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + + A server SHALL be able to support searching by patient+category on the Observation resource + ) versions :r4 end @@ -163,6 +174,10 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+code+date on the Observation resource + + including support for these date comparators: gt, lt, le ) versions :r4 end @@ -196,6 +211,9 @@ def validate_resource_item(resource, property, value) link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' optional description %( + + A server SHOULD be able to support searching by patient+category+status on the Observation resource + ) versions :r4 end @@ -221,6 +239,7 @@ def validate_resource_item(resource, property, value) name 'Observation read interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHALL make available read interactions on Observation ) versions :r4 end @@ -237,6 +256,7 @@ def validate_resource_item(resource, property, value) name 'Observation vread interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available vread interactions on Observation ) versions :r4 end @@ -253,6 +273,7 @@ def validate_resource_item(resource, property, value) name 'Observation history interaction supported' link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' description %( + All servers SHOULD make available history interactions on Observation ) versions :r4 end @@ -268,6 +289,7 @@ def validate_resource_item(resource, property, value) id '10' link 'https://www.hl7.org/fhir/search.html#revinclude' description %( + A Server SHALL be capable of supporting the following _revincludes: Provenance:target ) versions :r4 end @@ -291,6 +313,9 @@ def validate_resource_item(resource, property, value) id '11' link 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus' description %( + + This test checks if the resources returned from prior searches conform to the US Core profiles. + This includes checking for missing data elements and valueset verification. ) versions :r4 end @@ -302,8 +327,22 @@ def validate_resource_item(resource, property, value) test 'At least one of every must support element is provided in any Observation for this patient.' do metadata do id '12' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/general-guidance.html/#must-support' + link 'http://www.hl7.org/fhir/us/core/general-guidance.html#must-support' description %( + + US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. + This will look through all Observation resources returned from prior searches too see if any of them provide the following must support elements: + + Observation.status + + Observation.code + + Observation.subject + + Observation.issued + + Observation.valueCodeableConcept + ) versions :r4 end @@ -335,6 +374,7 @@ def validate_resource_item(resource, property, value) id '13' link 'https://www.hl7.org/fhir/DSTU2/references.html' description %( + This test checks if references found in resources from prior searches can be resolved. ) versions :r4 end From f7038b8602fdb3524f31bda1e7a3f469dfc30619 Mon Sep 17 00:00:00 2001 From: Chase Date: Mon, 18 Nov 2019 18:17:13 -0500 Subject: [PATCH 162/173] updating descriptions --- generator/uscore/uscore_generator.rb | 26 +++++----- .../pediatric_bmi_for_age_sequence.rb | 41 ++++++++-------- .../pediatric_weight_for_height_sequence.rb | 41 ++++++++-------- .../us_core_allergyintolerance_sequence.rb | 29 +++++------ .../us_core_careplan_sequence.rb | 37 +++++++------- .../us_core_careteam_sequence.rb | 25 +++++----- .../us_core_condition_sequence.rb | 41 ++++++++-------- .../us_core_diagnosticreport_lab_sequence.rb | 45 ++++++++--------- .../us_core_diagnosticreport_note_sequence.rb | 45 ++++++++--------- .../us_core_documentreference_sequence.rb | 49 ++++++++++--------- .../us_core_encounter_sequence.rb | 49 ++++++++++--------- .../uscore_v3.1.0/us_core_goal_sequence.rb | 33 +++++++------ .../us_core_immunization_sequence.rb | 33 +++++++------ .../us_core_implantable_device_sequence.rb | 29 +++++------ .../us_core_location_sequence.rb | 39 ++++++++------- .../us_core_medication_sequence.rb | 15 +++--- .../us_core_medicationrequest_sequence.rb | 38 +++++++------- .../us_core_observation_lab_sequence.rb | 41 ++++++++-------- .../us_core_organization_sequence.rb | 27 +++++----- .../uscore_v3.1.0/us_core_patient_sequence.rb | 49 ++++++++++--------- .../us_core_practitioner_sequence.rb | 27 +++++----- .../us_core_practitionerrole_sequence.rb | 28 ++++++----- .../us_core_procedure_sequence.rb | 37 +++++++------- .../us_core_provenance_sequence.rb | 15 +++--- .../us_core_pulse_oximetry_sequence.rb | 41 ++++++++-------- .../us_core_smokingstatus_sequence.rb | 41 ++++++++-------- 26 files changed, 474 insertions(+), 447 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index 283ea266a..b6e294864 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -109,7 +109,7 @@ def create_read_test(sequence) tests_that: "Can read #{sequence[:resource]} from the server", key: test_key, index: sequence[:tests].length + 1, - link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html', + link: 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html', description: "Reference to #{sequence[:resource]} can be resolved and read." } @@ -140,8 +140,8 @@ def create_authorization_test(sequence) tests_that: "Server rejects #{sequence[:resource]} search without authorization", key: test_key, index: sequence[:tests].length + 1, - link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior', - description: 'A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code.' + link: 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior', + description: 'A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code.' } first_search = find_first_search(sequence) @@ -176,6 +176,7 @@ def create_include_test(sequence) include_test = { tests_that: "Server returns the appropriate resource from the following _includes: #{sequence[:include_params].join(', ')}", index: sequence[:tests].length + 1, + optional: true, link: 'https://www.hl7.org/fhir/search.html#include', description: "A Server SHOULD be capable of supporting the following _includes: #{sequence[:include_params].join(', ')}" } @@ -226,10 +227,10 @@ def create_search_test(sequence, search_param) search_test = { tests_that: "Server returns expected results from #{sequence[:resource]} search by #{search_param[:names].join('+')}", index: sequence[:tests].length + 1, - link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html', + link: 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html', optional: search_param[:expectation] != 'SHALL', description: %( - A server #{search_param[:expectation]} be able to support searching by #{search_param[:names].join('+')} on the #{sequence[:resource]} resource + A server #{search_param[:expectation]} support searching by #{search_param[:names].join('+')} on the #{sequence[:resource]} resource ) } @@ -264,8 +265,8 @@ def create_interaction_test(sequence, interaction) tests_that: "#{sequence[:resource]} #{interaction[:code]} interaction supported", key: test_key, index: sequence[:tests].length + 1, - link: 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html', - description: "All servers #{interaction[:expectation]} make available #{interaction[:code]} interactions on #{sequence[:resource]}" + link: 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html', + description: "A server #{interaction[:expectation]} support the #{sequence[:resource]} #{interaction[:code]} interaction." } interaction_test[:test_code] = %( @@ -294,7 +295,7 @@ def create_must_support_test(sequence) test_code: '', description: %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all #{sequence[:resource]} resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all #{sequence[:resource]} resources returned from prior searches to see if any of them provide the following must support elements: ) } @@ -364,7 +365,8 @@ def create_resource_profile_test(sequence) link: sequence[:profile], description: %( This test checks if the resources returned from prior searches conform to the US Core profiles. - This includes checking for missing data elements and valueset verification.) + This includes checking for missing data elements and valueset verification. + ) } test[:test_code] = %( skip 'No resources appear to be available for this patient. Please use patients with more information.' unless @resources_found @@ -377,7 +379,7 @@ def create_references_resolved_test(sequence) test = { tests_that: 'All references can be resolved', index: sequence[:tests].length + 1, - link: 'https://www.hl7.org/fhir/DSTU2/references.html', + link: 'http://hl7.org/fhir/references.html', description: 'This test checks if references found in resources from prior searches can be resolved.' } @@ -550,13 +552,11 @@ def get_comparator_searches(search_params, sequence) end def find_comparators(search_params, sequence) - param_comparators = {} - search_params.each do |param| + search_params.each_with_object({}) do |param, param_comparators| param_info = sequence[:search_param_descriptions][param.to_sym] comparators = param_info[:comparators].select { |_comparator, expectation| ['SHALL', 'SHOULD'].include? expectation } param_comparators[param] = comparators if comparators.present? end - param_comparators end def search_param_constants(search_parameters, sequence) diff --git a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb index 85b24a01c..837821145 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb @@ -50,9 +50,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Observation search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -75,10 +75,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+code' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+code on the Observation resource + A server SHALL support searching by patient+code on the Observation resource ) versions :r4 @@ -109,10 +109,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category+date' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category+date on the Observation resource + A server SHALL support searching by patient+category+date on the Observation resource including support for these date comparators: gt, lt, le ) @@ -145,10 +145,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category on the Observation resource + A server SHALL support searching by patient+category on the Observation resource ) versions :r4 @@ -171,11 +171,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+code+date' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+code+date on the Observation resource + A server SHOULD support searching by patient+code+date on the Observation resource including support for these date comparators: gt, lt, le ) @@ -208,11 +208,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category+status' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+category+status on the Observation resource + A server SHOULD support searching by patient+category+status on the Observation resource ) versions :r4 @@ -237,9 +237,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'Observation read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Observation + A server SHALL support the Observation read interaction. ) versions :r4 end @@ -254,9 +254,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'Observation vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Observation + A server SHOULD support the Observation vread interaction. ) versions :r4 end @@ -271,9 +271,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'Observation history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Observation + A server SHOULD support the Observation history interaction. ) versions :r4 end @@ -316,6 +316,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -331,7 +332,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Observation resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Observation resources returned from prior searches to see if any of them provide the following must support elements: Observation.status @@ -444,7 +445,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb index e43dcbba5..d44cce27f 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb @@ -50,9 +50,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Observation search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -75,10 +75,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+code' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+code on the Observation resource + A server SHALL support searching by patient+code on the Observation resource ) versions :r4 @@ -109,10 +109,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category+date' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category+date on the Observation resource + A server SHALL support searching by patient+category+date on the Observation resource including support for these date comparators: gt, lt, le ) @@ -145,10 +145,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category on the Observation resource + A server SHALL support searching by patient+category on the Observation resource ) versions :r4 @@ -171,11 +171,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+code+date' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+code+date on the Observation resource + A server SHOULD support searching by patient+code+date on the Observation resource including support for these date comparators: gt, lt, le ) @@ -208,11 +208,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category+status' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+category+status on the Observation resource + A server SHOULD support searching by patient+category+status on the Observation resource ) versions :r4 @@ -237,9 +237,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'Observation read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Observation + A server SHALL support the Observation read interaction. ) versions :r4 end @@ -254,9 +254,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'Observation vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Observation + A server SHOULD support the Observation vread interaction. ) versions :r4 end @@ -271,9 +271,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'Observation history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Observation + A server SHOULD support the Observation history interaction. ) versions :r4 end @@ -316,6 +316,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -331,7 +332,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Observation resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Observation resources returned from prior searches to see if any of them provide the following must support elements: Observation.status @@ -444,7 +445,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb index cd1b87150..ea1a00c38 100644 --- a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb @@ -36,9 +36,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects AllergyIntolerance search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -60,10 +60,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from AllergyIntolerance search by patient' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient on the AllergyIntolerance resource + A server SHALL support searching by patient on the AllergyIntolerance resource ) versions :r4 @@ -92,11 +92,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from AllergyIntolerance search by patient+clinical-status' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+clinical-status on the AllergyIntolerance resource + A server SHOULD support searching by patient+clinical-status on the AllergyIntolerance resource ) versions :r4 @@ -120,9 +120,9 @@ def validate_resource_item(resource, property, value) metadata do id '04' name 'AllergyIntolerance read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on AllergyIntolerance + A server SHALL support the AllergyIntolerance read interaction. ) versions :r4 end @@ -137,9 +137,9 @@ def validate_resource_item(resource, property, value) metadata do id '05' name 'AllergyIntolerance vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on AllergyIntolerance + A server SHOULD support the AllergyIntolerance vread interaction. ) versions :r4 end @@ -154,9 +154,9 @@ def validate_resource_item(resource, property, value) metadata do id '06' name 'AllergyIntolerance history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on AllergyIntolerance + A server SHOULD support the AllergyIntolerance history interaction. ) versions :r4 end @@ -197,6 +197,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -212,7 +213,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all AllergyIntolerance resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all AllergyIntolerance resources returned from prior searches to see if any of them provide the following must support elements: AllergyIntolerance.clinicalStatus @@ -250,7 +251,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb index 2f3629d31..e5ae40d46 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -46,9 +46,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects CarePlan search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -71,10 +71,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from CarePlan search by patient+category' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category on the CarePlan resource + A server SHALL support searching by patient+category on the CarePlan resource ) versions :r4 @@ -105,11 +105,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from CarePlan search by patient+category+date' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+category+date on the CarePlan resource + A server SHOULD support searching by patient+category+date on the CarePlan resource including support for these date comparators: gt, lt, le ) @@ -142,11 +142,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from CarePlan search by patient+category+status+date' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+category+status+date on the CarePlan resource + A server SHOULD support searching by patient+category+status+date on the CarePlan resource including support for these date comparators: gt, lt, le ) @@ -180,11 +180,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from CarePlan search by patient+category+status' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+category+status on the CarePlan resource + A server SHOULD support searching by patient+category+status on the CarePlan resource ) versions :r4 @@ -209,9 +209,9 @@ def validate_resource_item(resource, property, value) metadata do id '06' name 'CarePlan read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on CarePlan + A server SHALL support the CarePlan read interaction. ) versions :r4 end @@ -226,9 +226,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'CarePlan vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on CarePlan + A server SHOULD support the CarePlan vread interaction. ) versions :r4 end @@ -243,9 +243,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'CarePlan history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on CarePlan + A server SHOULD support the CarePlan history interaction. ) versions :r4 end @@ -288,6 +288,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -303,7 +304,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all CarePlan resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all CarePlan resources returned from prior searches to see if any of them provide the following must support elements: CarePlan.text @@ -350,7 +351,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb index f8ecefb28..37c8770c7 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb @@ -36,9 +36,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects CareTeam search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -61,10 +61,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from CareTeam search by patient+status' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+status on the CareTeam resource + A server SHALL support searching by patient+status on the CareTeam resource ) versions :r4 @@ -96,9 +96,9 @@ def validate_resource_item(resource, property, value) metadata do id '03' name 'CareTeam read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on CareTeam + A server SHALL support the CareTeam read interaction. ) versions :r4 end @@ -113,9 +113,9 @@ def validate_resource_item(resource, property, value) metadata do id '04' name 'CareTeam vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on CareTeam + A server SHOULD support the CareTeam vread interaction. ) versions :r4 end @@ -130,9 +130,9 @@ def validate_resource_item(resource, property, value) metadata do id '05' name 'CareTeam history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on CareTeam + A server SHOULD support the CareTeam history interaction. ) versions :r4 end @@ -175,6 +175,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -190,7 +191,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all CareTeam resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all CareTeam resources returned from prior searches to see if any of them provide the following must support elements: CareTeam.status @@ -231,7 +232,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '09' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb index 95205694f..d374a828c 100644 --- a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb @@ -50,9 +50,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Condition search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -74,10 +74,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Condition search by patient' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient on the Condition resource + A server SHALL support searching by patient on the Condition resource ) versions :r4 @@ -106,11 +106,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Condition search by patient+category' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+category on the Condition resource + A server SHOULD support searching by patient+category on the Condition resource ) versions :r4 @@ -133,11 +133,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Condition search by patient+onset-date' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+onset-date on the Condition resource + A server SHOULD support searching by patient+onset-date on the Condition resource including support for these onset-date comparators: gt, lt, le ) @@ -169,11 +169,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Condition search by patient+clinical-status' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+clinical-status on the Condition resource + A server SHOULD support searching by patient+clinical-status on the Condition resource ) versions :r4 @@ -196,11 +196,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Condition search by patient+code' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+code on the Condition resource + A server SHOULD support searching by patient+code on the Condition resource ) versions :r4 @@ -224,9 +224,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'Condition read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Condition + A server SHALL support the Condition read interaction. ) versions :r4 end @@ -241,9 +241,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'Condition vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Condition + A server SHOULD support the Condition vread interaction. ) versions :r4 end @@ -258,9 +258,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'Condition history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Condition + A server SHOULD support the Condition history interaction. ) versions :r4 end @@ -301,6 +301,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -316,7 +317,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Condition resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Condition resources returned from prior searches to see if any of them provide the following must support elements: Condition.clinicalStatus @@ -357,7 +358,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb index 00c569a9a..dbc6f610b 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -50,9 +50,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects DiagnosticReport search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -75,10 +75,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+category' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category on the DiagnosticReport resource + A server SHALL support searching by patient+category on the DiagnosticReport resource ) versions :r4 @@ -109,10 +109,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient on the DiagnosticReport resource + A server SHALL support searching by patient on the DiagnosticReport resource ) versions :r4 @@ -133,10 +133,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+code' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+code on the DiagnosticReport resource + A server SHALL support searching by patient+code on the DiagnosticReport resource ) versions :r4 @@ -159,10 +159,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+category+date' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category+date on the DiagnosticReport resource + A server SHALL support searching by patient+category+date on the DiagnosticReport resource including support for these date comparators: gt, lt, le ) @@ -195,11 +195,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+status' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+status on the DiagnosticReport resource + A server SHOULD support searching by patient+status on the DiagnosticReport resource ) versions :r4 @@ -222,11 +222,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+code+date' do metadata do id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+code+date on the DiagnosticReport resource + A server SHOULD support searching by patient+code+date on the DiagnosticReport resource including support for these date comparators: gt, lt, le ) @@ -260,9 +260,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'DiagnosticReport read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on DiagnosticReport + A server SHALL support the DiagnosticReport read interaction. ) versions :r4 end @@ -277,9 +277,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'DiagnosticReport vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on DiagnosticReport + A server SHOULD support the DiagnosticReport vread interaction. ) versions :r4 end @@ -294,9 +294,9 @@ def validate_resource_item(resource, property, value) metadata do id '10' name 'DiagnosticReport history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on DiagnosticReport + A server SHOULD support the DiagnosticReport history interaction. ) versions :r4 end @@ -339,6 +339,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -354,7 +355,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all DiagnosticReport resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all DiagnosticReport resources returned from prior searches to see if any of them provide the following must support elements: DiagnosticReport.status @@ -410,7 +411,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '14' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb index 6e956541c..e135f7f00 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -50,9 +50,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects DiagnosticReport search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -75,10 +75,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+category' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category on the DiagnosticReport resource + A server SHALL support searching by patient+category on the DiagnosticReport resource ) versions :r4 @@ -109,10 +109,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient on the DiagnosticReport resource + A server SHALL support searching by patient on the DiagnosticReport resource ) versions :r4 @@ -133,10 +133,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+code' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+code on the DiagnosticReport resource + A server SHALL support searching by patient+code on the DiagnosticReport resource ) versions :r4 @@ -159,10 +159,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+category+date' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category+date on the DiagnosticReport resource + A server SHALL support searching by patient+category+date on the DiagnosticReport resource including support for these date comparators: gt, lt, le ) @@ -195,11 +195,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+status' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+status on the DiagnosticReport resource + A server SHOULD support searching by patient+status on the DiagnosticReport resource ) versions :r4 @@ -222,11 +222,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DiagnosticReport search by patient+code+date' do metadata do id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+code+date on the DiagnosticReport resource + A server SHOULD support searching by patient+code+date on the DiagnosticReport resource including support for these date comparators: gt, lt, le ) @@ -260,9 +260,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'DiagnosticReport read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on DiagnosticReport + A server SHALL support the DiagnosticReport read interaction. ) versions :r4 end @@ -277,9 +277,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'DiagnosticReport vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on DiagnosticReport + A server SHOULD support the DiagnosticReport vread interaction. ) versions :r4 end @@ -294,9 +294,9 @@ def validate_resource_item(resource, property, value) metadata do id '10' name 'DiagnosticReport history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on DiagnosticReport + A server SHOULD support the DiagnosticReport history interaction. ) versions :r4 end @@ -339,6 +339,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -354,7 +355,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all DiagnosticReport resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all DiagnosticReport resources returned from prior searches to see if any of them provide the following must support elements: DiagnosticReport.status @@ -410,7 +411,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '14' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb index 50c5cf373..0c2f5d13e 100644 --- a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb @@ -58,9 +58,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects DocumentReference search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -82,10 +82,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DocumentReference search by patient' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient on the DocumentReference resource + A server SHALL support searching by patient on the DocumentReference resource ) versions :r4 @@ -114,10 +114,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DocumentReference search by _id' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by _id on the DocumentReference resource + A server SHALL support searching by _id on the DocumentReference resource ) versions :r4 @@ -139,10 +139,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DocumentReference search by patient+type' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+type on the DocumentReference resource + A server SHALL support searching by patient+type on the DocumentReference resource ) versions :r4 @@ -165,10 +165,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DocumentReference search by patient+category+date' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category+date on the DocumentReference resource + A server SHALL support searching by patient+category+date on the DocumentReference resource including support for these date comparators: gt, lt, le ) @@ -193,10 +193,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DocumentReference search by patient+category' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category on the DocumentReference resource + A server SHALL support searching by patient+category on the DocumentReference resource ) versions :r4 @@ -219,11 +219,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DocumentReference search by patient+type+period' do metadata do id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+type+period on the DocumentReference resource + A server SHOULD support searching by patient+type+period on the DocumentReference resource including support for these period comparators: gt, lt, le ) @@ -256,11 +256,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from DocumentReference search by patient+status' do metadata do id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+status on the DocumentReference resource + A server SHOULD support searching by patient+status on the DocumentReference resource ) versions :r4 @@ -284,9 +284,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'DocumentReference read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on DocumentReference + A server SHALL support the DocumentReference read interaction. ) versions :r4 end @@ -301,9 +301,9 @@ def validate_resource_item(resource, property, value) metadata do id '10' name 'DocumentReference vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on DocumentReference + A server SHOULD support the DocumentReference vread interaction. ) versions :r4 end @@ -318,9 +318,9 @@ def validate_resource_item(resource, property, value) metadata do id '11' name 'DocumentReference history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on DocumentReference + A server SHOULD support the DocumentReference history interaction. ) versions :r4 end @@ -361,6 +361,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -376,7 +377,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all DocumentReference resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all DocumentReference resources returned from prior searches to see if any of them provide the following must support elements: DocumentReference.identifier @@ -453,7 +454,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '15' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb index efa99e757..072d44436 100644 --- a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb @@ -58,9 +58,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Encounter search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -82,10 +82,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Encounter search by patient' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient on the Encounter resource + A server SHALL support searching by patient on the Encounter resource ) versions :r4 @@ -114,10 +114,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Encounter search by _id' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by _id on the Encounter resource + A server SHALL support searching by _id on the Encounter resource ) versions :r4 @@ -139,10 +139,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Encounter search by date+patient' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by date+patient on the Encounter resource + A server SHALL support searching by date+patient on the Encounter resource including support for these date comparators: gt, lt, le ) @@ -174,11 +174,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Encounter search by identifier' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by identifier on the Encounter resource + A server SHOULD support searching by identifier on the Encounter resource ) versions :r4 @@ -200,11 +200,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Encounter search by patient+status' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+status on the Encounter resource + A server SHOULD support searching by patient+status on the Encounter resource ) versions :r4 @@ -227,11 +227,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Encounter search by class+patient' do metadata do id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by class+patient on the Encounter resource + A server SHOULD support searching by class+patient on the Encounter resource ) versions :r4 @@ -254,11 +254,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Encounter search by patient+type' do metadata do id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+type on the Encounter resource + A server SHOULD support searching by patient+type on the Encounter resource ) versions :r4 @@ -282,9 +282,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'Encounter read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Encounter + A server SHALL support the Encounter read interaction. ) versions :r4 end @@ -299,9 +299,9 @@ def validate_resource_item(resource, property, value) metadata do id '10' name 'Encounter vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Encounter + A server SHOULD support the Encounter vread interaction. ) versions :r4 end @@ -316,9 +316,9 @@ def validate_resource_item(resource, property, value) metadata do id '11' name 'Encounter history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Encounter + A server SHOULD support the Encounter history interaction. ) versions :r4 end @@ -359,6 +359,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -374,7 +375,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Encounter resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Encounter resources returned from prior searches to see if any of them provide the following must support elements: Encounter.identifier @@ -451,7 +452,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '15' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb index 70ecddb71..474b2613c 100644 --- a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb @@ -42,9 +42,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Goal search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -66,10 +66,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Goal search by patient' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient on the Goal resource + A server SHALL support searching by patient on the Goal resource ) versions :r4 @@ -98,11 +98,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Goal search by patient+target-date' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+target-date on the Goal resource + A server SHOULD support searching by patient+target-date on the Goal resource including support for these target-date comparators: gt, lt, le ) @@ -134,11 +134,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Goal search by patient+lifecycle-status' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+lifecycle-status on the Goal resource + A server SHOULD support searching by patient+lifecycle-status on the Goal resource ) versions :r4 @@ -162,9 +162,9 @@ def validate_resource_item(resource, property, value) metadata do id '05' name 'Goal read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Goal + A server SHALL support the Goal read interaction. ) versions :r4 end @@ -179,9 +179,9 @@ def validate_resource_item(resource, property, value) metadata do id '06' name 'Goal vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Goal + A server SHOULD support the Goal vread interaction. ) versions :r4 end @@ -196,9 +196,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'Goal history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Goal + A server SHOULD support the Goal history interaction. ) versions :r4 end @@ -239,6 +239,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -254,7 +255,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Goal resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Goal resources returned from prior searches to see if any of them provide the following must support elements: Goal.lifecycleStatus @@ -295,7 +296,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb index 6f49f4472..cf0d21f51 100644 --- a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb @@ -42,9 +42,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Immunization search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -66,10 +66,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Immunization search by patient' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient on the Immunization resource + A server SHALL support searching by patient on the Immunization resource ) versions :r4 @@ -98,11 +98,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Immunization search by patient+date' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+date on the Immunization resource + A server SHOULD support searching by patient+date on the Immunization resource including support for these date comparators: gt, lt, le ) @@ -134,11 +134,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Immunization search by patient+status' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+status on the Immunization resource + A server SHOULD support searching by patient+status on the Immunization resource ) versions :r4 @@ -162,9 +162,9 @@ def validate_resource_item(resource, property, value) metadata do id '05' name 'Immunization read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Immunization + A server SHALL support the Immunization read interaction. ) versions :r4 end @@ -179,9 +179,9 @@ def validate_resource_item(resource, property, value) metadata do id '06' name 'Immunization vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Immunization + A server SHOULD support the Immunization vread interaction. ) versions :r4 end @@ -196,9 +196,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'Immunization history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Immunization + A server SHOULD support the Immunization history interaction. ) versions :r4 end @@ -239,6 +239,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -254,7 +255,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Immunization resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Immunization resources returned from prior searches to see if any of them provide the following must support elements: Immunization.status @@ -301,7 +302,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb index 0c923c14e..d90dc328d 100644 --- a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb @@ -36,9 +36,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Device search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -60,10 +60,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Device search by patient' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient on the Device resource + A server SHALL support searching by patient on the Device resource ) versions :r4 @@ -92,11 +92,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Device search by patient+type' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+type on the Device resource + A server SHOULD support searching by patient+type on the Device resource ) versions :r4 @@ -120,9 +120,9 @@ def validate_resource_item(resource, property, value) metadata do id '04' name 'Device read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Device + A server SHALL support the Device read interaction. ) versions :r4 end @@ -137,9 +137,9 @@ def validate_resource_item(resource, property, value) metadata do id '05' name 'Device vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Device + A server SHOULD support the Device vread interaction. ) versions :r4 end @@ -154,9 +154,9 @@ def validate_resource_item(resource, property, value) metadata do id '06' name 'Device history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Device + A server SHOULD support the Device history interaction. ) versions :r4 end @@ -197,6 +197,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -212,7 +213,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Device resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Device resources returned from prior searches to see if any of them provide the following must support elements: Device.udiCarrier @@ -271,7 +272,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb index f84506ab8..54da223ca 100644 --- a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb @@ -55,7 +55,7 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Can read Location from the server' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( Reference to Location can be resolved and read. ) @@ -79,9 +79,9 @@ def validate_resource_item(resource, property, value) metadata do id '02' name 'Server rejects Location search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -104,10 +104,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Location search by name' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by name on the Location resource + A server SHALL support searching by name on the Location resource ) versions :r4 @@ -137,10 +137,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Location search by address' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by address on the Location resource + A server SHALL support searching by address on the Location resource ) versions :r4 @@ -162,11 +162,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Location search by address-city' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by address-city on the Location resource + A server SHOULD support searching by address-city on the Location resource ) versions :r4 @@ -188,11 +188,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Location search by address-state' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by address-state on the Location resource + A server SHOULD support searching by address-state on the Location resource ) versions :r4 @@ -214,11 +214,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Location search by address-postalcode' do metadata do id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by address-postalcode on the Location resource + A server SHOULD support searching by address-postalcode on the Location resource ) versions :r4 @@ -241,9 +241,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'Location vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Location + A server SHOULD support the Location vread interaction. ) versions :r4 end @@ -258,9 +258,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'Location history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Location + A server SHOULD support the Location history interaction. ) versions :r4 end @@ -302,6 +302,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -317,7 +318,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Location resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Location resources returned from prior searches to see if any of them provide the following must support elements: Location.status @@ -370,7 +371,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb index 6eb03bf9d..2d55750ae 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medication_sequence.rb @@ -23,7 +23,7 @@ class USCore310MedicationSequence < SequenceBase metadata do id '01' name 'Can read Medication from the server' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( Reference to Medication can be resolved and read. ) @@ -47,9 +47,9 @@ class USCore310MedicationSequence < SequenceBase metadata do id '02' name 'Medication vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Medication + A server SHOULD support the Medication vread interaction. ) versions :r4 end @@ -64,9 +64,9 @@ class USCore310MedicationSequence < SequenceBase metadata do id '03' name 'Medication history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Medication + A server SHOULD support the Medication history interaction. ) versions :r4 end @@ -104,6 +104,7 @@ class USCore310MedicationSequence < SequenceBase This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -119,7 +120,7 @@ class USCore310MedicationSequence < SequenceBase description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Medication resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Medication resources returned from prior searches to see if any of them provide the following must support elements: Medication.code @@ -148,7 +149,7 @@ class USCore310MedicationSequence < SequenceBase test 'All references can be resolved' do metadata do id '07' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb index 4c5c4ae72..dc0a6b2ba 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb @@ -48,9 +48,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects MedicationRequest search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -73,10 +73,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from MedicationRequest search by patient+intent' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+intent on the MedicationRequest resource + A server SHALL support searching by patient+intent on the MedicationRequest resource ) versions :r4 @@ -107,10 +107,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from MedicationRequest search by patient+intent+status' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+intent+status on the MedicationRequest resource + A server SHALL support searching by patient+intent+status on the MedicationRequest resource ) versions :r4 @@ -134,11 +134,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from MedicationRequest search by patient+intent+encounter' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+intent+encounter on the MedicationRequest resource + A server SHOULD support searching by patient+intent+encounter on the MedicationRequest resource ) versions :r4 @@ -162,11 +162,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from MedicationRequest search by patient+intent+authoredon' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+intent+authoredon on the MedicationRequest resource + A server SHOULD support searching by patient+intent+authoredon on the MedicationRequest resource including support for these authoredon comparators: gt, lt, le ) @@ -192,9 +192,9 @@ def validate_resource_item(resource, property, value) metadata do id '06' name 'MedicationRequest read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on MedicationRequest + A server SHALL support the MedicationRequest read interaction. ) versions :r4 end @@ -209,9 +209,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'MedicationRequest vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on MedicationRequest + A server SHOULD support the MedicationRequest vread interaction. ) versions :r4 end @@ -226,9 +226,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'MedicationRequest history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on MedicationRequest + A server SHOULD support the MedicationRequest history interaction. ) versions :r4 end @@ -243,6 +243,7 @@ def validate_resource_item(resource, property, value) metadata do id '09' link 'https://www.hl7.org/fhir/search.html#include' + optional description %( A Server SHOULD be capable of supporting the following _includes: MedicationRequest:medication ) @@ -295,6 +296,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -310,7 +312,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all MedicationRequest resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all MedicationRequest resources returned from prior searches to see if any of them provide the following must support elements: MedicationRequest.status @@ -372,7 +374,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb index fd8bd2d49..77b019619 100644 --- a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb @@ -50,9 +50,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Observation search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -75,10 +75,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category on the Observation resource + A server SHALL support searching by patient+category on the Observation resource ) versions :r4 @@ -109,10 +109,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+code' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+code on the Observation resource + A server SHALL support searching by patient+code on the Observation resource ) versions :r4 @@ -135,10 +135,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category+date' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category+date on the Observation resource + A server SHALL support searching by patient+category+date on the Observation resource including support for these date comparators: gt, lt, le ) @@ -171,11 +171,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+code+date' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+code+date on the Observation resource + A server SHOULD support searching by patient+code+date on the Observation resource including support for these date comparators: gt, lt, le ) @@ -208,11 +208,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category+status' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+category+status on the Observation resource + A server SHOULD support searching by patient+category+status on the Observation resource ) versions :r4 @@ -237,9 +237,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'Observation read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Observation + A server SHALL support the Observation read interaction. ) versions :r4 end @@ -254,9 +254,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'Observation vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Observation + A server SHOULD support the Observation vread interaction. ) versions :r4 end @@ -271,9 +271,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'Observation history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Observation + A server SHOULD support the Observation history interaction. ) versions :r4 end @@ -316,6 +316,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -331,7 +332,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Observation resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Observation resources returned from prior searches to see if any of them provide the following must support elements: Observation.status @@ -414,7 +415,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb index f6f6fc970..9d0242006 100644 --- a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb @@ -43,7 +43,7 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Can read Organization from the server' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( Reference to Organization can be resolved and read. ) @@ -67,9 +67,9 @@ def validate_resource_item(resource, property, value) metadata do id '02' name 'Server rejects Organization search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -92,10 +92,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Organization search by name' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by name on the Organization resource + A server SHALL support searching by name on the Organization resource ) versions :r4 @@ -125,10 +125,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Organization search by address' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by address on the Organization resource + A server SHALL support searching by address on the Organization resource ) versions :r4 @@ -151,9 +151,9 @@ def validate_resource_item(resource, property, value) metadata do id '05' name 'Organization vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Organization + A server SHOULD support the Organization vread interaction. ) versions :r4 end @@ -168,9 +168,9 @@ def validate_resource_item(resource, property, value) metadata do id '06' name 'Organization history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Organization + A server SHOULD support the Organization history interaction. ) versions :r4 end @@ -212,6 +212,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -227,7 +228,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Organization resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Organization resources returned from prior searches to see if any of them provide the following must support elements: Organization.identifier @@ -295,7 +296,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb index 4b7238fef..6e73d750b 100644 --- a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb @@ -65,9 +65,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Patient search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -89,10 +89,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Patient search by _id' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by _id on the Patient resource + A server SHALL support searching by _id on the Patient resource ) versions :r4 @@ -121,10 +121,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Patient search by identifier' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by identifier on the Patient resource + A server SHALL support searching by identifier on the Patient resource ) versions :r4 @@ -146,10 +146,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Patient search by name' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by name on the Patient resource + A server SHALL support searching by name on the Patient resource ) versions :r4 @@ -171,10 +171,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Patient search by gender+name' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by gender+name on the Patient resource + A server SHALL support searching by gender+name on the Patient resource ) versions :r4 @@ -197,10 +197,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Patient search by birthdate+name' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by birthdate+name on the Patient resource + A server SHALL support searching by birthdate+name on the Patient resource ) versions :r4 @@ -223,11 +223,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Patient search by birthdate+family' do metadata do id '07' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by birthdate+family on the Patient resource + A server SHOULD support searching by birthdate+family on the Patient resource ) versions :r4 @@ -250,11 +250,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Patient search by family+gender' do metadata do id '08' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by family+gender on the Patient resource + A server SHOULD support searching by family+gender on the Patient resource ) versions :r4 @@ -278,9 +278,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'Patient read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Patient + A server SHALL support the Patient read interaction. ) versions :r4 end @@ -295,9 +295,9 @@ def validate_resource_item(resource, property, value) metadata do id '10' name 'Patient vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Patient + A server SHOULD support the Patient vread interaction. ) versions :r4 end @@ -312,9 +312,9 @@ def validate_resource_item(resource, property, value) metadata do id '11' name 'Patient history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Patient + A server SHOULD support the Patient history interaction. ) versions :r4 end @@ -355,6 +355,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -370,7 +371,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Patient resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Patient resources returned from prior searches to see if any of them provide the following must support elements: Patient.identifier @@ -470,7 +471,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '15' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb index ff5fc329a..0bde9b8fe 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb @@ -44,7 +44,7 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Can read Practitioner from the server' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( Reference to Practitioner can be resolved and read. ) @@ -68,9 +68,9 @@ def validate_resource_item(resource, property, value) metadata do id '02' name 'Server rejects Practitioner search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -93,10 +93,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Practitioner search by name' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by name on the Practitioner resource + A server SHALL support searching by name on the Practitioner resource ) versions :r4 @@ -126,10 +126,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Practitioner search by identifier' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by identifier on the Practitioner resource + A server SHALL support searching by identifier on the Practitioner resource ) versions :r4 @@ -152,9 +152,9 @@ def validate_resource_item(resource, property, value) metadata do id '05' name 'Practitioner vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Practitioner + A server SHOULD support the Practitioner vread interaction. ) versions :r4 end @@ -169,9 +169,9 @@ def validate_resource_item(resource, property, value) metadata do id '06' name 'Practitioner history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Practitioner + A server SHOULD support the Practitioner history interaction. ) versions :r4 end @@ -213,6 +213,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -228,7 +229,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Practitioner resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Practitioner resources returned from prior searches to see if any of them provide the following must support elements: Practitioner.identifier @@ -272,7 +273,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '10' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb index 227c2ab35..aa88c98a1 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb @@ -37,7 +37,7 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Can read PractitionerRole from the server' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( Reference to PractitionerRole can be resolved and read. ) @@ -61,9 +61,9 @@ def validate_resource_item(resource, property, value) metadata do id '02' name 'Server rejects PractitionerRole search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -86,10 +86,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from PractitionerRole search by specialty' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by specialty on the PractitionerRole resource + A server SHALL support searching by specialty on the PractitionerRole resource ) versions :r4 @@ -119,10 +119,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from PractitionerRole search by practitioner' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by practitioner on the PractitionerRole resource + A server SHALL support searching by practitioner on the PractitionerRole resource ) versions :r4 @@ -145,9 +145,9 @@ def validate_resource_item(resource, property, value) metadata do id '05' name 'PractitionerRole vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on PractitionerRole + A server SHOULD support the PractitionerRole vread interaction. ) versions :r4 end @@ -162,9 +162,9 @@ def validate_resource_item(resource, property, value) metadata do id '06' name 'PractitionerRole history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on PractitionerRole + A server SHOULD support the PractitionerRole history interaction. ) versions :r4 end @@ -179,6 +179,7 @@ def validate_resource_item(resource, property, value) metadata do id '07' link 'https://www.hl7.org/fhir/search.html#include' + optional description %( A Server SHOULD be capable of supporting the following _includes: PractitionerRole:endpoint, PractitionerRole:practitioner ) @@ -236,6 +237,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -251,7 +253,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all PractitionerRole resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all PractitionerRole resources returned from prior searches to see if any of them provide the following must support elements: PractitionerRole.practitioner @@ -304,7 +306,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '11' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb index 8c9a3fe92..0ae5d0a32 100644 --- a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb @@ -46,9 +46,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Procedure search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -70,10 +70,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Procedure search by patient' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient on the Procedure resource + A server SHALL support searching by patient on the Procedure resource ) versions :r4 @@ -102,10 +102,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Procedure search by patient+date' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+date on the Procedure resource + A server SHALL support searching by patient+date on the Procedure resource including support for these date comparators: gt, lt, le ) @@ -137,11 +137,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Procedure search by patient+code+date' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+code+date on the Procedure resource + A server SHOULD support searching by patient+code+date on the Procedure resource including support for these date comparators: gt, lt, le ) @@ -174,11 +174,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Procedure search by patient+status' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+status on the Procedure resource + A server SHOULD support searching by patient+status on the Procedure resource ) versions :r4 @@ -202,9 +202,9 @@ def validate_resource_item(resource, property, value) metadata do id '06' name 'Procedure read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Procedure + A server SHALL support the Procedure read interaction. ) versions :r4 end @@ -219,9 +219,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'Procedure vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Procedure + A server SHOULD support the Procedure vread interaction. ) versions :r4 end @@ -236,9 +236,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'Procedure history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Procedure + A server SHOULD support the Procedure history interaction. ) versions :r4 end @@ -279,6 +279,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -294,7 +295,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Procedure resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Procedure resources returned from prior searches to see if any of them provide the following must support elements: Procedure.status @@ -335,7 +336,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '12' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb index 327ca1854..7899b6eca 100644 --- a/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_provenance_sequence.rb @@ -23,7 +23,7 @@ class USCore310ProvenanceSequence < SequenceBase metadata do id '01' name 'Can read Provenance from the server' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( Reference to Provenance can be resolved and read. ) @@ -47,9 +47,9 @@ class USCore310ProvenanceSequence < SequenceBase metadata do id '02' name 'Provenance vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Provenance + A server SHOULD support the Provenance vread interaction. ) versions :r4 end @@ -64,9 +64,9 @@ class USCore310ProvenanceSequence < SequenceBase metadata do id '03' name 'Provenance history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Provenance + A server SHOULD support the Provenance history interaction. ) versions :r4 end @@ -85,6 +85,7 @@ class USCore310ProvenanceSequence < SequenceBase This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -100,7 +101,7 @@ class USCore310ProvenanceSequence < SequenceBase description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Provenance resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Provenance resources returned from prior searches to see if any of them provide the following must support elements: Provenance.target @@ -156,7 +157,7 @@ class USCore310ProvenanceSequence < SequenceBase test 'All references can be resolved' do metadata do id '06' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb index eb3c5e9d7..249b2474f 100644 --- a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb @@ -50,9 +50,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Observation search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -75,10 +75,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+code' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+code on the Observation resource + A server SHALL support searching by patient+code on the Observation resource ) versions :r4 @@ -109,10 +109,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category+date' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category+date on the Observation resource + A server SHALL support searching by patient+category+date on the Observation resource including support for these date comparators: gt, lt, le ) @@ -145,10 +145,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category on the Observation resource + A server SHALL support searching by patient+category on the Observation resource ) versions :r4 @@ -171,11 +171,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+code+date' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+code+date on the Observation resource + A server SHOULD support searching by patient+code+date on the Observation resource including support for these date comparators: gt, lt, le ) @@ -208,11 +208,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category+status' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+category+status on the Observation resource + A server SHOULD support searching by patient+category+status on the Observation resource ) versions :r4 @@ -237,9 +237,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'Observation read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Observation + A server SHALL support the Observation read interaction. ) versions :r4 end @@ -254,9 +254,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'Observation vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Observation + A server SHOULD support the Observation vread interaction. ) versions :r4 end @@ -271,9 +271,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'Observation history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Observation + A server SHOULD support the Observation history interaction. ) versions :r4 end @@ -316,6 +316,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -331,7 +332,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Observation resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Observation resources returned from prior searches to see if any of them provide the following must support elements: Observation.status @@ -810,7 +811,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) diff --git a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb index 30172785a..e89df23e3 100644 --- a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb @@ -50,9 +50,9 @@ def validate_resource_item(resource, property, value) metadata do id '01' name 'Server rejects Observation search without authorization' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html#behavior' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. ) versions :r4 end @@ -75,10 +75,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+code' do metadata do id '02' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+code on the Observation resource + A server SHALL support searching by patient+code on the Observation resource ) versions :r4 @@ -109,10 +109,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category+date' do metadata do id '03' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category+date on the Observation resource + A server SHALL support searching by patient+category+date on the Observation resource including support for these date comparators: gt, lt, le ) @@ -145,10 +145,10 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category' do metadata do id '04' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - A server SHALL be able to support searching by patient+category on the Observation resource + A server SHALL support searching by patient+category on the Observation resource ) versions :r4 @@ -171,11 +171,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+code+date' do metadata do id '05' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+code+date on the Observation resource + A server SHOULD support searching by patient+code+date on the Observation resource including support for these date comparators: gt, lt, le ) @@ -208,11 +208,11 @@ def validate_resource_item(resource, property, value) test 'Server returns expected results from Observation search by patient+category+status' do metadata do id '06' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' optional description %( - A server SHOULD be able to support searching by patient+category+status on the Observation resource + A server SHOULD support searching by patient+category+status on the Observation resource ) versions :r4 @@ -237,9 +237,9 @@ def validate_resource_item(resource, property, value) metadata do id '07' name 'Observation read interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHALL make available read interactions on Observation + A server SHALL support the Observation read interaction. ) versions :r4 end @@ -254,9 +254,9 @@ def validate_resource_item(resource, property, value) metadata do id '08' name 'Observation vread interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available vread interactions on Observation + A server SHOULD support the Observation vread interaction. ) versions :r4 end @@ -271,9 +271,9 @@ def validate_resource_item(resource, property, value) metadata do id '09' name 'Observation history interaction supported' - link 'https://build.fhir.org/ig/HL7/US-Core-R4/CapabilityStatement-us-core-server.html' + link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html' description %( - All servers SHOULD make available history interactions on Observation + A server SHOULD support the Observation history interaction. ) versions :r4 end @@ -316,6 +316,7 @@ def validate_resource_item(resource, property, value) This test checks if the resources returned from prior searches conform to the US Core profiles. This includes checking for missing data elements and valueset verification. + ) versions :r4 end @@ -331,7 +332,7 @@ def validate_resource_item(resource, property, value) description %( US Core Responders SHALL be capable of populating all data elements as part of the query results as specified by the US Core Server Capability Statement. - This will look through all Observation resources returned from prior searches too see if any of them provide the following must support elements: + This will look through all Observation resources returned from prior searches to see if any of them provide the following must support elements: Observation.status @@ -372,7 +373,7 @@ def validate_resource_item(resource, property, value) test 'All references can be resolved' do metadata do id '13' - link 'https://www.hl7.org/fhir/DSTU2/references.html' + link 'http://hl7.org/fhir/references.html' description %( This test checks if references found in resources from prior searches can be resolved. ) From 5cef720219442c43d919a80b1a93d5ff0a71d7ca Mon Sep 17 00:00:00 2001 From: Chase Date: Tue, 19 Nov 2019 09:58:35 -0500 Subject: [PATCH 163/173] change unauthorized description back to 401 --- generator/uscore/uscore_generator.rb | 2 +- lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb | 2 +- .../uscore_v3.1.0/pediatric_weight_for_height_sequence.rb | 2 +- .../uscore_v3.1.0/us_core_allergyintolerance_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb | 2 +- .../uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb | 2 +- .../uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb | 2 +- .../uscore_v3.1.0/us_core_implantable_device_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_location_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb | 2 +- lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb | 2 +- 24 files changed, 24 insertions(+), 24 deletions(-) diff --git a/generator/uscore/uscore_generator.rb b/generator/uscore/uscore_generator.rb index b6e294864..fa307b888 100644 --- a/generator/uscore/uscore_generator.rb +++ b/generator/uscore/uscore_generator.rb @@ -141,7 +141,7 @@ def create_authorization_test(sequence) key: test_key, index: sequence[:tests].length + 1, link: 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior', - description: 'A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code.' + description: 'A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code.' } first_search = find_first_search(sequence) diff --git a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb index 837821145..8c5945f0a 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_bmi_for_age_sequence.rb @@ -52,7 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Observation search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb index d44cce27f..588e7f0df 100644 --- a/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb +++ b/lib/modules/uscore_v3.1.0/pediatric_weight_for_height_sequence.rb @@ -52,7 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Observation search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb index ea1a00c38..de9b12d80 100644 --- a/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_allergyintolerance_sequence.rb @@ -38,7 +38,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects AllergyIntolerance search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb index e5ae40d46..0deccdbec 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careplan_sequence.rb @@ -48,7 +48,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects CarePlan search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb index 37c8770c7..f7fe4bc47 100644 --- a/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_careteam_sequence.rb @@ -38,7 +38,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects CareTeam search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb index d374a828c..9d010cd43 100644 --- a/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_condition_sequence.rb @@ -52,7 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Condition search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb index dbc6f610b..decca93d5 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_lab_sequence.rb @@ -52,7 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects DiagnosticReport search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb index e135f7f00..abda93ddc 100644 --- a/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_diagnosticreport_note_sequence.rb @@ -52,7 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects DiagnosticReport search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb index 0c2f5d13e..441aa0628 100644 --- a/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_documentreference_sequence.rb @@ -60,7 +60,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects DocumentReference search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb index 072d44436..074acc619 100644 --- a/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_encounter_sequence.rb @@ -60,7 +60,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Encounter search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb index 474b2613c..728133c20 100644 --- a/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_goal_sequence.rb @@ -44,7 +44,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Goal search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb index cf0d21f51..6de20b947 100644 --- a/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_immunization_sequence.rb @@ -44,7 +44,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Immunization search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb index d90dc328d..5501c9d3c 100644 --- a/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_implantable_device_sequence.rb @@ -38,7 +38,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Device search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb index 54da223ca..3ffb2ad16 100644 --- a/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_location_sequence.rb @@ -81,7 +81,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Location search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb index dc0a6b2ba..054efb0c6 100644 --- a/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_medicationrequest_sequence.rb @@ -50,7 +50,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects MedicationRequest search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb index 77b019619..687f12a89 100644 --- a/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_observation_lab_sequence.rb @@ -52,7 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Observation search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb index 9d0242006..52959cf6e 100644 --- a/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_organization_sequence.rb @@ -69,7 +69,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Organization search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb index 6e73d750b..ff47c2883 100644 --- a/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_patient_sequence.rb @@ -67,7 +67,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Patient search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb index 0bde9b8fe..25ccaa0b7 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitioner_sequence.rb @@ -70,7 +70,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Practitioner search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb index aa88c98a1..3a8b60357 100644 --- a/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_practitionerrole_sequence.rb @@ -63,7 +63,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects PractitionerRole search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb index 0ae5d0a32..e2dab812a 100644 --- a/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_procedure_sequence.rb @@ -48,7 +48,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Procedure search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb index 249b2474f..086d96a0c 100644 --- a/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_pulse_oximetry_sequence.rb @@ -52,7 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Observation search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end diff --git a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb index e89df23e3..4b876d440 100644 --- a/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb +++ b/lib/modules/uscore_v3.1.0/us_core_smokingstatus_sequence.rb @@ -52,7 +52,7 @@ def validate_resource_item(resource, property, value) name 'Server rejects Observation search without authorization' link 'https://www.hl7.org/fhir/us/core/CapabilityStatement-us-core-server.html#behavior' description %( - A server SHALL reject any unauthorized requests by returning an HTTP 401/4xx unauthorized response code. + A server SHALL reject any unauthorized requests by returning an HTTP 401 unauthorized response code. ) versions :r4 end From dcf6957bb27c39ca5b7421c27eee38675363129c Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 27 Nov 2019 11:48:00 -0600 Subject: [PATCH 164/173] Test client assertion --- .../bulk_data_authorization_sequence.rb | 85 +++++++---- .../test/authorization_sequence_test.rb | 138 ++++++++++++++---- 2 files changed, 167 insertions(+), 56 deletions(-) diff --git a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb index f74d284a4..1fab7a14d 100644 --- a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb @@ -9,7 +9,27 @@ class BulkDataAuthorizationSequence < SequenceBase requires :bulk_client_id, :bulk_private_key, :bulk_token_endpoint - description 'Test Bulk Data Authorization Token Endpoint' + attr_accessor :jti, :expires_in, :is_unit_test + + def invalid_private_key + { + "kty": 'RSA', + "alg": 'RS384', + "n": 'yh9VjpVXyYWKEg8pwCLWtvIcqxCFn5-6iTmm_ocqmfmJ7hb2S_RWIHNyTea6LlnWP_FaL46WQYI0SgSIaos3C8pxxskrMWJQkqra0w8rjJhL3D-avvVf5Mugv6rUYboFbRlTmqGmwQl1lCm5wJEcwFwFis2phf8Xydjdoo2HxP8q94zfCrZt1zXrHpqMLMaN8Hc-Zuuq2vZmqEfsiwxdCBPvfHJTj3ht10MC7HPrJc9T5LiAaaxaQUVzM91Q85z7wQcdIGSjr3MJJuyWhD-z878AXH49K_eft_S-B8Uotu9jwLZqNyk7_in1PeJYBVB-SyKRNa9dBuQc5TvFNqVT2Q', + "e": 'AQAB', + "d": 'x88wEhMaxJIpyu6IdHM8VYCEzKs5nXIWwl9m8YmHmM1yCBdVBgMWPWBDKDWl6fpPbcjXQdowObRQordWcBUNpq9LyJrIAzrQsh0K08jUYVmQ7LtH6-zADnsqfy-OYsm1YYO-_Uc-hOgn_v88rNwHUzXlGLF1G4zw5E5p068b_6YKtVFhmQpdvbvrAg55pAlCpQzOKYwqepJgG1BPQz0ta6ymYWIiPsDpr02VkkfEeIOV24ymCPfu9vayEfxGdHyN4NWE3xRujBXONVBemsAMU0tFxuN-vBZklM9Pqv803kILpHTC9L9OFkzisY-7P5bahErhIiLJUeHeeZnGTi0cXQ', + "p": '6_Lg8H29uGVQjmhRgmwzQ-Q__ybRbKIlIf7ieyHrAmIIbT8LtQlPCEzCFnflz_j5hoRq0DbvpLEZYcMjiJnGXrDxhInwOWPf-2eo5jGJtm64bkT8xBEZ5A6SWadAO9Dmy9KMoB136mQpiEHqYvLLg7E-RVAUKkw2LspYcZB6-r8', + "q": '20yOKIYq1lQBP48DqA88iIm9DINNhz66tfxEfWu4fjAsku0wbFRqsidw0XW1I6BHgrCnRLSev_m9Rj-MjpcUyZsEsGqSuVhXDOWocS_eZapkTD79ugU2P_lMT0qErlF5Bfmg7kUByTJODyDrpT2hAX7q-wb77029ANlCDugWz2c', + "dp": 'k1x-tlSiAB9uv3JRrfYr0nQksBOraoCeVmwdQS_-2d8mSiy9ABVPQezGr0e0xT5HgYcEOwSEiUR-iLtaXv9DkHJMdS29VeqVwiuMpjA8RS9DisMVZtMTa4baSpoVmQYwjw3x_DJLaZ2i_tHENIZVKuuw65NG9N_iWzjPIiZNWHs', + "dq": 'LFSNaCO3BRx2JCME2jQ6SF-Pl7fzNCO6Go-kSLY91URnvku0PjHSX7EZXT4uH8WGrySGq5zXendBi7HM-AYSba6ohAEHJ_BzqGfEZR0IGAUZwU_6emATV1tN0bl-mL5feJW9smzAr6s7nFNLT1vl8Cd32MbQps9QJZvFfr3r3oE', + "qi": 'H45gESn1kzqIjLqf1iiESlXb-04s_rLO43BCN-57LMIPckAW4AQPx4bq4-58Jig_U3h6eJX7-2W4QP3UyyGHPIBQH7HaCxnqUZ7ilRzLQBneBZCrtPtlIxExdD_a2Aqzgb5JdND92ZutlPdCUKxZSBVQtmLVg4wh8O-GCA3bSqI', + "key_ops": [ + 'sign' + ], + "ext": true, + "kid": '510c84dd7c5a7c285911d0f405522c5a' + } + end def authorize(bulk_private_key: @instance.bulk_private_key, content_type: 'application/x-www-form-urlencoded', @@ -21,6 +41,41 @@ def authorize(bulk_private_key: @instance.bulk_private_key, aud: @instance.bulk_token_endpoint, exp: 5.minutes.from_now, jti: SecureRandom.hex(32)) + + header = + { + content_type: content_type, + accept: 'application/json' + }.compact + + payload = create_post_palyload(bulk_private_key: bulk_private_key, + scope: scope, + grant_type: grant_type, + client_assertion_type: client_assertion_type, + iss: iss, + sub: sub, + aud: aud, + exp: exp, + jti: jti) + + LoggedRestClient.post(@instance.bulk_token_endpoint, payload, header) + end + + def create_post_palyload(bulk_private_key: @instance.bulk_private_key, + scope: 'system/*.read', + grant_type: 'client_credentials', + client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', + iss: @instance.bulk_client_id, + sub: @instance.bulk_client_id, + aud: @instance.bulk_token_endpoint, + exp: 5.minutes.from_now, + jti: SecureRandom.hex(32)) + + if @is_unit_test + jti = @jti + exp = @expires_in + end + jwt_token = JSON::JWT.new( iss: iss, sub: sub, @@ -43,16 +98,10 @@ def authorize(bulk_private_key: @instance.bulk_private_key, 'client_assertion' => client_assertion.to_s }.compact - header = - { - content_type: content_type, - accept: 'application/json' - }.compact - uri = Addressable::URI.new uri.query_values = payload - LoggedRestClient.post(@instance.bulk_token_endpoint, uri.query, header) + uri.query end test :require_content_type do @@ -156,7 +205,7 @@ def authorize(bulk_private_key: @instance.bulk_private_key, ) end - response = authorize(aud: 'not_a_token_url') + response = authorize(aud: 'not_a_aud') assert_response_bad(response) end @@ -217,24 +266,6 @@ def authorize(bulk_private_key: @instance.bulk_private_key, ) end - invalid_private_key = { - "kty": 'RSA', - "alg": 'RS384', - "n": 'yh9VjpVXyYWKEg8pwCLWtvIcqxCFn5-6iTmm_ocqmfmJ7hb2S_RWIHNyTea6LlnWP_FaL46WQYI0SgSIaos3C8pxxskrMWJQkqra0w8rjJhL3D-avvVf5Mugv6rUYboFbRlTmqGmwQl1lCm5wJEcwFwFis2phf8Xydjdoo2HxP8q94zfCrZt1zXrHpqMLMaN8Hc-Zuuq2vZmqEfsiwxdCBPvfHJTj3ht10MC7HPrJc9T5LiAaaxaQUVzM91Q85z7wQcdIGSjr3MJJuyWhD-z878AXH49K_eft_S-B8Uotu9jwLZqNyk7_in1PeJYBVB-SyKRNa9dBuQc5TvFNqVT2Q', - "e": 'AQAB', - "d": 'x88wEhMaxJIpyu6IdHM8VYCEzKs5nXIWwl9m8YmHmM1yCBdVBgMWPWBDKDWl6fpPbcjXQdowObRQordWcBUNpq9LyJrIAzrQsh0K08jUYVmQ7LtH6-zADnsqfy-OYsm1YYO-_Uc-hOgn_v88rNwHUzXlGLF1G4zw5E5p068b_6YKtVFhmQpdvbvrAg55pAlCpQzOKYwqepJgG1BPQz0ta6ymYWIiPsDpr02VkkfEeIOV24ymCPfu9vayEfxGdHyN4NWE3xRujBXONVBemsAMU0tFxuN-vBZklM9Pqv803kILpHTC9L9OFkzisY-7P5bahErhIiLJUeHeeZnGTi0cXQ', - "p": '6_Lg8H29uGVQjmhRgmwzQ-Q__ybRbKIlIf7ieyHrAmIIbT8LtQlPCEzCFnflz_j5hoRq0DbvpLEZYcMjiJnGXrDxhInwOWPf-2eo5jGJtm64bkT8xBEZ5A6SWadAO9Dmy9KMoB136mQpiEHqYvLLg7E-RVAUKkw2LspYcZB6-r8', - "q": '20yOKIYq1lQBP48DqA88iIm9DINNhz66tfxEfWu4fjAsku0wbFRqsidw0XW1I6BHgrCnRLSev_m9Rj-MjpcUyZsEsGqSuVhXDOWocS_eZapkTD79ugU2P_lMT0qErlF5Bfmg7kUByTJODyDrpT2hAX7q-wb77029ANlCDugWz2c', - "dp": 'k1x-tlSiAB9uv3JRrfYr0nQksBOraoCeVmwdQS_-2d8mSiy9ABVPQezGr0e0xT5HgYcEOwSEiUR-iLtaXv9DkHJMdS29VeqVwiuMpjA8RS9DisMVZtMTa4baSpoVmQYwjw3x_DJLaZ2i_tHENIZVKuuw65NG9N_iWzjPIiZNWHs', - "dq": 'LFSNaCO3BRx2JCME2jQ6SF-Pl7fzNCO6Go-kSLY91URnvku0PjHSX7EZXT4uH8WGrySGq5zXendBi7HM-AYSba6ohAEHJ_BzqGfEZR0IGAUZwU_6emATV1tN0bl-mL5feJW9smzAr6s7nFNLT1vl8Cd32MbQps9QJZvFfr3r3oE', - "qi": 'H45gESn1kzqIjLqf1iiESlXb-04s_rLO43BCN-57LMIPckAW4AQPx4bq4-58Jig_U3h6eJX7-2W4QP3UyyGHPIBQH7HaCxnqUZ7ilRzLQBneBZCrtPtlIxExdD_a2Aqzgb5JdND92ZutlPdCUKxZSBVQtmLVg4wh8O-GCA3bSqI', - "key_ops": [ - 'sign' - ], - "ext": true, - "kid": '510c84dd7c5a7c285911d0f405522c5a' - } - response = authorize(bulk_private_key: invalid_private_key.to_json) assert_response_bad(response) end diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index 0241921a2..b896b5111 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -1,4 +1,4 @@ -# frozen_string_literal: true +#frozen_string_literal: true require_relative '../../../../test/test_helper' @@ -22,34 +22,55 @@ 'expires_in' => 900, 'access_token' => 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbl90eXBlIjoiYmVhcmVyIiwiZXhwaXJlc19pbiI6OTAwLCJpYXQiOjE1NzM5NDU1MDQsImV4cCI6MTU3Mzk0NjQwNH0.Ds-9HxQPJshkPYYBowJXltTaX2T6MSv_qYnZLjteTH8', 'scope' => 'system/*.read' - } end - def self.it_tests_required_parameter(test_id, request_headers: nil) - before do - @test = @sequence_class[test_id] - @sequence = @sequence_class.new(@instance, @client) + def build_request(status_code, request_headers, request_parameter, jwt_token_parameter) + a_request = stub_request(:post, @instance.bulk_token_endpoint) + .to_return( + status: status_code + ) + + a_request.with(headers: request_headers) if request_headers.present? + + if request_parameter.present? + a_request.with(body: hash_including(request_parameter)) + elsif jwt_token_parameter.present? + a_request.with { |request| it_tests_client_assertion(request.body, jwt_token_parameter) } + elsif @payload.present? + a_request.with(body: @payload) end + end - it 'passes with status code 400' do - a_request = stub_request(:post, @instance.bulk_token_endpoint) - .to_return( - status: 400 - ) + def it_tests_client_assertion(request_payload, parameter) + uri = Addressable::URI.new + uri.query = request_payload + client_assertion = uri.query_values['client_assertion'] + + jwk = JSON::JWK.new(JSON.parse(@instance.bulk_public_key)) + + jwt_token = JSON::JWT.decode(client_assertion, jwk.to_key) + + if parameter[:value].present? + if parameter[:name] == 'exp' + jwt_token[parameter[:name]] >= parameter[:value].to_i + else + jwt_token[parameter[:name]] == parameter[:value] + end + else + jwt_token.key?(parameter[:name]) == false + end + end - a_request.with(headers: request_headers) if request_headers.present? + def self.it_tests_required_parameter(request_headers: nil, request_parameter: nil, jwt_token_parameter: nil) + it 'passes with status code 400' do + build_request(400, request_headers, request_parameter, jwt_token_parameter) @sequence.run_test(@test) end it 'fail with status code 200' do - a_request = stub_request(:post, @instance.bulk_token_endpoint) - .to_return( - status: 200 - ) - - a_request.with(headers: request_headers) if request_headers.present? + build_request(200, request_headers, request_parameter, jwt_token_parameter) error = assert_raises(Inferno::AssertionException) do @sequence.run_test(@test) @@ -60,47 +81,106 @@ def self.it_tests_required_parameter(test_id, request_headers: nil) end describe 'require correct content-type' do - it_tests_required_parameter(:require_content_type, request_headers: { content_type: 'application/json' }) + before do + @test = @sequence_class[:require_content_type] + @sequence = @sequence_class.new(@instance, @client) + end + + it_tests_required_parameter(request_headers: { content_type: 'application/json' }) end describe 'require system scope' do - it_tests_required_parameter(:require_system_scope) + before do + @test = @sequence_class[:require_system_scope] + @sequence = @sequence_class.new(@instance, @client) + end + + it_tests_required_parameter(request_parameter: { scope: 'user/*.read' }) end describe 'require grant type' do - it_tests_required_parameter(:require_grant_type) + before do + @test = @sequence_class[:require_grant_type] + @sequence = @sequence_class.new(@instance, @client) + end + + it_tests_required_parameter(request_parameter: { grant_type: 'not_a_grant_type' }) end describe 'require client assertion type' do - it_tests_required_parameter(:require_client_assertion_type) + before do + @test = @sequence_class[:require_client_assertion_type] + @sequence = @sequence_class.new(@instance, @client) + end + + it_tests_required_parameter(request_parameter: { client_assertion_type: 'not_a_assertion_type' }) end describe 'require JWT iss' do - it_tests_required_parameter(:require_jwt_iss) + before do + @test = @sequence_class[:require_jwt_iss] + @sequence = @sequence_class.new(@instance, @client) + end + + it_tests_required_parameter(jwt_token_parameter: { name: 'iss', value: 'not_a_iss' }) end describe 'require JWT sub' do - it_tests_required_parameter(:require_jwt_sub) + before do + @test = @sequence_class[:require_jwt_sub] + @sequence = @sequence_class.new(@instance, @client) + end + + it_tests_required_parameter(jwt_token_parameter: { name: 'sub', value: 'not_a_sub' }) end describe 'require JWT aud' do - it_tests_required_parameter(:require_jwt_aud) + before do + @test = @sequence_class[:require_jwt_aud] + @sequence = @sequence_class.new(@instance, @client) + end + + it_tests_required_parameter(jwt_token_parameter: { name: 'aud', value: 'not_a_aud' }) end describe 'require JWT exp' do - it_tests_required_parameter(:require_jwt_exp) + before do + @test = @sequence_class[:require_jwt_exp] + @sequence = @sequence_class.new(@instance, @client) + end + + it_tests_required_parameter(jwt_token_parameter: { name: 'exp', value: nil }) end describe 'require JWT exp less than 5 minutes' do - it_tests_required_parameter(:require_jwt_exp_value) + before do + @test = @sequence_class[:require_jwt_exp_value] + @sequence = @sequence_class.new(@instance, @client) + end + + it_tests_required_parameter(jwt_token_parameter: { name: 'exp', value: 10.minutes.from_now }) end describe 'require JWT jti' do - it_tests_required_parameter(:require_jwt_jti) + before do + @test = @sequence_class[:require_jwt_jti] + @sequence = @sequence_class.new(@instance, @client) + end + + it_tests_required_parameter(jwt_token_parameter: { name: 'jti', value: nil }) end describe 'sign with private key' do - it_tests_required_parameter(:correct_signature) + before do + @test = @sequence_class[:correct_signature] + @sequence = @sequence_class.new(@instance, @client) + @sequence.jti = SecureRandom.hex(32) + @sequence.expires_in = 5.minutes.from_now + @sequence.is_unit_test = true + @payload = @sequence.create_post_palyload(bulk_private_key: @sequence.invalid_private_key.to_json) + end + + it_tests_required_parameter end describe 'return access token tests' do From a77ed852a65c6ac4dc17384d4e524393e68ecd4c Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 27 Nov 2019 13:33:07 -0600 Subject: [PATCH 165/173] Fix PR --- .../bulk_data_authorization_sequence.rb | 35 ++++++++++++------- .../test/authorization_sequence_test.rb | 29 +++++++++------ 2 files changed, 40 insertions(+), 24 deletions(-) diff --git a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb index 1fab7a14d..b386e12d8 100644 --- a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb @@ -107,7 +107,7 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :require_content_type do metadata do id '01' - name 'Bulk Data authorization request shall use content_type "application/x-www-form-urlencoded"' + name 'Bulk Data server shall reject authorization requests which do not use content_type "application/x-www-form-urlencoded"' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( After generating an authentication JWT, the client requests a new access token via HTTP POST to the FHIR authorization server’s token endpoint URL, using content-type application/x-www-form-urlencoded @@ -121,12 +121,12 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :require_system_scope do metadata do id '02' - name 'Bulk Data authorization request shall use "system" scope' + name 'Bulk Data server shall reject authorization requests which do not use "system" scope' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#scopes' description %( - clients SHALL use “system” scopes. + clients SHALL use `system` scopes. - System scopes have the format system/(:resourceType|*).(read|write|*) + System scopes have the format `system/(:resourceType|*).(read|write|*)` ) end @@ -137,9 +137,10 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :require_grant_type do metadata do id '03' - name 'Bulk Data authorization request shall use grand_type "client_credentials"' + name 'Bulk Data server shall reject authorization requests which do not use grant_type "client_credentials"' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( + | Parameter | Required? | Description | | --- | --- | --- | | grant_type | required | Fixed value: client_credentials | ) @@ -152,9 +153,10 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :require_client_assertion_type do metadata do id '04' - name 'Bulk Data authorization request shall use client_assertion_type "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"' + name 'Bulk Data server shall reject authorization requests which do not use client_assertion_type "urn:ietf:params:oauth:client-assertion-type:jwt-bearer"' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( + | Parameter | Required? | Description | | --- | --- | --- | | client_assertion_type | required | Fixed value: urn:ietf:params:oauth:client-assertion-type:jwt-bearer | ) @@ -167,9 +169,10 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :require_jwt_iss do metadata do id '05' - name 'Bulk Data authorization request shall use client_id as JWT issuer ' + name 'Bulk Data server shall reject authorization requests which do not use client_id as JWT issuer ' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( + | JWT Claim | Required? | Description | | --- | --- | --- | | iss | required | Issuer of the JWT -- the client's client_id, as determined during registration with the FHIR authorization server (note that this is the same as the value for the sub claim) | ) @@ -182,9 +185,10 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :require_jwt_sub do metadata do id '06' - name 'Bulk Data authorization request shall use client_id as JWT subject ' + name 'Bulk Data server shall reject authorization requests which do not use client_id as JWT subject ' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( + | JWT Claim | Required? | Description | | --- | --- | --- | | sub | required | The service's client_id, as determined during registration with the FHIR authorization server (note that this is the same as the value for the iss claim) | ) @@ -197,9 +201,10 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :require_jwt_aud do metadata do id '07' - name 'Bulk Data authorization request shall use token url as JWT audience ' + name 'Bulk Data server shall reject authorization requests which do not use token url as JWT audience ' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( + | JWT Claim | Required? | Description | | --- | --- | --- | | aud | required | The FHIR authorization server's "token URL" (the same URL to which this authentication JWT will be posted) | ) @@ -212,9 +217,10 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :require_jwt_exp do metadata do id '08' - name 'Bulk Data authorization request shall have JWT expiration time' + name 'Bulk Data server shall reject authorization requests which do not have JWT expiration time' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( + | JWT Claim | Required? | Description | | --- | --- | --- | | exp | required | Expiration time integer for this authentication JWT, expressed in seconds since the "Epoch" (1970-01-01T00:00:00Z UTC). This time SHALL be no more than five minutes in the future. | ) @@ -227,9 +233,10 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :require_jwt_exp_value do metadata do id '09' - name 'Bulk Data authorization request shall have JWT expiration time no more than 5 minutes in the future' + name 'Bulk Data server shall reject authorization requests which have JWT expiration time more than 5 minutes in the future' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( + | JWT Claim | Required? | Description | | --- | --- | --- | | exp | required | Expiration time integer for this authentication JWT, expressed in seconds since the "Epoch" (1970-01-01T00:00:00Z UTC). This time SHALL be no more than five minutes in the future. | ) @@ -242,9 +249,10 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :require_jwt_jti do metadata do id '10' - name 'Bulk Data authorization request shall have JWT ID' + name 'Bulk Data server shall reject authorization requests which do not have JWT ID' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( + | JWT Claim | Required? | Description | | --- | --- | --- | | jti | required | A nonce string value that uniquely identifies this authentication JWT. | ) @@ -257,7 +265,7 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, test :correct_signature do metadata do id '11' - name 'Bulk Data authorization request shall be signed by client private key' + name 'Bulk Data server shall reject authorization requests which are not signed by client private key' link 'https://build.fhir.org/ig/HL7/bulk-data/authorization/index.html#protocol-details' description %( The authentication JWT SHALL include the following claims, and SHALL be signed with the client’s private key @@ -280,6 +288,7 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, The access token response SHALL be a JSON object with the following properties: + | Token Property | Required? | Description | | --- | --- | --- | | access_token | required | The access token issued by the authorization server. | | token_type | required | Fixed value: bearer. | diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index b896b5111..5ceb09547 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -1,4 +1,4 @@ -#frozen_string_literal: true +# frozen_string_literal: true require_relative '../../../../test/test_helper' @@ -42,6 +42,15 @@ def build_request(status_code, request_headers, request_parameter, jwt_token_par end end + def it_tests_invalid_private_key(client_assertion, jwk) + begin + JSON::JWT.decode(client_assertion, jwk.to_key) + false + rescue JSON::JWT::VerificationFailed + true + end + end + def it_tests_client_assertion(request_payload, parameter) uri = Addressable::URI.new uri.query = request_payload @@ -49,17 +58,15 @@ def it_tests_client_assertion(request_payload, parameter) jwk = JSON::JWK.new(JSON.parse(@instance.bulk_public_key)) + return it_tests_invalid_private_key(client_assertion, jwk) if parameter[:name] == 'bulk_private_key' + jwt_token = JSON::JWT.decode(client_assertion, jwk.to_key) - if parameter[:value].present? - if parameter[:name] == 'exp' - jwt_token[parameter[:name]] >= parameter[:value].to_i - else - jwt_token[parameter[:name]] == parameter[:value] - end - else - jwt_token.key?(parameter[:name]) == false - end + return jwt_token.key?(parameter[:name]) == false if parameter[:value].nil? + + return jwt_token[parameter[:name]] >= parameter[:value].to_i if parameter[:name] == 'exp' + + jwt_token[parameter[:name]] == parameter[:value] end def self.it_tests_required_parameter(request_headers: nil, request_parameter: nil, jwt_token_parameter: nil) @@ -180,7 +187,7 @@ def self.it_tests_required_parameter(request_headers: nil, request_parameter: ni @payload = @sequence.create_post_palyload(bulk_private_key: @sequence.invalid_private_key.to_json) end - it_tests_required_parameter + it_tests_required_parameter(jwt_token_parameter: { name: 'bulk_private_key', value: nil }) end describe 'return access token tests' do From e1732c97d63ea509ca702182ac3a262a04ea13c5 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 27 Nov 2019 13:39:17 -0600 Subject: [PATCH 166/173] fix rubocop --- .../bulk_data/test/authorization_sequence_test.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index 5ceb09547..d143e750f 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -43,12 +43,10 @@ def build_request(status_code, request_headers, request_parameter, jwt_token_par end def it_tests_invalid_private_key(client_assertion, jwk) - begin - JSON::JWT.decode(client_assertion, jwk.to_key) - false - rescue JSON::JWT::VerificationFailed - true - end + JSON::JWT.decode(client_assertion, jwk.to_key) + false + rescue JSON::JWT::VerificationFailed + true end def it_tests_client_assertion(request_payload, parameter) @@ -63,7 +61,7 @@ def it_tests_client_assertion(request_payload, parameter) jwt_token = JSON::JWT.decode(client_assertion, jwk.to_key) return jwt_token.key?(parameter[:name]) == false if parameter[:value].nil? - + return jwt_token[parameter[:name]] >= parameter[:value].to_i if parameter[:name] == 'exp' jwt_token[parameter[:name]] == parameter[:value] From ba8dbbb9d8f0b2571d5398546a5f0ca303e65946 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 27 Nov 2019 13:43:24 -0600 Subject: [PATCH 167/173] reduce complexity --- .../test/authorization_sequence_test.rb | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index d143e750f..e355cc398 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -42,28 +42,31 @@ def build_request(status_code, request_headers, request_parameter, jwt_token_par end end - def it_tests_invalid_private_key(client_assertion, jwk) - JSON::JWT.decode(client_assertion, jwk.to_key) - false - rescue JSON::JWT::VerificationFailed - true - end - def it_tests_client_assertion(request_payload, parameter) uri = Addressable::URI.new uri.query = request_payload client_assertion = uri.query_values['client_assertion'] - jwk = JSON::JWK.new(JSON.parse(@instance.bulk_public_key)) return it_tests_invalid_private_key(client_assertion, jwk) if parameter[:name] == 'bulk_private_key' + it_tests_jwt_token_values(client_assertion, jwk, parameter) + end + + def it_tests_invalid_private_key(client_assertion, jwk) + JSON::JWT.decode(client_assertion, jwk.to_key) + false + rescue JSON::JWT::VerificationFailed + true + end + + def it_tests_jwt_token_values(client_assertion, jwk, parameter) jwt_token = JSON::JWT.decode(client_assertion, jwk.to_key) return jwt_token.key?(parameter[:name]) == false if parameter[:value].nil? return jwt_token[parameter[:name]] >= parameter[:value].to_i if parameter[:name] == 'exp' - + jwt_token[parameter[:name]] == parameter[:value] end From d25082010efe9baef77f40b7b834e53a212c0470 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 27 Nov 2019 13:44:05 -0600 Subject: [PATCH 168/173] remove @payload --- lib/modules/bulk_data/test/authorization_sequence_test.rb | 6 ------ 1 file changed, 6 deletions(-) diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index e355cc398..8fa5c6286 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -37,8 +37,6 @@ def build_request(status_code, request_headers, request_parameter, jwt_token_par a_request.with(body: hash_including(request_parameter)) elsif jwt_token_parameter.present? a_request.with { |request| it_tests_client_assertion(request.body, jwt_token_parameter) } - elsif @payload.present? - a_request.with(body: @payload) end end @@ -182,10 +180,6 @@ def self.it_tests_required_parameter(request_headers: nil, request_parameter: ni before do @test = @sequence_class[:correct_signature] @sequence = @sequence_class.new(@instance, @client) - @sequence.jti = SecureRandom.hex(32) - @sequence.expires_in = 5.minutes.from_now - @sequence.is_unit_test = true - @payload = @sequence.create_post_palyload(bulk_private_key: @sequence.invalid_private_key.to_json) end it_tests_required_parameter(jwt_token_parameter: { name: 'bulk_private_key', value: nil }) From 562d2083c85e414f66ec5352a793920d867ef235 Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Wed, 27 Nov 2019 13:44:25 -0600 Subject: [PATCH 169/173] fix rubocop --- lib/modules/bulk_data/test/authorization_sequence_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/bulk_data/test/authorization_sequence_test.rb b/lib/modules/bulk_data/test/authorization_sequence_test.rb index 8fa5c6286..6a4c3dc7c 100644 --- a/lib/modules/bulk_data/test/authorization_sequence_test.rb +++ b/lib/modules/bulk_data/test/authorization_sequence_test.rb @@ -64,7 +64,7 @@ def it_tests_jwt_token_values(client_assertion, jwk, parameter) return jwt_token.key?(parameter[:name]) == false if parameter[:value].nil? return jwt_token[parameter[:name]] >= parameter[:value].to_i if parameter[:name] == 'exp' - + jwt_token[parameter[:name]] == parameter[:value] end From 939e41d0f7a893eab622c18b8d7d139225dd808c Mon Sep 17 00:00:00 2001 From: Yunwei Wang Date: Fri, 29 Nov 2019 08:53:03 -0600 Subject: [PATCH 170/173] remove unused variables --- .../bulk_data_authorization_sequence.rb | 47 ++++++++----------- 1 file changed, 20 insertions(+), 27 deletions(-) diff --git a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb index b386e12d8..963662319 100644 --- a/lib/modules/bulk_data/bulk_data_authorization_sequence.rb +++ b/lib/modules/bulk_data/bulk_data_authorization_sequence.rb @@ -9,8 +9,6 @@ class BulkDataAuthorizationSequence < SequenceBase requires :bulk_client_id, :bulk_private_key, :bulk_token_endpoint - attr_accessor :jti, :expires_in, :is_unit_test - def invalid_private_key { "kty": 'RSA', @@ -48,33 +46,28 @@ def authorize(bulk_private_key: @instance.bulk_private_key, accept: 'application/json' }.compact - payload = create_post_palyload(bulk_private_key: bulk_private_key, - scope: scope, - grant_type: grant_type, - client_assertion_type: client_assertion_type, - iss: iss, - sub: sub, - aud: aud, - exp: exp, - jti: jti) + payload = create_post_palyload(bulk_private_key, + scope, + grant_type, + client_assertion_type, + iss, + sub, + aud, + exp, + jti) LoggedRestClient.post(@instance.bulk_token_endpoint, payload, header) end - def create_post_palyload(bulk_private_key: @instance.bulk_private_key, - scope: 'system/*.read', - grant_type: 'client_credentials', - client_assertion_type: 'urn:ietf:params:oauth:client-assertion-type:jwt-bearer', - iss: @instance.bulk_client_id, - sub: @instance.bulk_client_id, - aud: @instance.bulk_token_endpoint, - exp: 5.minutes.from_now, - jti: SecureRandom.hex(32)) - - if @is_unit_test - jti = @jti - exp = @expires_in - end + def create_post_palyload(bulk_private_key, + scope, + grant_type, + client_assertion_type, + iss, + sub, + aud, + exp, + jti) jwt_token = JSON::JWT.new( iss: iss, @@ -90,7 +83,7 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, jwk_private_key = jwk.to_key client_assertion = jwt_token.sign(jwk_private_key, 'RS384') - payload = + query_values = { 'scope' => scope, 'grant_type' => grant_type, @@ -99,7 +92,7 @@ def create_post_palyload(bulk_private_key: @instance.bulk_private_key, }.compact uri = Addressable::URI.new - uri.query_values = payload + uri.query_values = query_values uri.query end From ebccc049e0dcead708cdadb0045627ce8440ca3e Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Fri, 29 Nov 2019 13:05:43 -0500 Subject: [PATCH 171/173] Updates to configuration. --- config.yml | 1 - lib/modules/onc_program_r4_module.yml | 136 -------------------------- 2 files changed, 137 deletions(-) delete mode 100644 lib/modules/onc_program_r4_module.yml diff --git a/config.yml b/config.yml index afa56c0d4..d53c75156 100644 --- a/config.yml +++ b/config.yml @@ -40,7 +40,6 @@ badge_text: Community # module options: one or more must be set. The first option in the list will be checked by default modules: - onc - - onc_r4 - smart - bdt - argonaut diff --git a/lib/modules/onc_program_r4_module.yml b/lib/modules/onc_program_r4_module.yml deleted file mode 100644 index bfcd1a140..000000000 --- a/lib/modules/onc_program_r4_module.yml +++ /dev/null @@ -1,136 +0,0 @@ -name: onc_r4 -title: Preliminary ONC Health IT Certification - -description : | - - The US Core R4 Test verifies conformance to the US Core R4 Implementation Guide. - - This section is under development and tested against the CI Build of the IG. - - [US Core R4 Implementation Guide CI Build](https://build.fhir.org/ig/HL7/US-Core-R4/index.html) - -fhir_version: r4 -default_test_set: test_procedure -hide_optional: true -test_sets: - test_procedure: - view: guided - tests: - - name: Discovery and Registration - overview: | - Servers must provide the ability to register Inferno as a SMART on FHIR application. This set of tests provides the tester with - registration information to be entered into the system under test. Once registered, the tester should be provided - a *Client ID*, and optionally a *Client Secret*, to enter into Inferno. This set of tests also requires the server to demonstrate - the ability to provide required service metadata through the discovery endpoints, including OAuth endpoints, - supported resources and searches. - input_instructions: | - Register Inferno as a SMART on FHIR app with the following *Launch URI* and *Redirect URI*. You may either register the app as - a confidential client or a public client. Enter in the *Client ID*, and the *Client Secret* if applicable, as provided by the - authentication system through a manual registration process. - sequences: - - sequence: ManualRegistrationSequence - title: Manual App Registration - - sequence: UsCoreR4CapabilityStatementSequence - - ONCSMARTDiscoverySequence - - name: Standalone Patient App - overview: | - Demonstrate the ability to perform a Patient Standalone Launch to a [SMART on FHIR](http://www.hl7.org/fhir/smart-app-launch/) client with a patient context, - refresh token, and [OpenID Connect (OIDC)](https://openid.net/specs/openid-connect-core-1_0.html) identity token. After launch, a simple Patient resource read is performed - on the patient in context. The access token is then refreshed, and the Patient resource is read using the new - access token to ensure that the refresh was successful. Finally, the authentication information provided by OpenID Connect is decoded and validated. - input_instructions: | - Enter in the appropriate scope to enable patient-level access to all relevant resources. In addition, support for the - OpenID Connect (`openid fhirUser`), refresh tokens (`offline_access`), and patient context (`launch/patient`) are required. - lock_variables: - - client_id - - confidential_client - - client_secret - - oauth_authorize_endpoint - - oauth_token_endpoint - - redirect_uris - sequences: - - sequence: OncStandaloneLaunchSequence - title: Standalone Launch with Patient Scope - description: Perform Standalone SMART launch sequence and test OpenID Connect and token refresh functionality. - variable_defaults: - scopes: launch/patient patient/*.read openid fhirUser offline_access - - sequence: USCoreR4PatientReadOnlySequence - title: Read Patient Resource - description: Demonstrate successful authorization by reading Patient resource. - - sequence: OpenIDConnectSequence - description: Use OpenID Connect ID token provided during launch sequence to authenticate user. - - TokenRefreshSequence - - sequence: USCoreR4PatientReadOnlySequence - title: Read Patient Resource - description: Ensure new token is functional by performing a simple read of the Patient resource. - - name: EHR Practitioner App - overview: | - Demonstrate the ability to perform an EHR launch to a [SMART on FHIR](http://www.hl7.org/fhir/smart-app-launch/) client with a patient context, - refresh token, and [OpenID Connect (OIDC)](https://openid.net/specs/openid-connect-core-1_0.html) identity token. After launch, a simple Patient resource read is performed - on the patient in context. The access token is then refreshed, and the Patient resource is read using the new - access token to ensure that the refresh was successful. Finally, the authentication information provided by OpenID Connect is decoded and validated. - sequences: - - sequence: OncEHRLaunchSequence - title: EHR Launch with Practitioner Scope - description: Perform EHR SMART launch sequence and test OpenID Connect and token refresh functionality. - variable_defaults: - scopes: launch user/*.read openid fhirUser offline_access - - sequence: USCoreR4PatientReadOnlySequence - title: Read Patient Resource - description: Demonstrate successful authorization by reading Patient resource. - - sequence: OpenIDConnectSequence - description: Use OpenID Connect ID token provided during launch sequence to authenticate user. - - TokenRefreshSequence - - sequence: USCoreR4PatientReadOnlySequence - title: Read Patient Resource - description: Ensure new token is functional by performing a simple read of the Patient resource. - input_instructions: | - Enter in the appropriate scope to enable user-level access to all relevant resources. In addition, support for the - OpenID Connect (`openid fhirUser`), refresh tokens (`offline_access`), and EHR context (`launch`) are required. This test - expects that the EHR will launch the application with a patient context. - - After `execute` is pressed, Inferno will wait for the system under test to launch the application. - lock_variables: - - client_id - - confidential_client - - client_secret - - oauth_authorize_endpoint - - oauth_token_endpoint - - redirect_uris - - name: Data Access - run_all: true - run_skipped: true - overview: > - For each of the relevant USCDI data elements provided in the conformance statement, this test executes the [required supported searches](http://www.fhir.org/guides/argonaut/r2/Conformance-server.html) - as defined by the Argonaut Data Query Implementation Guide. The test begins by searching by Patient provided in the most recent SMART App Launch performed by Inferno. It uses results returned from that - query to generate other queries and checks that the results are consistent with the provided search parameters. It then performs a read on each Resource returned and validates the response against the - relevant [profile](http://www.fhir.org/guides/argonaut/r2/profiles.html) as currently defined in the Argonaut Data Query Implementation Guide. - lock_variables: - - patient_id - - token - sequences: - - USCore310AllergyintoleranceSequence - - USCore310CareplanSequence - - USCore310CareteamSequence - - USCore310ConditionSequence - - USCore310ImplantableDeviceSequence - - USCore310DiagnosticreportNoteSequence - - USCore310DiagnosticreportLabSequence - - USCore310DocumentreferenceSequence - - USCore310EncounterSequence - - USCore310GoalSequence - - USCore310ImmunizationSequence - - USCore310MedicationrequestSequence - - USCore310SmokingstatusSequence - - USCore310PediatricWeightForHeightSequence - - USCore310ObservationLabSequence - - USCore310PediatricBmiForAgeSequence - - USCore310PatientSequence - - USCore310ProcedureSequence - - R4ProvenanceSequence - - USCoreR4ClinicalNotesSequence - - USCore310LocationSequence - - USCore310MedicationSequence - - USCore310OrganizationSequence - - USCore310PractitionerSequence - - USCore310PractitionerroleSequence \ No newline at end of file From a80380d11d5e74c3149bfef1ed8175410b8aa4b3 Mon Sep 17 00:00:00 2001 From: Rob Scanlon Date: Fri, 29 Nov 2019 13:15:37 -0500 Subject: [PATCH 172/173] Change referenced module in the provenance test. --- .../us_core_guidance/test/r4_provenance_sequence_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/modules/us_core_guidance/test/r4_provenance_sequence_test.rb b/lib/modules/us_core_guidance/test/r4_provenance_sequence_test.rb index ef2e24a86..48f1849b0 100644 --- a/lib/modules/us_core_guidance/test/r4_provenance_sequence_test.rb +++ b/lib/modules/us_core_guidance/test/r4_provenance_sequence_test.rb @@ -35,7 +35,7 @@ def setup base_url: 'http://localhost:4567', client_endpoint_key: Inferno::SecureRandomBase62.generate(32), client_id: SecureRandom.uuid, - selected_module: 'onc_r4', + selected_module: 'uscore_v3.1.0', oauth_authorize_endpoint: 'http://oauth_reg.example.com/authorize', oauth_token_endpoint: 'http://oauth_reg.example.com/token', scopes: 'launch openid patient/*.* profile', From 40ca6b2c5fccee8e302557623b850cfadc44d837 Mon Sep 17 00:00:00 2001 From: Stephen MacVicar Date: Fri, 29 Nov 2019 13:20:09 -0500 Subject: [PATCH 173/173] bump version --- lib/version.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/version.rb b/lib/version.rb index a3275557a..7d0485a52 100644 --- a/lib/version.rb +++ b/lib/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module Inferno - VERSION = '2.8.0-pre1' + VERSION = '2.8.0' end