us_core_test_kit 0.4.5 → 0.4.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/us_core_test_kit/fhir_resource_navigation.rb +9 -3
  3. data/lib/us_core_test_kit/generated/v3.1.1/metadata.yml +9 -1
  4. data/lib/us_core_test_kit/generated/v3.1.1/patient/metadata.yml +9 -1
  5. data/lib/us_core_test_kit/generated/v3.1.1/patient/patient_must_support_test.rb +5 -1
  6. data/lib/us_core_test_kit/generated/v4.0.0/device/metadata.yml +0 -2
  7. data/lib/us_core_test_kit/generated/v4.0.0/device_group.rb +0 -2
  8. data/lib/us_core_test_kit/generated/v4.0.0/medication_request/medication_request_reference_resolution_test.rb +1 -0
  9. data/lib/us_core_test_kit/generated/v4.0.0/medication_request/metadata.yml +1 -1
  10. data/lib/us_core_test_kit/generated/v4.0.0/metadata.yml +10 -4
  11. data/lib/us_core_test_kit/generated/v4.0.0/patient/metadata.yml +9 -3
  12. data/lib/us_core_test_kit/generated/v4.0.0/patient/patient_must_support_test.rb +2 -2
  13. data/lib/us_core_test_kit/generated/v5.0.1/condition_encounter_diagnosis/metadata.yml +4 -4
  14. data/lib/us_core_test_kit/generated/v5.0.1/condition_problems_health_concerns/metadata.yml +4 -4
  15. data/lib/us_core_test_kit/generated/v5.0.1/device/metadata.yml +0 -2
  16. data/lib/us_core_test_kit/generated/v5.0.1/device_group.rb +0 -2
  17. data/lib/us_core_test_kit/generated/v5.0.1/medication_request/medication_request_reference_resolution_test.rb +1 -0
  18. data/lib/us_core_test_kit/generated/v5.0.1/medication_request/metadata.yml +1 -1
  19. data/lib/us_core_test_kit/generated/v5.0.1/metadata.yml +23 -12
  20. data/lib/us_core_test_kit/generated/v5.0.1/patient/metadata.yml +9 -3
  21. data/lib/us_core_test_kit/generated/v5.0.1/patient/patient_must_support_test.rb +2 -4
  22. data/lib/us_core_test_kit/generated/v5.0.1/service_request/metadata.yml +5 -0
  23. data/lib/us_core_test_kit/generator/group_generator.rb +0 -5
  24. data/lib/us_core_test_kit/generator/must_support_metadata_extractor.rb +7 -167
  25. data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_3.rb +62 -0
  26. data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_4.rb +110 -0
  27. data/lib/us_core_test_kit/generator/must_support_metadata_extractor_us_core_5.rb +113 -0
  28. data/lib/us_core_test_kit/generator/search_definition_metadata_extractor.rb +52 -4
  29. data/lib/us_core_test_kit/generator.rb +1 -1
  30. data/lib/us_core_test_kit/igs/us_core_501/StructureDefinition-condition-assertedDate.json +280 -0
  31. data/lib/us_core_test_kit/search_test.rb +1 -1
  32. data/lib/us_core_test_kit/version.rb +1 -1
  33. data/lib/us_core_test_kit.rb +0 -1
  34. metadata +6 -4
  35. data/lib/us_core_test_kit/custom_groups/v4.0.0/device_udi_pi_test.rb +0 -40
  36. data/lib/us_core_test_kit/ext/fhir_models.rb +0 -59
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 100200153e9adc8ef4a768a34ab02fe1b2460a72bde04350f3681ad699aacb99
4
- data.tar.gz: 41013e5c4b2161553a28bd73f9928fb00097455e3b547adbfe02fd0115a3f03e
3
+ metadata.gz: 9580bce91af645498d5ca61297a7900bfd2ed2abd400ae55308c2f209a4e14ff
4
+ data.tar.gz: 2945d9afa14d016011f3c84a2d4d035ec1bfa05117a1b5d20aa6d549fb368a05
5
5
  SHA512:
