us_core_test_kit 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (144) hide show
  1. checksums.yaml +4 -4
  2. data/lib/us_core_test_kit/custom_groups/smart_app_launch_group.rb +2 -2
  3. data/lib/us_core_test_kit/generated/v3.1.1/metadata.yml +10 -0
  4. data/lib/us_core_test_kit/generated/v3.1.1/patient/metadata.yml +10 -0
  5. data/lib/us_core_test_kit/generated/v4.0.0/metadata.yml +10 -0
  6. data/lib/us_core_test_kit/generated/v4.0.0/patient/metadata.yml +10 -0
  7. data/lib/us_core_test_kit/generated/v5.0.1/metadata.yml +21 -2
  8. data/lib/us_core_test_kit/generated/v5.0.1/patient/metadata.yml +6 -2
  9. data/lib/us_core_test_kit/generated/v5.0.1/practitioner_role/metadata.yml +155 -0
  10. data/lib/us_core_test_kit/generated/v5.0.1/practitioner_role/practitioner_role_must_support_test.rb +45 -0
  11. data/lib/us_core_test_kit/generated/v5.0.1/practitioner_role/practitioner_role_practitioner_search_test.rb +41 -0
  12. data/lib/us_core_test_kit/generated/v5.0.1/practitioner_role/practitioner_role_read_test.rb +26 -0
  13. data/lib/us_core_test_kit/generated/v5.0.1/practitioner_role/practitioner_role_reference_resolution_test.rb +43 -0
  14. data/lib/us_core_test_kit/generated/v5.0.1/practitioner_role/practitioner_role_specialty_search_test.rb +53 -0
  15. data/lib/us_core_test_kit/generated/v5.0.1/practitioner_role/practitioner_role_validation_test.rb +40 -0
  16. data/lib/us_core_test_kit/generated/v5.0.1/practitioner_role_group.rb +89 -0
  17. data/lib/us_core_test_kit/generated/v5.0.1/us_core_test_suite.rb +2 -0
  18. data/lib/us_core_test_kit/generated/v6.1.0/metadata.yml +17 -2
  19. data/lib/us_core_test_kit/generated/v6.1.0/patient/metadata.yml +2 -2
  20. data/lib/us_core_test_kit/generated/v6.1.0/patient/patient_must_support_test.rb +0 -2
  21. data/lib/us_core_test_kit/generated/v6.1.0/practitioner_role/metadata.yml +155 -0
  22. data/lib/us_core_test_kit/generated/v6.1.0/practitioner_role/practitioner_role_must_support_test.rb +45 -0
  23. data/lib/us_core_test_kit/generated/v6.1.0/practitioner_role/practitioner_role_practitioner_search_test.rb +41 -0
  24. data/lib/us_core_test_kit/generated/v6.1.0/practitioner_role/practitioner_role_read_test.rb +26 -0
  25. data/lib/us_core_test_kit/generated/v6.1.0/practitioner_role/practitioner_role_reference_resolution_test.rb +43 -0
  26. data/lib/us_core_test_kit/generated/v6.1.0/practitioner_role/practitioner_role_specialty_search_test.rb +53 -0
  27. data/lib/us_core_test_kit/generated/v6.1.0/practitioner_role/practitioner_role_validation_test.rb +40 -0
  28. data/lib/us_core_test_kit/generated/v6.1.0/practitioner_role_group.rb +89 -0
  29. data/lib/us_core_test_kit/generated/v6.1.0/us_core_test_suite.rb +2 -0
  30. data/lib/us_core_test_kit/generated/v7.0.0-ballot/{vital_signs/vital_signs_patient_category_status_search_test.rb → location/location_address_city_search_test.rb} +7 -13
  31. data/lib/us_core_test_kit/generated/v7.0.0-ballot/{vital_signs/vital_signs_patient_code_date_search_test.rb → location/location_address_postalcode_search_test.rb} +7 -14
  32. data/lib/us_core_test_kit/generated/v7.0.0-ballot/location/location_address_search_test.rb +52 -0
  33. data/lib/us_core_test_kit/generated/v7.0.0-ballot/location/location_address_state_search_test.rb +43 -0
  34. data/lib/us_core_test_kit/generated/v7.0.0-ballot/{vital_signs/vital_signs_must_support_test.rb → location/location_must_support_test.rb} +17 -16
  35. data/lib/us_core_test_kit/generated/v7.0.0-ballot/{vital_signs/vital_signs_patient_category_search_test.rb → location/location_name_search_test.rb} +7 -13
  36. data/lib/us_core_test_kit/generated/v7.0.0-ballot/location/location_read_test.rb +26 -0
  37. data/lib/us_core_test_kit/generated/v7.0.0-ballot/{vital_signs/vital_signs_reference_resolution_test.rb → location/location_reference_resolution_test.rb} +6 -6
  38. data/lib/us_core_test_kit/generated/v7.0.0-ballot/{vital_signs/vital_signs_validation_test.rb → location/location_validation_test.rb} +7 -7
  39. data/lib/us_core_test_kit/generated/v7.0.0-ballot/location/metadata.yml +194 -0
  40. data/lib/us_core_test_kit/generated/v7.0.0-ballot/location_group.rb +93 -0
  41. data/lib/us_core_test_kit/generated/v7.0.0-ballot/metadata.yml +38 -273
  42. data/lib/us_core_test_kit/generated/v7.0.0-ballot/patient/metadata.yml +2 -2
  43. data/lib/us_core_test_kit/generated/v7.0.0-ballot/patient/patient_must_support_test.rb +0 -2
  44. data/lib/us_core_test_kit/generated/v7.0.0-ballot/practitioner_role/metadata.yml +160 -0
  45. data/lib/us_core_test_kit/generated/v7.0.0-ballot/practitioner_role/practitioner_role_must_support_test.rb +45 -0
  46. data/lib/us_core_test_kit/generated/v7.0.0-ballot/{vital_signs/vital_signs_patient_code_search_test.rb → practitioner_role/practitioner_role_practitioner_search_test.rb} +8 -20
  47. data/lib/us_core_test_kit/generated/v7.0.0-ballot/practitioner_role/practitioner_role_read_test.rb +26 -0
  48. data/lib/us_core_test_kit/generated/v7.0.0-ballot/practitioner_role/practitioner_role_reference_resolution_test.rb +43 -0
  49. data/lib/us_core_test_kit/generated/v7.0.0-ballot/{vital_signs/vital_signs_patient_category_date_search_test.rb → practitioner_role/practitioner_role_specialty_search_test.rb} +8 -14
  50. data/lib/us_core_test_kit/generated/v7.0.0-ballot/practitioner_role/practitioner_role_validation_test.rb +40 -0
  51. data/lib/us_core_test_kit/generated/v7.0.0-ballot/practitioner_role_group.rb +89 -0
  52. data/lib/us_core_test_kit/generated/v7.0.0-ballot/us_core_test_suite.rb +4 -2
  53. data/lib/us_core_test_kit/generator/group_generator.rb +2 -2
  54. data/lib/us_core_test_kit/generator/group_metadata.rb +3 -1
  55. data/lib/us_core_test_kit/generator/ig_metadata_extractor.rb +8 -1
  56. data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_3.rb +64 -18
  57. data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_4.rb +1 -18
  58. data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_5.rb +0 -15
  59. data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_6.rb +5 -2
  60. data/lib/us_core_test_kit/generator/special_cases.rb +17 -7
  61. data/lib/us_core_test_kit/granular_scope_checker.rb +1 -1
  62. data/lib/us_core_test_kit/version.rb +1 -1
  63. metadata +37 -91
  64. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/condition_patient_abatement_date_granular_scope_test.rb +0 -45
  65. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/condition_patient_asserted_date_granular_scope_test.rb +0 -45
  66. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/condition_patient_category_clinical_status_granular_scope_test.rb +0 -45
  67. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/condition_patient_category_encounter_granular_scope_test.rb +0 -45
  68. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/condition_patient_category_granular_scope_test.rb +0 -45
  69. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/condition_patient_clinical_status_granular_scope_test.rb +0 -45
  70. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/condition_patient_code_granular_scope_test.rb +0 -45
  71. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/condition_patient_granular_scope_test.rb +0 -45
  72. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/condition_patient_onset_date_granular_scope_test.rb +0 -45
  73. data/lib/us_core_test_kit/generated/v6.1.0/condition_encounter_diagnosis/condition_patient_recorded_date_granular_scope_test.rb +0 -45
  74. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_granular_scope1_group.rb +0 -38
  75. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_granular_scope2_group.rb +0 -38
  76. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_note/diagnostic_report_patient_category_date_granular_scope_test.rb +0 -45
  77. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_note/diagnostic_report_patient_category_granular_scope_test.rb +0 -45
  78. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_note/diagnostic_report_patient_code_date_granular_scope_test.rb +0 -45
  79. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_note/diagnostic_report_patient_code_granular_scope_test.rb +0 -45
  80. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_note/diagnostic_report_patient_granular_scope_test.rb +0 -45
  81. data/lib/us_core_test_kit/generated/v6.1.0/diagnostic_report_note/diagnostic_report_patient_status_granular_scope_test.rb +0 -45
  82. data/lib/us_core_test_kit/generated/v6.1.0/document_reference/document_reference_id_granular_scope_test.rb +0 -41
  83. data/lib/us_core_test_kit/generated/v6.1.0/document_reference/document_reference_patient_category_date_granular_scope_test.rb +0 -45
  84. data/lib/us_core_test_kit/generated/v6.1.0/document_reference/document_reference_patient_category_granular_scope_test.rb +0 -45
  85. data/lib/us_core_test_kit/generated/v6.1.0/document_reference/document_reference_patient_granular_scope_test.rb +0 -45
  86. data/lib/us_core_test_kit/generated/v6.1.0/document_reference/document_reference_patient_status_granular_scope_test.rb +0 -45
  87. data/lib/us_core_test_kit/generated/v6.1.0/document_reference/document_reference_patient_type_granular_scope_test.rb +0 -45
  88. data/lib/us_core_test_kit/generated/v6.1.0/document_reference/document_reference_patient_type_period_granular_scope_test.rb +0 -45
  89. data/lib/us_core_test_kit/generated/v6.1.0/document_reference_granular_scope1_group.rb +0 -39
  90. data/lib/us_core_test_kit/generated/v6.1.0/document_reference_granular_scope2_group.rb +0 -39
  91. data/lib/us_core_test_kit/generated/v6.1.0/observation_lab/observation_patient_category_date_granular_scope_test.rb +0 -45
  92. data/lib/us_core_test_kit/generated/v6.1.0/observation_lab/observation_patient_category_granular_scope_test.rb +0 -45
  93. data/lib/us_core_test_kit/generated/v6.1.0/observation_lab/observation_patient_category_status_granular_scope_test.rb +0 -45
  94. data/lib/us_core_test_kit/generated/v6.1.0/observation_lab/observation_patient_code_date_granular_scope_test.rb +0 -45
  95. data/lib/us_core_test_kit/generated/v6.1.0/observation_lab/observation_patient_code_granular_scope_test.rb +0 -45
  96. data/lib/us_core_test_kit/generated/v6.1.0/service_request/service_request_id_granular_scope_test.rb +0 -41
  97. data/lib/us_core_test_kit/generated/v6.1.0/service_request/service_request_patient_category_authored_granular_scope_test.rb +0 -45
  98. data/lib/us_core_test_kit/generated/v6.1.0/service_request/service_request_patient_category_granular_scope_test.rb +0 -45
  99. data/lib/us_core_test_kit/generated/v6.1.0/service_request/service_request_patient_code_authored_granular_scope_test.rb +0 -45
  100. data/lib/us_core_test_kit/generated/v6.1.0/service_request/service_request_patient_code_granular_scope_test.rb +0 -45
  101. data/lib/us_core_test_kit/generated/v6.1.0/service_request/service_request_patient_granular_scope_test.rb +0 -45
  102. data/lib/us_core_test_kit/generated/v6.1.0/service_request/service_request_patient_status_granular_scope_test.rb +0 -45
  103. data/lib/us_core_test_kit/generated/v6.1.0/service_request_granular_scope1_group.rb +0 -39
  104. data/lib/us_core_test_kit/generated/v6.1.0/service_request_granular_scope2_group.rb +0 -40
  105. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/condition_patient_abatement_date_granular_scope_test.rb +0 -45
  106. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/condition_patient_asserted_date_granular_scope_test.rb +0 -45
  107. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/condition_patient_category_clinical_status_granular_scope_test.rb +0 -45
  108. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/condition_patient_category_encounter_granular_scope_test.rb +0 -45
  109. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/condition_patient_category_granular_scope_test.rb +0 -45
  110. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/condition_patient_clinical_status_granular_scope_test.rb +0 -45
  111. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/condition_patient_code_granular_scope_test.rb +0 -45
  112. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/condition_patient_granular_scope_test.rb +0 -45
  113. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/condition_patient_onset_date_granular_scope_test.rb +0 -45
  114. data/lib/us_core_test_kit/generated/v7.0.0-ballot/condition_encounter_diagnosis/condition_patient_recorded_date_granular_scope_test.rb +0 -45
  115. data/lib/us_core_test_kit/generated/v7.0.0-ballot/diagnostic_report_note/diagnostic_report_patient_category_date_granular_scope_test.rb +0 -45
  116. data/lib/us_core_test_kit/generated/v7.0.0-ballot/diagnostic_report_note/diagnostic_report_patient_category_granular_scope_test.rb +0 -45
  117. data/lib/us_core_test_kit/generated/v7.0.0-ballot/diagnostic_report_note/diagnostic_report_patient_code_date_granular_scope_test.rb +0 -45
  118. data/lib/us_core_test_kit/generated/v7.0.0-ballot/diagnostic_report_note/diagnostic_report_patient_code_granular_scope_test.rb +0 -45
  119. data/lib/us_core_test_kit/generated/v7.0.0-ballot/diagnostic_report_note/diagnostic_report_patient_granular_scope_test.rb +0 -45
  120. data/lib/us_core_test_kit/generated/v7.0.0-ballot/diagnostic_report_note/diagnostic_report_patient_status_granular_scope_test.rb +0 -45
  121. data/lib/us_core_test_kit/generated/v7.0.0-ballot/document_reference/document_reference_id_granular_scope_test.rb +0 -41
  122. data/lib/us_core_test_kit/generated/v7.0.0-ballot/document_reference/document_reference_patient_category_date_granular_scope_test.rb +0 -45
  123. data/lib/us_core_test_kit/generated/v7.0.0-ballot/document_reference/document_reference_patient_category_granular_scope_test.rb +0 -45
  124. data/lib/us_core_test_kit/generated/v7.0.0-ballot/document_reference/document_reference_patient_granular_scope_test.rb +0 -45
  125. data/lib/us_core_test_kit/generated/v7.0.0-ballot/document_reference/document_reference_patient_status_granular_scope_test.rb +0 -45
  126. data/lib/us_core_test_kit/generated/v7.0.0-ballot/document_reference/document_reference_patient_type_granular_scope_test.rb +0 -45
  127. data/lib/us_core_test_kit/generated/v7.0.0-ballot/document_reference/document_reference_patient_type_period_granular_scope_test.rb +0 -45
  128. data/lib/us_core_test_kit/generated/v7.0.0-ballot/document_reference_granular_scope2_group.rb +0 -39
  129. data/lib/us_core_test_kit/generated/v7.0.0-ballot/observation_lab/observation_patient_category_date_granular_scope_test.rb +0 -45
  130. data/lib/us_core_test_kit/generated/v7.0.0-ballot/observation_lab/observation_patient_category_granular_scope_test.rb +0 -45
  131. data/lib/us_core_test_kit/generated/v7.0.0-ballot/observation_lab/observation_patient_category_status_granular_scope_test.rb +0 -45
  132. data/lib/us_core_test_kit/generated/v7.0.0-ballot/observation_lab/observation_patient_code_date_granular_scope_test.rb +0 -45
  133. data/lib/us_core_test_kit/generated/v7.0.0-ballot/observation_lab/observation_patient_code_granular_scope_test.rb +0 -45
  134. data/lib/us_core_test_kit/generated/v7.0.0-ballot/service_request/service_request_id_granular_scope_test.rb +0 -41
  135. data/lib/us_core_test_kit/generated/v7.0.0-ballot/service_request/service_request_patient_category_authored_granular_scope_test.rb +0 -45
  136. data/lib/us_core_test_kit/generated/v7.0.0-ballot/service_request/service_request_patient_category_granular_scope_test.rb +0 -45
  137. data/lib/us_core_test_kit/generated/v7.0.0-ballot/service_request/service_request_patient_code_authored_granular_scope_test.rb +0 -45
  138. data/lib/us_core_test_kit/generated/v7.0.0-ballot/service_request/service_request_patient_code_granular_scope_test.rb +0 -45
  139. data/lib/us_core_test_kit/generated/v7.0.0-ballot/service_request/service_request_patient_granular_scope_test.rb +0 -45
  140. data/lib/us_core_test_kit/generated/v7.0.0-ballot/service_request/service_request_patient_status_granular_scope_test.rb +0 -45
  141. data/lib/us_core_test_kit/generated/v7.0.0-ballot/vital_signs/metadata.yml +0 -273
  142. data/lib/us_core_test_kit/generated/v7.0.0-ballot/vital_signs/vital_signs_provenance_revinclude_search_test.rb +0 -53
  143. data/lib/us_core_test_kit/generated/v7.0.0-ballot/vital_signs/vital_signs_read_test.rb +0 -26
  144. data/lib/us_core_test_kit/generated/v7.0.0-ballot/vital_signs_group.rb +0 -96
