Class: USCoreTestKit::Generator::MustSupportMetadataExtractorUsCore6
- Inherits:
-
Object
- Object
- USCoreTestKit::Generator::MustSupportMetadataExtractorUsCore6
- Defined in:
- lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb
Constant Summary collapse
- US_CORE_CATEGORY =
['sdoh', 'functional-status', 'disability-status', 'cognitive-status']
Instance Attribute Summary collapse
-
#must_supports ⇒ Object
Returns the value of attribute must_supports.
-
#profile ⇒ Object
Returns the value of attribute profile.
Instance Method Summary collapse
- #add_must_support_choices ⇒ Object
- #add_patient_uscdi_elements ⇒ Object
- #handle_special_cases ⇒ Object
-
#initialize(profile, must_supports) ⇒ MustSupportMetadataExtractorUsCore6
constructor
A new instance of MustSupportMetadataExtractorUsCore6.
-
#remove_diagnosticreport_media ⇒ Object
US Core v6.1.0 Patch FHIR-46240, Remove the Must Support on media and media.link.
-
#remove_patient_gender_identity ⇒ Object
genderIdentify is removed as directed by ASTP/ONC enforcement discretion issued on March 21, 2025: www.healthit.gov/topic/certification-ehrs/enforcement-discretion.
-
#remove_practitioner_address ⇒ Object
US Core v6.1.0 Patch FHIR-44693, Add MustSupport choice between Practitioner.address and PractitionerRole This is fixed formally in US Core v7.
-
#update_smoking_status_effective ⇒ Object
US Core v6.1.0 Patch FHIR-43355, US Core Smoking Status Observation Profile may be supported either Observation.effectiveDateTime or Observation.effectivePeriod data element.
- #us_core_3_extractor ⇒ Object
- #us_core_4_extractor ⇒ Object
- #us_core_5_extractor ⇒ Object
Constructor Details
#initialize(profile, must_supports) ⇒ MustSupportMetadataExtractorUsCore6
Returns a new instance of MustSupportMetadataExtractorUsCore6.
10 11 12 13 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 10 def initialize(profile, must_supports) self.profile = profile self.must_supports = must_supports end |
Instance Attribute Details
#must_supports ⇒ Object
Returns the value of attribute must_supports.
6 7 8 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 6 def must_supports @must_supports end |
#profile ⇒ Object
Returns the value of attribute profile.
6 7 8 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 6 def profile @profile end |
Instance Method Details
#add_must_support_choices ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 36 def add_must_support_choices us_core_5_extractor.add_must_support_choices more_choices = [] case profile.type when 'Goal' more_choices << { paths: ['startDate', 'target.dueDate'] } when 'MedicationRequest' more_choices << { paths: ['reasonCode', 'reasonReference'], uscdi_only: true } when 'ServiceRequest' more_choices << { paths: ['reasonCode', 'reasonReference'], uscdi_only: true } end if profile.id == 'us-core-observation-screening-assessment' more_choices << { target_profiles: [ 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-screening-assessment', 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-questionnaireresponse' ] } end if more_choices.present? must_supports[:choices] ||= [] must_supports[:choices].concat(more_choices) end end |
#add_patient_uscdi_elements ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 73 def add_patient_uscdi_elements return unless profile.type == 'Patient' us_core_4_extractor.add_patient_telecom_communication_uscdi us_core_3_extractor.update_patient_previous_name_address must_supports[:elements].each do |element| case element[:path] when 'deceased[x]' element[:original_path] = element[:path] element[:path] = 'deceasedDateTime' end end end |
#handle_special_cases ⇒ Object
27 28 29 30 31 32 33 34 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 27 def handle_special_cases add_must_support_choices add_patient_uscdi_elements update_smoking_status_effective remove_practitioner_address remove_diagnosticreport_media remove_patient_gender_identity end |
#remove_diagnosticreport_media ⇒ Object
US Core v6.1.0 Patch FHIR-46240, Remove the Must Support on media and media.link
106 107 108 109 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 106 def remove_diagnosticreport_media return unless profile.id == 'us-core-diagnosticreport-note' must_supports[:elements].delete_if { |element| element[:path].start_with?('media') } end |
#remove_patient_gender_identity ⇒ Object
genderIdentify is removed as directed by ASTP/ONC enforcement discretion issued on March 21, 2025: www.healthit.gov/topic/certification-ehrs/enforcement-discretion
113 114 115 116 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 113 def remove_patient_gender_identity return unless profile.type == 'Patient' must_supports[:extensions].delete_if { |extension| extension[:id] == 'Patient.extension:genderIdentity' } end |
#remove_practitioner_address ⇒ Object
US Core v6.1.0 Patch FHIR-44693, Add MustSupport choice between Practitioner.address and PractitionerRole This is fixed formally in US Core v7
99 100 101 102 103 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 99 def remove_practitioner_address return unless profile.type == 'Practitioner' must_supports[:elements].delete_if { |element| element[:path].start_with?('address') } end |
#update_smoking_status_effective ⇒ Object
US Core v6.1.0 Patch FHIR-43355, US Core Smoking Status Observation Profile may be supported either Observation.effectiveDateTime or Observation.effectivePeriod data element
90 91 92 93 94 95 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 90 def update_smoking_status_effective return unless profile.id == 'us-core-smokingstatus' must_supports[:slices].delete_if { |slice| slice[:slice_id] == 'Observation.effective[x]:effectiveDateTime' } must_supports[:elements] << { path: 'effective[x]' } end |
#us_core_3_extractor ⇒ Object
15 16 17 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 15 def us_core_3_extractor @us_core_3_extractor ||= MustSupportMetadataExtractorUsCore3.new(profile, must_supports) end |
#us_core_4_extractor ⇒ Object
19 20 21 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 19 def us_core_4_extractor @us_core_4_extractor ||= MustSupportMetadataExtractorUsCore4.new(profile, must_supports) end |
#us_core_5_extractor ⇒ Object
23 24 25 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 23 def us_core_5_extractor @us_core_5_extractor ||= MustSupportMetadataExtractorUsCore5.new(profile, must_supports) end |