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.
- #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
32 33 34 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 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 32 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
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 |
# File 'lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb', line 69 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 |
# 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 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 |