@@ -3,21 +3,16 @@ require_relative '../../../generator/group_metadata'
3
3
 
4
4
  module USCoreTestKit
5
5
  module USCoreV700_BALLOT
6
- class VitalSignsPatientCodeSearchTest < Inferno::Test
6
+ class PractitionerRolePractitionerSearchTest < Inferno::Test
7
7
  include USCoreTestKit::SearchTest
8
8
 
9
- title 'Server returns valid results for Observation search by patient + code'
9
+ title 'Server returns valid results for PractitionerRole search by practitioner'
10
10
  description %(
11
11
  A server SHALL support searching by
12
- patient + code on the Observation resource. This test
12
+ practitioner on the PractitionerRole resource. This test
13
13
  will pass if resources are returned and match the search criteria. If
14
14
  none are returned, the test is skipped.
15
15
 
16
- This test verifies that the server supports searching by reference using
17
- the form `patient=[id]` as well as `patient=Patient/[id]`. The two
18
- different forms are expected to return the same number of results. US
19
- Core requires that both forms are supported by US Core responders.
20
-
21
16
  Because this is the first search of the sequence, resources in the
22
17
  response will be used for subsequent tests.
23
18
 
@@ -30,20 +25,13 @@ requirement of US Core v7.0.0-ballot.
30
25
 
31
26
  )