6
- metadata.gz: 37702b890daf5dc75452d610cd9cc70b2cca359b8d8580f842ed770ea24f3447dc6af0db058bc156a07344ad48f6ecbfba83e34427c5258c5270a418fda1145f
7
- data.tar.gz: 6b658f5e99a0d62939d18f7316e57dc3bc901a6130eb668b24750a6e76ee33a456a732c87db8bb7e71efcbf848e2e1536aff28226b6b33bab4e811aa09e3bc7a
6
+ metadata.gz: 134c8e48cc4731b4be03739b99ab90011c30de23d379699db6b91cc993f8f0d5fee1b52f9f0c1759c383d1a87bfa2fbef008c60eec9b3ef21261e0908efd9f66
7
+ data.tar.gz: c9deea8845664b41cb335ffa428edeeabe26ad94cd11cd69ae0832a892fcfb13f3b910a54a29cb8e775c8d9e14b8fcaddd6a949bb1ae465eee3c881d1a68be20
@@ -6,7 +6,7 @@ module USCoreTestKit
6
6
  elements = Array.wrap(elements)
7
7
  return elements if path.blank?
8
8
 
9
- paths = path.split('.')
9
+ paths = path.split(/(?<!hl7)\./)
10
10
  segment = paths.first
11
11
  remaining_path = paths.drop(1).join('.')
12
12
 
@@ -33,7 +33,7 @@ module USCoreTestKit
33
33
  return elements.first
34
34
  end
35
35
 
36
- path_segments = path.split('.')
36
+ path_segments = path.split(/(?<!hl7)\./)
37
37
  segment = path_segments.shift.delete_suffix('[x]').to_sym
38
38
 
39
39
  no_elements_present =
@@ -63,7 +63,13 @@ module USCoreTestKit
63
63
  end
64
64
 
65
65
  def get_next_value(element, property)
66
- element.send(property)
66
+ extension_url = property[/(?<=where\(url=').*(?='\))/]
67
+
68
+ if extension_url.present?
69
+ element.url == extension_url ? element : nil
70
+ else
71
+ element.send(property)
72
+ end
67
73
  rescue NoMethodError
68
74
  nil
69
75
  end
@@ -6040,9 +6040,17 @@
6040
6040
  - :path: address.city
6041
6041
  - :path: address.state
6042
6042
  - :path: address.postalCode
6043
- - :path: address.period
6044
6043
  - :path: communication
6045
6044
  - :path: communication.language
6045
+ :choices:
6046
+ - :paths:
6047
+ - address.period.end
6048
+ - address.use
6049
+ :uscdi_only: true
6050
+ - :paths:
6051
+ - name.period.end
6052
+ - name.use
6053
+ :uscdi_only: true
6046
6054
  :mandatory_elements:
6047
6055
  - Patient.identifier
6048
6056
  - Patient.identifier.system
@@ -171,9 +171,17 @@
171
171
  - :path: address.city
172
172
  - :path: address.state
173
173
  - :path: address.postalCode
174
- - :path: address.period
175
174
  - :path: communication
176
175
  - :path: communication.language
176
+ :choices:
177
+ - :paths:
178
+ - address.period.end
179
+ - address.use
180
+ :uscdi_only: true
181
+ - :paths:
182
+ - name.period.end
183
+ - name.use
184
+ :uscdi_only: true
177
185
  :mandatory_elements:
178
186
  - Patient.identifier
179
187
  - Patient.identifier.system
@@ -15,7 +15,6 @@ module USCoreTestKit
15
15
  * Patient.address
16
16
  * Patient.address.city
17
17
  * Patient.address.line
18
- * Patient.address.period
19
18
  * Patient.address.postalCode
20
19
  * Patient.address.state
21
20
  * Patient.birthDate
@@ -35,6 +34,11 @@ module USCoreTestKit
35
34
  * Patient.telecom.system
