davinci_crd_test_kit 0.9.0 → 0.9.1.rc
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/davinci_crd_test_kit/card_responses/propose_alternate_request.json +2 -52
- data/lib/davinci_crd_test_kit/card_responses/request_form_completion.json +46 -31
- data/lib/davinci_crd_test_kit/cards_validation.rb +8 -4
- data/lib/davinci_crd_test_kit/client_hooks_group.rb +22 -660
- data/lib/davinci_crd_test_kit/client_tests/appointment_book_receive_request_test.rb +17 -6
- data/lib/davinci_crd_test_kit/client_tests/client_appointment_book_group.rb +70 -0
- data/lib/davinci_crd_test_kit/client_tests/client_encounter_discharge_group.rb +71 -0
- data/lib/davinci_crd_test_kit/client_tests/client_encounter_start_group.rb +70 -0
- data/lib/davinci_crd_test_kit/client_tests/client_order_dispatch_group.rb +70 -0
- data/lib/davinci_crd_test_kit/client_tests/client_order_select_group.rb +72 -0
- data/lib/davinci_crd_test_kit/client_tests/client_order_sign_group.rb +71 -0
- data/lib/davinci_crd_test_kit/client_tests/decode_auth_token_test.rb +43 -23
- data/lib/davinci_crd_test_kit/client_tests/encounter_discharge_receive_request_test.rb +19 -6
- data/lib/davinci_crd_test_kit/client_tests/encounter_start_receive_request_test.rb +18 -6
- data/lib/davinci_crd_test_kit/client_tests/hook_request_optional_fields_test.rb +26 -10
- data/lib/davinci_crd_test_kit/client_tests/hook_request_required_fields_test.rb +20 -11
- data/lib/davinci_crd_test_kit/client_tests/hook_request_valid_context_test.rb +14 -10
- data/lib/davinci_crd_test_kit/client_tests/hook_request_valid_prefetch_test.rb +27 -110
- data/lib/davinci_crd_test_kit/client_tests/order_dispatch_receive_request_test.rb +18 -6
- data/lib/davinci_crd_test_kit/client_tests/order_select_receive_request_test.rb +18 -6
- data/lib/davinci_crd_test_kit/client_tests/order_sign_receive_request_test.rb +18 -6
- data/lib/davinci_crd_test_kit/client_tests/retrieve_jwks_test.rb +66 -29
- data/lib/davinci_crd_test_kit/client_tests/submitted_response_validation.rb +44 -0
- data/lib/davinci_crd_test_kit/client_tests/token_header_test.rb +45 -14
- data/lib/davinci_crd_test_kit/client_tests/token_payload_test.rb +43 -26
- data/lib/davinci_crd_test_kit/crd_client_suite.rb +0 -4
- data/lib/davinci_crd_test_kit/hook_request_field_validation.rb +240 -50
- data/lib/davinci_crd_test_kit/mock_service_response.rb +134 -120
- data/lib/davinci_crd_test_kit/routes/hook_request_endpoint.rb +26 -42
- data/lib/davinci_crd_test_kit/server_encounter_discharge_group.rb +24 -0
- data/lib/davinci_crd_test_kit/server_encounter_start_group.rb +24 -0
- data/lib/davinci_crd_test_kit/server_order_select_group.rb +24 -0
- data/lib/davinci_crd_test_kit/server_tests/coverage_information_system_action_received_test.rb +4 -1
- data/lib/davinci_crd_test_kit/server_tests/service_request_optional_fields_validation_test.rb +8 -10
- data/lib/davinci_crd_test_kit/server_tests/service_request_required_fields_validation_test.rb +5 -10
- data/lib/davinci_crd_test_kit/tags.rb +6 -6
- data/lib/davinci_crd_test_kit/version.rb +1 -1
- metadata +9 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c13b961a853f2809d25fe04b489ceff38448754771fe48f24b132f177f7bf38
|
4
|
+
data.tar.gz: cc24a78d0b647a072a277fb7ae7a0335f0855646426bcf66613749f601675a9e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0d98786a1a42951bc0db5d85bc8d2daaa89dc00be0563eb3c8e67db7380f91749441b4cd716429817620c1d3edb1ac2f617db14215c91bc326fda7ba7f653d3f
|
7
|
+
data.tar.gz: 71c8477567194b71c58c14dbb04f0e633e9b46692759673b6c6998d1fd28307f71307eea3c773d33e32a0c359adb55d77397d214e035f92bf20b9d8456a01859
|
@@ -15,57 +15,7 @@
|
|
15
15
|
"suggestions": [
|
16
16
|
{
|
17
17
|
"label": "Replace order with a health assessment first",
|
18
|
-
"actions": [
|
19
|
-
{
|
20
|
-
"type": "create",
|
21
|
-
"description": "Order for patient health assessment",
|
22
|
-
"resource": {
|
23
|
-
"resourceType": "ServiceRequest",
|
24
|
-
"status": "draft",
|
25
|
-
"intent": "order",
|
26
|
-
"category": [
|
27
|
-
{
|
28
|
-
"coding": [
|
29
|
-
{
|
30
|
-
"system": "http://snomed.info/sct",
|
31
|
-
"code": "409063005",
|
32
|
-
"display": "Counselling"
|
33
|
-
}
|
34
|
-
]
|
35
|
-
}
|
36
|
-
],
|
37
|
-
"code": {
|
38
|
-
"coding": [
|
39
|
-
{
|
40
|
-
"system": "http://snomed.info/sct",
|
41
|
-
"code": "225885004",
|
42
|
-
"display": "Health assessment (procedure)"
|
43
|
-
}
|
44
|
-
]
|
45
|
-
},
|
46
|
-
"subject": {
|
47
|
-
"reference": "http://example.org/fhir/Patient/123"
|
48
|
-
},
|
49
|
-
"occurrenceTiming": {
|
50
|
-
"repeat": {
|
51
|
-
"boundsDuration": {
|
52
|
-
"value": 3,
|
53
|
-
"unit": "months",
|
54
|
-
"system": "http://unitsofmeasure.org",
|
55
|
-
"code": "mo"
|
56
|
-
},
|
57
|
-
"frequency": 1,
|
58
|
-
"period": 1,
|
59
|
-
"periodUnit": "mo"
|
60
|
-
}
|
61
|
-
},
|
62
|
-
"authoredOn": "2019-02-15",
|
63
|
-
"requester": {
|
64
|
-
"reference": "http://example.org/fhir/PractitionerRole/987"
|
65
|
-
}
|
66
|
-
}
|
67
|
-
}
|
68
|
-
]
|
18
|
+
"actions": []
|
69
19
|
}
|
70
20
|
]
|
71
|
-
}
|
21
|
+
}
|
@@ -14,12 +14,12 @@
|
|
14
14
|
"selectionBehavior": "any",
|
15
15
|
"suggestions": [
|
16
16
|
{
|
17
|
-
"label"
|
18
|
-
"actions"
|
17
|
+
"label": "Add 'completion of the ABC form' to your task list (possibly for reassignment)",
|
18
|
+
"actions": [
|
19
19
|
{
|
20
|
-
"type"
|
21
|
-
"description"
|
22
|
-
"resource"
|
20
|
+
"type": "create",
|
21
|
+
"description": "Add version 2 of the XYZ form to the clinical system's repository (if it doesn't already exist)",
|
22
|
+
"resource": {
|
23
23
|
"resourceType": "Questionnaire",
|
24
24
|
"id": "XYZ",
|
25
25
|
"url": "http://example.org/Questionnaire/XYZ",
|
@@ -178,42 +178,57 @@
|
|
178
178
|
}
|
179
179
|
},
|
180
180
|
{
|
181
|
-
"type"
|
182
|
-
"description"
|
183
|
-
"resource"
|
184
|
-
"resourceType"
|
185
|
-
"status"
|
186
|
-
"intent"
|
187
|
-
"code"
|
188
|
-
"coding"
|
181
|
+
"type": "create",
|
182
|
+
"description": "Add 'Complete ABC form' to the task list",
|
183
|
+
"resource": {
|
184
|
+
"resourceType": "Task",
|
185
|
+
"status": "ready",
|
186
|
+
"intent": "order",
|
187
|
+
"code": {
|
188
|
+
"coding": [
|
189
189
|
{
|
190
|
-
"system"
|
191
|
-
"code"
|
190
|
+
"system": "http://hl7.org/fhir/uv/sdc/CodeSystem/temp",
|
191
|
+
"code": "complete-questionnaire"
|
192
192
|
}
|
193
193
|
]
|
194
194
|
},
|
195
|
-
"description"
|
196
|
-
"for"
|
197
|
-
"reference"
|
195
|
+
"description": "Complete XYZ form for local retention",
|
196
|
+
"for": {
|
197
|
+
"reference": "http://example.org/fhir/Patient/123"
|
198
198
|
},
|
199
|
-
"authoredOn"
|
200
|
-
"
|
199
|
+
"authoredOn": "2018-08-09",
|
200
|
+
"requester": {
|
201
|
+
"reference": "http://example.org/fhir/Organization/payer"
|
202
|
+
},
|
203
|
+
"input": [
|
201
204
|
{
|
202
|
-
"type"
|
203
|
-
"text"
|
205
|
+
"type": {
|
206
|
+
"text": "questionnaire",
|
207
|
+
"coding": [
|
208
|
+
{
|
209
|
+
"system": "http://hl7.org/fhir/uv/sdc/CodeSystem/temp",
|
210
|
+
"code": "questionnaire"
|
211
|
+
}
|
212
|
+
]
|
204
213
|
},
|
205
|
-
"valueCanonical"
|
214
|
+
"valueCanonical": "http://example.org/Questionnaire/XYZ"
|
206
215
|
},
|
207
216
|
{
|
208
|
-
"type"
|
209
|
-
"text"
|
217
|
+
"type": {
|
218
|
+
"text": "afterCompletion",
|
219
|
+
"coding": [
|
220
|
+
{
|
221
|
+
"system": "http://hl7.org/fhir/us/davinci-crd/CodeSystem/temp",
|
222
|
+
"code": "after-completion-action"
|
223
|
+
}
|
224
|
+
]
|
210
225
|
},
|
211
|
-
"valueCodeableConcept"
|
212
|
-
"coding"
|
226
|
+
"valueCodeableConcept": {
|
227
|
+
"coding": [
|
213
228
|
{
|
214
|
-
"system"
|
215
|
-
"code"
|
216
|
-
"display"
|
229
|
+
"system": "http://hl7.org/fhir/us/davinci-crd/CodeSystem/temp",
|
230
|
+
"code": "prior-auth-include",
|
231
|
+
"display": "Include in prior authorization"
|
217
232
|
}
|
218
233
|
]
|
219
234
|
}
|
@@ -224,4 +239,4 @@
|
|
224
239
|
]
|
225
240
|
}
|
226
241
|
]
|
227
|
-
}
|
242
|
+
}
|
@@ -191,17 +191,21 @@ module DaVinciCRDTestKit
|
|
191
191
|
end
|
192
192
|
end
|
193
193
|
|
194
|
+
def response_label(index = nil)
|
195
|
+
"Server response #{index}"
|
196
|
+
end
|
197
|
+
|
194
198
|
def perform_cards_validation(cards, response_index = 0)
|
195
199
|
unless cards
|
196
|
-
add_message('error', "
|
200
|
+
add_message('error', "#{response_label(response_index + 1)} did not have the `cards` field.")
|
197
201
|
return
|
198
202
|
end
|
199
203
|
unless cards.is_a?(Array)
|
200
|
-
add_message('error', "`cards` field of
|
204
|
+
add_message('error', "`cards` field of #{response_label(response_index + 1).downcase} is not an array.")
|
201
205
|
return
|
202
206
|
end
|
203
207
|
warning do
|
204
|
-
assert cards.present?, "
|
208
|
+
assert cards.present?, "#{response_label(response_index + 1)} has no decision support."
|
205
209
|
end
|
206
210
|
cards_check(cards)
|
207
211
|
end
|
@@ -219,7 +223,7 @@ module DaVinciCRDTestKit
|
|
219
223
|
service_response = JSON.parse(request.response_body)
|
220
224
|
perform_cards_validation(service_response['cards'], index)
|
221
225
|
rescue JSON::ParserError
|
222
|
-
add_message('error', "Invalid JSON:
|
226
|
+
add_message('error', "Invalid JSON: #{response_label(response_index + 1).downcase} is not a valid JSON.")
|
223
227
|
end
|
224
228
|
end
|
225
229
|
|