32
27
 
33
- id :us_core_v700_ballot_vital_signs_patient_code_search_test
34
- input :patient_ids,
35
- title: 'Patient IDs',
36
- description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
37
-
28
+ id :us_core_v700_ballot_practitioner_role_practitioner_search_test
38
29
  def self.properties
39
30
  @properties ||= SearchTestProperties.new(
40
31
  first_search: true,
41
- fixed_value_search: true,
42
- resource_type: 'Observation',
43
- search_param_names: ['patient', 'code'],
44
- possible_status_search: true,
45
- token_search_params: ['code'],
46
- test_reference_variants: true,
32
+ resource_type: 'PractitionerRole',
33
+ search_param_names: ['practitioner'],
34
+ saves_delayed_references: true,
47
35
  test_post_search: true
48
36
  )
49
37
  end
@@ -53,7 +41,7 @@ requirement of US Core v7.0.0-ballot.
53
41
  end
54
42
 
55
43
  def scratch_resources
56
- scratch[:vital_signs_resources] ||= {}
44
+ scratch[:practitioner_role_resources] ||= {}
57
45
  end
58
46
 
59
47
  run do
@@ -0,0 +1,26 @@
1
+ require_relative '../../../read_test'
2
+
3
+ module USCoreTestKit
4
+ module USCoreV700_BALLOT
5
+ class PractitionerRoleReadTest < Inferno::Test
6
+ include USCoreTestKit::ReadTest
7
+
8
+ title 'Server returns correct PractitionerRole resource from PractitionerRole read interaction'
9
+ description 'A server SHALL support the PractitionerRole read interaction.'
10
+
11
+ id :us_core_v700_ballot_practitioner_role_read_test
12
+
13
+ def resource_type
14
+ 'PractitionerRole'
15
+ end
16
+
17
+ def scratch_resources
18
+ scratch[:practitioner_role_resources] ||= {}
19
+ end
20
+
21
+ run do
22
+ perform_read_test(scratch.dig(:references, 'PractitionerRole'))
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,43 @@
1
+ require_relative '../../../reference_resolution_test'
2
+
3
+ module USCoreTestKit
4
+ module USCoreV700_BALLOT
5
+ class PractitionerRoleReferenceResolutionTest < Inferno::Test
6
+ include USCoreTestKit::ReferenceResolutionTest
7
+
8
+ title 'MustSupport references within PractitionerRole resources are valid'
9
+ description %(
10
+ This test will attempt to read external references provided within elements
11
+ marked as 'MustSupport', if any are available.
12
+
13
+ It verifies that at least one external reference for each MustSupport Reference element
14
+ can be accessed by the test client, and conforms to corresponding US Core profile.
15
+
16
+ Elements which may provide external references include:
17
+
18
+ * PractitionerRole.endpoint
19
+ * PractitionerRole.location
20
+ * PractitionerRole.organization
21
+ * PractitionerRole.practitioner
22
+ )
23
+
24
+ id :us_core_v700_ballot_practitioner_role_reference_resolution_test
25
+
26
+ def resource_type
27
+ 'PractitionerRole'
28
+ end
29
+
30
+ def self.metadata
31
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
32
+ end
33
+
34
+ def scratch_resources
35
+ scratch[:practitioner_role_resources] ||= {}
36
+ end
37
+
38
+ run do
39
+ perform_reference_resolution_test(scratch_resources[:all])
40
+ end
41
+ end
42
+ end
43
+ end
@@ -3,13 +3,13 @@ require_relative '../../../generator/group_metadata'
3
3
 