36
35
  * Patient.telecom.use
37
36
  * Patient.telecom.value
37
+
38
+ For ONC USCDI requirements, each Patient must support the following additional elements:
39
+
40
+ * Patient.address.period.end or Patient.address.use
41
+ * Patient.name.period.end or Patient.name.use
38
42
  )
39
43
 
40
44
  id :us_core_v311_patient_must_support_test
@@ -136,8 +136,6 @@
136
136
  :file_name: device_must_support_test.rb
137
137
  - :id: us_core_v400_device_reference_resolution_test
138
138
  :file_name: device_reference_resolution_test.rb
139
- - :id: us_core_v400_device_udi_pi_test
140
- :file_name: "../../custom_groups/v4.0.0/device_udi_pi_test.rb"
141
139
  :id: us_core_v400_device
142
140
  :file_name: device_group.rb
143
141
  :delayed_references: []
@@ -5,7 +5,6 @@ require_relative 'device/device_provenance_revinclude_search_test'
5
5
  require_relative 'device/device_validation_test'
6
6
  require_relative 'device/device_must_support_test'
7
7
  require_relative 'device/device_reference_resolution_test'
8
- require_relative '../../custom_groups/v4.0.0/device_udi_pi_test'
9
8
 
10
9
  module USCoreTestKit
11
10
  module USCoreV400
@@ -84,7 +83,6 @@ read succeeds.
84
83
  test from: :us_core_v400_device_validation_test
85
84
  test from: :us_core_v400_device_must_support_test
86
85
  test from: :us_core_v400_device_reference_resolution_test
87
- test from: :us_core_v400_device_udi_pi_test
88
86
  end
89
87
  end
90
88
  end
@@ -19,6 +19,7 @@ module USCoreTestKit
19
19
 
20
20
  * MedicationRequest.encounter
21
21
  * MedicationRequest.medication[x]
22
+ * MedicationRequest.reportedReference
22
23
  * MedicationRequest.requester
23
24
  * MedicationRequest.subject
24
25
  )
@@ -150,7 +150,7 @@
150
150
  :original_path: reported[x]
151
151
  - :path: reportedReference
152
152
  :original_path: reported[x]
153
- :type:
153
+ :types:
154
154
  - Reference
155
155
  :target_profiles:
156
156
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
@@ -2529,7 +2529,7 @@
2529
2529
  :original_path: reported[x]
2530
2530
  - :path: reportedReference
2531
2531
  :original_path: reported[x]
2532
- :type:
2532
+ :types:
2533
2533
  - Reference
2534
2534
  :target_profiles:
2535
2535
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
@@ -6543,17 +6543,23 @@
6543
6543
  - :path: address.city
6544
6544
  - :path: address.state
6545
6545
  - :path: address.postalCode
6546
- - :path: address.period
6547
6546
  - :path: communication.language
6548
6547
  :uscdi_only: true
6549
6548
  - :path: name.suffix
6550
6549
  :uscdi_only: true
6551
- - :path: name.period.end
6552
- :uscdi_only: true
6553
6550
  - :path: telecom
6554
6551
  :uscdi_only: true
6555
6552
  - :path: communication
6556
6553
  :uscdi_only: true
6554
+ :choices:
6555
+ - :paths:
6556
+ - address.period.end
6557
+ - address.use
6558
+ :uscdi_only: true
6559
+ - :paths:
6560
+ - name.period.end
6561
+ - name.use
6562
+ :uscdi_only: true
6557
6563
  :mandatory_elements:
6558
6564
  - Patient.identifier
6559
6565
  - Patient.identifier.system
@@ -176,17 +176,23 @@
176
176
  - :path: address.city
177
177
  - :path: address.state
178
178
  - :path: address.postalCode
179
- - :path: address.period
180
179
  - :path: communication.language
181
180
  :uscdi_only: true
182
181
  - :path: name.suffix
183
182
  :uscdi_only: true
