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
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_coverage_group_name ⇒ Object
US Core v6.1.0 Patch FHIR-50283, Remove MustSupport element from Coverage: - group name.
-
#remove_diagnosticreport_media ⇒ Object
US Core v6.1.0 Patch FHIR-46240, Remove the Must Support on media and media.link.
-
#remove_medicationdispense_practitioner ⇒ Object
US Core v6.1.0 Patch FHIR-50239, Remove MustSupport target profile from MedicationDispense.performer.actor - US Core Practitioner.
-
#remove_must_supports_from_encounter_diagnosis ⇒ Object
US Core v6.1.0 Patch FHIR-50288, Remove these MustSupport elements from US Core Condition Encounter Diagnosis: - Condition.extension:assertedDate - Condition.onsetDateTime - clinical status - verification status.
-
#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.
6 7 8 9 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 6 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.
4 5 6 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 4 def must_supports @must_supports end |
#profile ⇒ Object
Returns the value of attribute profile.
4 5 6 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 4 def profile @profile end |
Instance Method Details
#add_must_support_choices ⇒ Object
35 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 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 35 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
72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 72 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
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 23 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 remove_medicationdispense_practitioner remove_coverage_group_name remove_must_supports_from_encounter_diagnosis end |
#remove_coverage_group_name ⇒ Object
US Core v6.1.0 Patch FHIR-50283, Remove MustSupport element from Coverage:
-
group name
130 131 132 133 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 130 def remove_coverage_group_name return unless profile.type == 'Coverage' must_supports[:elements].delete_if { |element| element[:path] == 'class:group.name' } end |
#remove_diagnosticreport_media ⇒ Object
US Core v6.1.0 Patch FHIR-46240, Remove the Must Support on media and media.link
105 106 107 108 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 105 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_medicationdispense_practitioner ⇒ Object
US Core v6.1.0 Patch FHIR-50239, Remove MustSupport target profile from MedicationDispense.performer.actor
-
US Core Practitioner
119 120 121 122 123 124 125 126 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 119 def remove_medicationdispense_practitioner return unless profile.type == 'MedicationDispense' element = must_supports[:elements].find { |element| element[:path] == 'performer.actor' } element[:target_profiles].delete_if do |url| url == 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner' end end |
#remove_must_supports_from_encounter_diagnosis ⇒ Object
US Core v6.1.0 Patch FHIR-50288, Remove these MustSupport elements from US Core Condition Encounter Diagnosis:
-
Condition.extension:assertedDate
-
Condition.onsetDateTime
-
clinical status
-
verification status
140 141 142 143 144 145 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 140 def remove_must_supports_from_encounter_diagnosis return unless profile.id == 'us-core-condition-encounter-diagnosis' must_supports[:extensions].delete_if { |extension| extension[:id] == 'Condition.extension:assertedDate' } must_supports[:elements].delete_if { |element| ['onsetDateTime', 'clinicalStatus', 'verificationStatus'].include?(element[:path]) } must_supports[:choices].delete_if { |choice| choice[:paths].include?('onsetDateTime') } 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
112 113 114 115 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 112 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
98 99 100 101 102 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 98 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
89 90 91 92 93 94 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 89 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
11 12 13 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 11 def us_core_3_extractor @us_core_3_extractor ||= MustSupportMetadataExtractorUsCore3.new(profile, must_supports) end |
#us_core_4_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_4_extractor @us_core_4_extractor ||= MustSupportMetadataExtractorUsCore4.new(profile, must_supports) end |
#us_core_5_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_5_extractor @us_core_5_extractor ||= MustSupportMetadataExtractorUsCore5.new(profile, must_supports) end |