4
4
  module USCoreTestKit
5
5
  module USCoreV700_BALLOT
6
- class VitalSignsPatientCategoryDateSearchTest < Inferno::Test
6
+ class PractitionerRoleSpecialtySearchTest < Inferno::Test
7
7
  include USCoreTestKit::SearchTest
8
8
 
9
- title 'Server returns valid results for Observation search by patient + category + date'
9
+ title 'Server returns valid results for PractitionerRole search by specialty'
10
10
  description %(
11
11
  A server SHALL support searching by
12
- patient + category + date on the Observation resource. This test
12
+ specialty on the PractitionerRole resource. This test
13
13
  will pass if resources are returned and match the search criteria. If
14
14
  none are returned, the test is skipped.
15
15
 
@@ -17,18 +17,12 @@ none are returned, the test is skipped.
17
17
 
18
18
  )
19
19
 
20
- id :us_core_v700_ballot_vital_signs_patient_category_date_search_test
21
- input :patient_ids,
22
- title: 'Patient IDs',
23
- description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
24
-
20
+ id :us_core_v700_ballot_practitioner_role_specialty_search_test
25
21
  def self.properties
26
22
  @properties ||= SearchTestProperties.new(
27
- resource_type: 'Observation',
28
- search_param_names: ['patient', 'category', 'date'],
29
- possible_status_search: true,
30
- token_search_params: ['category'],
31
- params_with_comparators: ['date']
23
+ resource_type: 'PractitionerRole',
24
+ search_param_names: ['specialty'],
25
+ token_search_params: ['specialty']
32
26
  )