184
- - :path: name.period.end
185
- :uscdi_only: true
186
183
  - :path: telecom
187
184
  :uscdi_only: true
188
185
  - :path: communication
189
186
  :uscdi_only: true
187
+ :choices:
188
+ - :paths:
189
+ - address.period.end
190
+ - address.use
191
+ :uscdi_only: true
192
+ - :paths:
193
+ - name.period.end
194
+ - name.use
195
+ :uscdi_only: true
190
196
  :mandatory_elements:
191
197
  - Patient.identifier
192
198
  - Patient.identifier.system
@@ -15,7 +15,6 @@ module USCoreTestKit
15
15
  * Patient.address
16
16
  * Patient.address.city
17
17
  * Patient.address.line
18
- * Patient.address.period
19
18
  * Patient.address.postalCode
20
19
  * Patient.address.state
21
20
  * Patient.birthDate
@@ -29,12 +28,13 @@ module USCoreTestKit
29
28
 
30
29
  For ONC USCDI requirements, each Patient must support the following additional elements:
31
30
 
31
+ * Patient.address.period.end or Patient.address.use
32
32
  * Patient.communication
33
33
  * Patient.communication.language
34
34
  * Patient.extension:birthsex
35
35
  * Patient.extension:ethnicity
36
36
  * Patient.extension:race
37
- * Patient.name.period.end
37
+ * Patient.name.period.end or Patient.name.use
38
38
  * Patient.name.suffix
39
39
  * Patient.telecom
40
40
  * Patient.telecom.system
@@ -120,9 +120,9 @@
120
120
  :multiple_or: MAY
121
121
  :asserted-date:
122
122
  :paths:
123
- - extension
123
+ - extension.where(url='http://hl7.org/fhir/StructureDefinition/condition-assertedDate').valueDateTime
124
124
  :full_paths:
125
- - Condition.extension
125
+ - Condition.extension.where(url='http://hl7.org/fhir/StructureDefinition/condition-assertedDate').valueDateTime
126
126
  :comparators:
127
127
  :eq: MAY
128
128
  :ne: MAY
@@ -134,8 +134,8 @@
134
134
  :eb: MAY
135
135
  :ap: MAY
136
136
  :values: []
137
- :type: Extension
138
- :contains_multiple: true
137
+ :type: dateTime
138
+ :contains_multiple: false
139
139
  :multiple_or: MAY
140
140
  :code:
141
141
  :paths:
@@ -121,9 +121,9 @@
121
121
  :multiple_or: MAY
122
122
  :asserted-date:
123
123
  :paths:
124
- - extension
124
+ - extension.where(url='http://hl7.org/fhir/StructureDefinition/condition-assertedDate').valueDateTime
125
125
  :full_paths:
126
- - Condition.extension
126
+ - Condition.extension.where(url='http://hl7.org/fhir/StructureDefinition/condition-assertedDate').valueDateTime
127
127
  :comparators:
128
128
  :eq: MAY
129
129
  :ne: MAY
@@ -135,8 +135,8 @@
135
135
  :eb: MAY
136
136
  :ap: MAY
137
137
  :values: []
138
- :type: Extension
139
- :contains_multiple: true
138
+ :type: dateTime
139
+ :contains_multiple: false
140
140
  :multiple_or: MAY
141
141
  :code:
142
142
  :paths:
@@ -136,8 +136,6 @@
136
136
  :file_name: device_must_support_test.rb
137
137
  - :id: us_core_v501_device_reference_resolution_test
138
138
  :file_name: device_reference_resolution_test.rb
139
- - :id: us_core_v400_device_udi_pi_test
140
- :file_name: "../../custom_groups/v4.0.0/device_udi_pi_test.rb"
141
139
  :id: us_core_v501_device
142
140
  :file_name: device_group.rb
143
141
  :delayed_references: []
@@ -5,7 +5,6 @@ require_relative 'device/device_provenance_revinclude_search_test'
5
5
  require_relative 'device/device_validation_test'