33
27
  end
34
28
 
@@ -37,7 +31,7 @@ none are returned, the test is skipped.
37
31
  end
38
32
 
39
33
  def scratch_resources
40
- scratch[:vital_signs_resources] ||= {}
34
+ scratch[:practitioner_role_resources] ||= {}
41
35
  end
42
36
 
43
37
  run do
@@ -0,0 +1,40 @@
1
+ require_relative '../../../validation_test'
2
+
3
+ module USCoreTestKit
4
+ module USCoreV700_BALLOT
5
+ class PractitionerRoleValidationTest < Inferno::Test
6
+ include USCoreTestKit::ValidationTest
7
+
8
+ id :us_core_v700_ballot_practitioner_role_validation_test
9
+ title 'PractitionerRole resources returned during previous tests conform to the US Core PractitionerRole Profile'
10
+ description %(
11
+ This test verifies resources returned from the first search conform to
12
+ the [US Core PractitionerRole Profile](http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole).
13
+ Systems must demonstrate at least one valid example in order to pass this test.
14
+
15
+ It verifies the presence of mandatory elements and that elements with
16
+ required bindings contain appropriate values. CodeableConcept element
17
+ bindings will fail if none of their codings have a code/system belonging
18
+ to the bound ValueSet. Quantity, Coding, and code element bindings will
19
+ fail if their code/system are not found in the valueset.
20
+
21
+ )
22
+ output :dar_code_found, :dar_extension_found
23
+
24
+ def resource_type
25
+ 'PractitionerRole'
26
+ end
27
+
28
+ def scratch_resources
29
+ scratch[:practitioner_role_resources] ||= {}
30
+ end
31
+
32
+ run do
33
+ perform_validation_test(scratch_resources[:all] || [],
34
+ 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole',
35
+ '7.0.0-ballot',
36
+ skip_if_empty: true)
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,89 @@
1
+ require_relative 'practitioner_role/practitioner_role_read_test'
2
+ require_relative 'practitioner_role/practitioner_role_practitioner_search_test'
3
+ require_relative 'practitioner_role/practitioner_role_specialty_search_test'
4
+ require_relative 'practitioner_role/practitioner_role_validation_test'
5
+ require_relative 'practitioner_role/practitioner_role_must_support_test'
6
+ require_relative 'practitioner_role/practitioner_role_reference_resolution_test'
7
+
8
+ module USCoreTestKit
9
+ module USCoreV700_BALLOT
10
+ class PractitionerRoleGroup < Inferno::TestGroup
11
+ title 'PractitionerRole Tests'
12
+ short_description 'Verify support for the server capabilities required by the US Core PractitionerRole Profile.'
13
+ description %(
14
+ # Background
15
+
16
+ The US Core PractitionerRole sequence verifies that the system under test is
17
+ able to provide correct responses for PractitionerRole queries. These queries
18
+ must contain resources conforming to the US Core PractitionerRole Profile as
19
+ specified in the US Core v7.0.0-ballot Implementation Guide.
20
+
21
+ # Testing Methodology
22
+ ## Searching
23
+ This test sequence will first perform each required search associated
24
+ with this resource. This sequence will perform searches with the
25
+ following parameters:
26
+
27
+ * practitioner
28
+ * specialty
29
+
30
+ ### Search Parameters
31
+ The first search uses the selected patient(s) from the prior launch
32
+ sequence. Any subsequent searches will look for its parameter values
33
+ from the results of the first search. For example, the `identifier`
34
+ search in the patient sequence is performed by looking for an existing
35
+ `Patient.identifier` from any of the resources returned in the `_id`
36
+ search. If a value cannot be found this way, the search is skipped.
37
+
38
+ ### Search Validation
39
+ Inferno will retrieve up to the first 20 bundle pages of the reply for
40
+ PractitionerRole resources and save them for subsequent tests. Each of
41
+ these resources is then checked to see if it matches the searched
42
+ parameters in accordance with [FHIR search
43
+ guidelines](https://www.hl7.org/fhir/search.html). The test will fail,
44
+ for example, if a Patient search for `gender=male` returns a `female`
45
+ patient.
46
+
47
+
48
+ ## Must Support
49
+ Each profile contains elements marked as "must support". This test
50
+ sequence expects to see each of these elements at least once. If at
51
+ least one cannot be found, the test will fail. The test will look
52
+ through the PractitionerRole resources found in the first test for these
53
+ elements.
54
+
55
+ ## Profile Validation
56
+ Each resource returned from the first search is expected to conform to
57
+ the [US Core PractitionerRole Profile](http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole). Each element is checked against
58
+ teminology binding and cardinality requirements.
59
+
60
+ Elements with a required binding are validated against their bound
61
+ ValueSet. If the code/system in the element is not part of the ValueSet,
62
+ then the test will fail.
63
+
64
+ ## Reference Validation
65
+ At least one instance of each external reference in elements marked as
66
+ "must support" within the resources provided by the system must resolve.
67
+ The test will attempt to read each reference found and will fail if no
68
+ read succeeds.
69
+
70
+ )
71
+
72
+ id :us_core_v700_ballot_practitioner_role
73
+ run_as_group
74
+ optional
75
+
76
+
77
+ def self.metadata
78
+ @metadata ||= Generator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'practitioner_role', 'metadata.yml'), aliases: true))
79
+ end
80
+
81
+ test from: :us_core_v700_ballot_practitioner_role_read_test
82
+ test from: :us_core_v700_ballot_practitioner_role_practitioner_search_test
83
+ test from: :us_core_v700_ballot_practitioner_role_specialty_search_test
84
+ test from: :us_core_v700_ballot_practitioner_role_validation_test
85
+ test from: :us_core_v700_ballot_practitioner_role_must_support_test
86
+ test from: :us_core_v700_ballot_practitioner_role_reference_resolution_test
87
+ end
88
+ end
89
+ end
@@ -48,12 +48,13 @@ require_relative 'observation_clinical_result_group'
48
48
  require_relative 'pediatric_bmi_for_age_group'
49
49
  require_relative 'head_circumference_percentile_group'
50
50
  require_relative 'body_weight_group'
51
- require_relative 'vital_signs_group'
52
51
  require_relative 'procedure_group'
53
52
  require_relative 'questionnaire_response_group'
54
53
  require_relative 'service_request_group'
54
+ require_relative 'location_group'
55
55
  require_relative 'organization_group'
56
56
  require_relative 'practitioner_group'
57
+ require_relative 'practitioner_role_group'
57
58
  require_relative 'provenance_group'
58
59
  require_relative 'related_person_group'
59
60
  require_relative 'specimen_group'
@@ -193,12 +194,13 @@ module USCoreTestKit
193
194
  group from: :us_core_v700_ballot_pediatric_bmi_for_age
194
195
  group from: :us_core_v700_ballot_head_circumference_percentile
195
196
  group from: :us_core_v700_ballot_body_weight
196
- group from: :us_core_v700_ballot_vital_signs
197
197
  group from: :us_core_v700_ballot_procedure
198
198
  group from: :us_core_v700_ballot_questionnaire_response
199
199
  group from: :us_core_v700_ballot_service_request
200
+ group from: :us_core_v700_ballot_location
200
201
  group from: :us_core_v700_ballot_organization
201
202
  group from: :us_core_v700_ballot_practitioner
203
+ group from: :us_core_v700_ballot_practitioner_role
202
204
  group from: :us_core_v700_ballot_provenance
203
205
  group from: :us_core_v700_ballot_related_person
204
206
  group from: :us_core_v700_ballot_specimen
@@ -95,8 +95,8 @@ module USCoreTestKit
95
95
 
96
96
 
97
97
  def optional?
98
- resource_type == 'QuestionnaireResponse' ||
99
- profile_url == 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-simple-observation'
98
+ SpecialCases::OPTIONAL_RESOURCES.include?(resource_type) ||
99
+ SpecialCases::OPTIONAL_PROFILES.include?(profile_url)
100
100
  end
101
101
 
102
102
  def generate
@@ -1,3 +1,5 @@
1
+ require_relative 'special_cases'
2
+
1
3
  module USCoreTestKit
2
4
  class Generator
3
5
  class GroupMetadata
@@ -50,7 +52,7 @@ module USCoreTestKit
50
52
  end
51
53
 
52
54
  def exclude_search_tests?
53
- delayed? && !searchable_delayed_resource
55
+ delayed? && !searchable_delayed_resource?
54
56
  end
55
57
 
56
58
  def no_patient_searches?
@@ -9,6 +9,7 @@ module USCoreTestKit
9
9
  def initialize(ig_resources)
10
10
  self.ig_resources = ig_resources
11
11
  add_missing_supported_profiles
12
+ remove_version_from_supported_profiles
12
13
  remove_extra_supported_profiles
13
14
  self.metadata = IGMetadata.new
14
15
  end
@@ -52,6 +53,12 @@ module USCoreTestKit
52
53
  end
53
54
  end
54
55
 
56
+ def remove_version_from_supported_profiles
57
+ resources_in_capability_statement.each do |resource|
58
+ resource.supportedProfile.map! { |profile_url| profile_url.split('|').first }
59
+ end
60
+ end
61
+
55
62
  def remove_extra_supported_profiles
56
63
  ig_resources.capability_statement.rest.first.resource
57
64
  .find { |resource| resource.type == 'Observation' }