6
6
  require_relative 'device/device_must_support_test'
7
7
  require_relative 'device/device_reference_resolution_test'
8
- require_relative '../../custom_groups/v4.0.0/device_udi_pi_test'
9
8
 
10
9
  module USCoreTestKit
11
10
  module USCoreV501
@@ -84,7 +83,6 @@ read succeeds.
84
83
  test from: :us_core_v501_device_validation_test
85
84
  test from: :us_core_v501_device_must_support_test
86
85
  test from: :us_core_v501_device_reference_resolution_test
87
- test from: :us_core_v400_device_udi_pi_test
88
86
  end
89
87
  end
90
88
  end
@@ -19,6 +19,7 @@ module USCoreTestKit
19
19
 
20
20
  * MedicationRequest.encounter
21
21
  * MedicationRequest.medication[x]
22
+ * MedicationRequest.reportedReference
22
23
  * MedicationRequest.requester
23
24
  * MedicationRequest.subject
24
25
  )
@@ -161,7 +161,7 @@
161
161
  :original_path: reported[x]
162
162
  - :path: reportedReference
163
163
  :original_path: reported[x]
164
- :type:
164
+ :types:
165
165
  - Reference
166
166
  :target_profiles:
167
167
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
@@ -669,9 +669,9 @@
669
669
  :multiple_or: MAY
670
670
  :asserted-date:
671
671
  :paths:
672
- - extension
672
+ - extension.where(url='http://hl7.org/fhir/StructureDefinition/condition-assertedDate').valueDateTime
673
673
  :full_paths:
674
- - Condition.extension
674
+ - Condition.extension.where(url='http://hl7.org/fhir/StructureDefinition/condition-assertedDate').valueDateTime
675
675
  :comparators:
676
676
  :eq: MAY
677
677
  :ne: MAY
@@ -683,8 +683,8 @@
683
683
  :eb: MAY
684
684
  :ap: MAY
685
685
  :values: []
686
- :type: Extension
687
- :contains_multiple: true
686
+ :type: dateTime
687
+ :contains_multiple: false
688
688
  :multiple_or: MAY
689
689
  :code:
690
690
  :paths:
@@ -976,9 +976,9 @@
976
976
  :multiple_or: MAY
977
977
  :asserted-date:
978
978
  :paths:
979
- - extension
979
+ - extension.where(url='http://hl7.org/fhir/StructureDefinition/condition-assertedDate').valueDateTime
980
980
  :full_paths:
981
- - Condition.extension
981
+ - Condition.extension.where(url='http://hl7.org/fhir/StructureDefinition/condition-assertedDate').valueDateTime
982
982
  :comparators:
983
983
  :eq: MAY
984
984
  :ne: MAY
@@ -990,8 +990,8 @@
990
990
  :eb: MAY
991
991
  :ap: MAY
992
992
  :values: []
993
- :type: Extension
994
- :contains_multiple: true
993
+ :type: dateTime
994
+ :contains_multiple: false
995
995
  :multiple_or: MAY
996
996
  :code:
997
997
  :paths:
@@ -3079,7 +3079,7 @@
3079
3079
  :original_path: reported[x]
3080
3080
  - :path: reportedReference
3081
3081
  :original_path: reported[x]
3082
- :type:
3082
+ :types:
3083
3083
  - Reference
3084
3084
  :target_profiles:
3085
3085
  - http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner
@@ -8780,13 +8780,10 @@
8780
8780
  - :path: address.city
8781
8781
  - :path: address.state
8782
8782
  - :path: address.postalCode
8783
- - :path: address.period
8784
8783
  - :path: communication.language
8785
8784
  :uscdi_only: true
8786
8785
  - :path: name.suffix
8787
8786
  :uscdi_only: true
8788
- - :path: name.period.end
8789
- :uscdi_only: true
8790
8787
  - :path: telecom
8791
8788
  :uscdi_only: true
8792
8789
  - :path: communication