@@ -64,7 +71,7 @@ module USCoreTestKit
64
71
  metadata.groups =
65
72
  resources_in_capability_statement.flat_map do |resource|
66
73
  resource.supportedProfile&.map do |supported_profile|
67
- supported_profile = supported_profile.split('|').first
74
+ #supported_profile = supported_profile.split('|').first
68
75
  next if supported_profile == 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire'
69
76
 
70
77
  GroupMetadataExtractor.new(resource, supported_profile, metadata, ig_resources).group_metadata
@@ -10,7 +10,7 @@ module USCoreTestKit
10
10
 
11
11
  def handle_special_cases
12
12
  add_must_support_choices
13
- remove_patient_address_period
13
+ update_patient_previous_name_address
14
14
  remove_document_reference_custodian
15
15
  end
16
16
 
@@ -22,31 +22,77 @@ module USCoreTestKit
22
22
  choices << { paths: ['udiCarrier.carrierAIDC', 'udiCarrier.carrierHRF'] }
23
23
  when 'DocumentReference'
24
24
  choices << { paths: ['content.attachment.data', 'content.attachment.url'] }
25
- when 'Patient'
26
- # FHIR-40299 adds USCDI MustSupport choices for:
27
- # * address.period.end and address.use,
28
- # * name.period.end and name.use
29
- choices << {
30
- paths: ['address.period.end', 'address.use'],
31
- uscdi_only: true
32
- }
33
-
34
- choices << {
35
- paths: ['name.period.end', 'name.use'],
36
- uscdi_only: true
37
- }
38
25
  end
39
26
 
40
27
  must_supports[:choices] = choices if choices.present?
41
28
  end
42
29
 
43
- # FHIR-40299 removes Patient.address.period from MustSupport,
44
- def remove_patient_address_period
30
+ # FHIR-40299 adds USCDI MustSupport choices for:
31
+ # * address.period.end and address.use,
32
+ # * name.period.end and name.use
33
+ def update_patient_previous_name_address
45
34
  return unless profile.type == 'Patient'
46
35
 
47
- must_supports[:elements].delete_if do |element|
48
- element[:path] == 'address.period'
36
+ name_period_exists = false
37
+ name_use_exists = false
38
+ address_period_exists = false
39
+ address_use_exists = false
40
+
41
+ must_supports[:elements].each do |element|
42
+ case element[:path]
43
+ when 'name.period'
44
+ element[:path] = 'name.period.end'
45
+ element[:uscdi_only] = true
46
+ name_period_exists = true
47
+ when 'name.use'
48
+ element[:fixed_value] = 'old'
49
+ element[:uscdi_only] = true
50
+ name_use_exists = true
51
+ when 'address.period'
52
+ element[:path] = 'address.period.end'
53
+ element[:uscdi_only] = true
54
+ address_period_exists = true
55
+ when 'address.use'
56
+ element[:fixed_value] = 'old'
57
+ element[:uscdi_only] = true
58
+ address_use_exists = true
59
+ end
49
60
  end
61
+
62
+ must_supports[:elements] << {
63
+ path: 'name.period.end',
64
+ uscdi_only: true
65
+ } unless name_period_exists
66
+
67
+ must_supports[:elements] << {
68
+ path: 'name.use',
69
+ fixed_value: 'old',
70
+ uscdi_only: true
71
+ } unless name_use_exists
72
+
73
+ must_supports[:elements] << {
74
+ path: 'address.period.end',
75
+ uscdi_only: true
76
+ } unless address_period_exists
77
+
78
+ must_supports[:elements] << {
79
+ path: 'address.use',
80
+ fixed_value: 'old',
81
+ uscdi_only: true
82
+ } unless address_use_exists
83
+
84
+ must_supports[:choices] ||= []
85
+
86
+ must_supports[:choices] << {
87
+ paths: ['address.period.end', 'address.use'],
88
+ uscdi_only: true
89
+ }
90
+
91
+ must_supports[:choices] << {
92
+ paths: ['name.period.end', 'name.use'],
93
+ uscdi_only: true
94
+ }
95
+
50
96
  end
51
97
 
52
98
  # US Core clarified that server implmentation is not required to support DocumentReference.custodian (FHIR-28393)
@@ -16,7 +16,6 @@ module USCoreTestKit
16
16
 
17
17
  def handle_special_cases
18
18
  add_must_support_choices
19
- remove_patient_address_period
20
19
  add_device_distinct_identifier
21
20
  add_patient_uscdi_elements
22
21
  end
@@ -32,28 +31,11 @@ module USCoreTestKit
32
31
  choices << { paths: ['location.location', 'serviceProvider'] }
33
32
  when 'MedicationRequest'
34
33
  choices << { paths: ['reportedBoolean', 'reportedReference'] }
35
- when 'Patient'
36
- # FHIR-40299 adds USCDI MustSupport choices for:
37
- # * address.period.end and address.use,
38
- # * name.period.end and name.use
39
- choices << {
40
- paths: ['address.period.end', 'address.use'],
41
- uscdi_only: true
42
- }
43
-
44
- choices << {
45
- paths: ['name.period.end', 'name.use'],
46
- uscdi_only: true
47
- }
48
34
  end
49
35
 
50
36
  must_supports[:choices] = choices if choices.present?
51
37
  end
52
38
 
53
- def remove_patient_address_period
54
- us_core_3_extractor.remove_patient_address_period
55
- end
56
-
57
39
  def add_device_distinct_identifier
58
40
  if profile.type == 'Device'
59
41
  # FHIR-36303 US Core 4.0.0 mistakenly removed MS from Device.distinctIdentifier
@@ -97,6 +79,7 @@ module USCoreTestKit
97
79
  }