@@ -8797,6 +8794,15 @@
8797
8794
  - :path: name.use
8798
8795
  :fixed_value: old
8799
8796
  :uscdi_only: true
8797
+ :choices:
8798
+ - :paths:
8799
+ - address.period.end
8800
+ - address.use
8801
+ :uscdi_only: true
8802
+ - :paths:
8803
+ - name.period.end
8804
+ - name.use
8805
+ :uscdi_only: true
8800
8806
  :mandatory_elements:
8801
8807
  - Patient.identifier
8802
8808
  - Patient.identifier.system
@@ -10047,6 +10053,11 @@
10047
10053
  - sdoh
10048
10054
  - '386053000'
10049
10055
  - '410606002'
10056
+ - '108252007'
10057
+ - '363679005'
10058
+ - '409063005'
10059
+ - '409073007'
10060
+ - '387713003'
10050
10061
  :elements:
10051
10062
  - :path: status
10052
10063
  - :path: intent
@@ -179,13 +179,10 @@
179
179
  - :path: address.city
180
180
  - :path: address.state
181
181
  - :path: address.postalCode
182
- - :path: address.period
183
182
  - :path: communication.language
184
183
  :uscdi_only: true
185
184
  - :path: name.suffix
186
185
  :uscdi_only: true
187
- - :path: name.period.end
188
- :uscdi_only: true
189
186
  - :path: telecom
190
187
  :uscdi_only: true
191
188
  - :path: communication
@@ -196,6 +193,15 @@
196
193
  - :path: name.use
197
194
  :fixed_value: old
198
195
  :uscdi_only: true
196
+ :choices:
197
+ - :paths:
198
+ - address.period.end
199
+ - address.use
200
+ :uscdi_only: true
201
+ - :paths:
202
+ - name.period.end
203
+ - name.use
204
+ :uscdi_only: true
199
205
  :mandatory_elements:
200
206
  - Patient.identifier
201
207
  - Patient.identifier.system
@@ -15,7 +15,6 @@ module USCoreTestKit
15
15
  * Patient.address
16
16
  * Patient.address.city
17
17
  * Patient.address.line
18
- * Patient.address.period
19
18
  * Patient.address.postalCode
20
19
  * Patient.address.state
21
20
  * Patient.birthDate
@@ -29,16 +28,15 @@ module USCoreTestKit
29
28
 
30
29
  For ONC USCDI requirements, each Patient must support the following additional elements:
31
30
 
32
- * Patient.address.use
31
+ * Patient.address.period.end or Patient.address.use
33
32
  * Patient.communication
34
33
  * Patient.communication.language
35
34
  * Patient.extension:birthsex
36
35
  * Patient.extension:ethnicity
37
36
  * Patient.extension:genderIdentity
38
37
  * Patient.extension:race
39
- * Patient.name.period.end
38
+ * Patient.name.period.end or Patient.name.use
40
39
  * Patient.name.suffix
41
- * Patient.name.use
42
40
  * Patient.telecom
43
41
  * Patient.telecom.system
44
42
  * Patient.telecom.use
@@ -170,6 +170,11 @@
170
170
  - sdoh
171
171
  - '386053000'
172
172
  - '410606002'
173
+ - '108252007'
174
+ - '363679005'
175
+ - '409063005'
176
+ - '409073007'
177
+ - '387713003'
173
178
  :elements:
174
179
  - :path: status
175
180
  - :path: intent
@@ -110,11 +110,6 @@ module USCoreTestKit
110
110
  return if group_metadata.reformatted_version == 'v311'
111
111
 
112
112
  case group_metadata.resource
113
- when 'Device'
114
- group_metadata.add_test(
115
- id: 'us_core_v400_device_udi_pi_test',
116
- file_name: '../../custom_groups/v4.0.0/device_udi_pi_test.rb'
117
- )
118
113
  when 'DocumentReference'
119
114
  group_metadata.add_test(
120
115
  id: 'us_core_v400_document_reference_custodian_test',