98
80
 
99
81
  add_patient_telecom_communication_uscdi
82
+ us_core_3_extractor.update_patient_previous_name_address
100
83
  end
101
84
 
102
85
  def add_patient_telecom_communication_uscdi
@@ -17,7 +17,6 @@ module USCoreTestKit
17
17
 
18
18
  def handle_special_cases
19
19
  add_must_support_choices
20
- remove_patient_address_period
21
20
  add_patient_uscdi_elements
22
21
  remove_survey_questionnaire_response
23
22
  end
@@ -48,10 +47,6 @@ module USCoreTestKit
48
47
  end
49
48
  end
50
49
 
51
- def remove_patient_address_period
52
- us_core_4_extractor.remove_patient_address_period
53
- end
54
-
55
50
  def add_patient_uscdi_elements
56
51
  return unless profile.type == 'Patient'
57
52
 
@@ -62,16 +57,6 @@ module USCoreTestKit
62
57
  url: 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-genderIdentity',
63
58
  uscdi_only: true
64
59
  }
65
- must_supports[:elements] << {
66
- path: 'address.use',
67
- fixed_value: 'old',
68
- uscdi_only: true
69
- }
70
- must_supports[:elements] << {
71
- path: 'name.use',
72
- fixed_value: 'old',
73
- uscdi_only: true
74
- }
75
60
  end
76
61
 
77
62
  def add_value_set_expansion
@@ -12,6 +12,10 @@ module USCoreTestKit
12
12
  self.must_supports = must_supports
13
13
  end
14
14
 
15
+ def us_core_3_extractor
16
+ @us_core_3_extractor ||= MustSupportMetadataExtractorUsCore3.new(profile, must_supports)
17
+ end
18
+
15
19
  def us_core_4_extractor
16
20
  @us_core_4_extractor ||= MustSupportMetadataExtractorUsCore4.new(profile, must_supports)
17
21
  end
@@ -66,11 +70,10 @@ module USCoreTestKit
66
70
  return unless profile.type == 'Patient'
67
71
 
68
72
  us_core_4_extractor.add_patient_telecom_communication_uscdi
73
+ us_core_3_extractor.update_patient_previous_name_address
69
74
 
70
75
  must_supports[:elements].each do |element|
71
76
  case element[:path]
72
- when 'address.use', 'name.use'
73
- element[:fixed_value] = 'old'
74
77
  when 'deceased[x]'
75
78
  element[:original_path] = element[:path]
76
79
  element[:path] = 'deceasedDateTime'
@@ -1,20 +1,29 @@
1
1
  module USCoreTestKit
2
2
  class Generator
3
3
  module SpecialCases
4
- RESOURCES_TO_EXCLUDE = [
5
- 'Location',
6
- 'Medication',
7
- 'PractitionerRole'
8
- ].freeze
4
+ RESOURCES_TO_EXCLUDE = {
5
+ 'Location' => ['v311', 'v400', 'v501', 'v610'],
6
+ 'Medication' => ['v311', 'v400', 'v501', 'v610', 'v700_ballot'],
7
+ 'PractitionerRole' => ['v311', 'v400']
8
+ }.freeze
9
9
 
10
10
  PROFILES_TO_EXCLUDE = [
11
11
  'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-survey',
12
12
  'http://hl7.org/fhir/us/core/StructureDefinition/us-core-vital-signs'
13
13
  ].freeze
14
14
 
15
+ OPTIONAL_RESOURCES = [
16
+ 'PractitionerRole',
17
+ 'QuestionnaireResponse'
18
+ ].freeze
19
+
20
+ OPTIONAL_PROFILES = [
21
+ 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-simple-observation'
22
+ ].freeze
23
+
15
24
  NON_USCDI_RESOURCES = {
16
25
  'Encounter' => ['v311', 'v400'],
17
- 'Location' => ['v311', 'v400', 'v501', 'v610', 'v700_ballot'],
26
+ 'Location' => ['v311', 'v400', 'v501', 'v610'],
18
27
  'Organization' => ['v311', 'v400', 'v501', 'v610', 'v700_ballot'],
19
28
  'Practitioner' => ['v311', 'v400'],
20
29
  'PractitionerRole' => ['v311', 'v400', 'v501', 'v610', 'v700_ballot'],
@@ -24,6 +33,7 @@ module USCoreTestKit
24
33
  }.freeze
25
34
 
26
35
  SEARCHABLE_DELAYED_RESOURCES = {
36
+ 'Location' => ['v700_ballot'],
27
37
  'Practitioner' => ['v501', 'v610', 'v700_ballot']
28
38
  }.freeze
29
39
 
@@ -49,7 +59,7 @@ module USCoreTestKit
49
59
 
50
60
  class << self
51
61
  def exclude_group?(group)
52
- RESOURCES_TO_EXCLUDE.include?(group.resource)
62
+ RESOURCES_TO_EXCLUDE.key?(group.resource) && RESOURCES_TO_EXCLUDE[group.resource].include?(group.reformatted_version)
53
63
  end
54
64
  end
55
65
  end
@@ -14,8 +14,8 @@ module USCoreTestKit
14
14
  "No #{resource_type} searches with search params #{search_param_names.join(' & ')} found"
15
15
 
16
16
  previous_request_resources.each do |previous_request, all_previous_resources|
17
- params = previous_request.query_parameters
18
17
  search_method = previous_request.verb.to_sym
18
+ params = search_method == :get ? previous_request.query_parameters : Hash[URI.decode_www_form(previous_request.request_body)]
19
19
  fhir_search(resource_type, params:, search_method:)
20
20
 
21
21
  found_resources =