Skip to content

Commit

Permalink
Add preset for prod ref server, make create and update tests optional
Browse files Browse the repository at this point in the history
  • Loading branch information
elsaperelli committed Dec 4, 2024
1 parent 6c09b16 commit 0685b41
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "Inferno Reference Server",
"id": "smart_stu2_reference_server",
"title": "Inferno Reference Server (Local)",
"id": "light_ehr_ref_server_local",
"test_suite_id": "dtr_light_ehr",
"inputs": [
{
Expand Down
90 changes: 90 additions & 0 deletions config/presets/light_ehr_ref_server_prod_suite.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"title": "Inferno Reference Server (Production)",
"id": "light_ehr_ref_server_prod",
"test_suite_id": "dtr_light_ehr",
"inputs": [
{
"name": "url",
"description": "URL of the FHIR endpoint used by SMART applications",
"title": "FHIR Endpoint",
"type": "text",
"value": "https://inferno.healthit.gov/reference-server/r4"
},
{
"name": "ehr_client_id",
"description": "Client ID provided during registration of Inferno as an EHR launch application",
"title": "EHR Launch Client ID",
"type": "text",
"value": "SAMPLE_PUBLIC_CLIENT_ID"
},
{
"name": "standalone_client_id",
"type": "text",
"value": "SAMPLE_PUBLIC_CLIENT_ID"
},
{
"name": "smart_credentials",
"type": "oauth_credentials",
"title": "OAuth Credentials",
"optional": true,
"value": "{\"access_token\":\"SAMPLE_TOKEN\"}"
},
{
"name": "credentials",
"type": "oauth_credentials",
"title": "OAuth Credentials",
"optional": true,
"value": "{\"access_token\":\"SAMPLE_TOKEN\"}"
},
{
"name": "patient_ids",
"type": "text",
"value": "pat015"
},
{
"name": "coverage_ids",
"type": "text",
"value": "cov015"
},
{
"name": "communication_request_ids",
"type": "text",
"value": "communicationrequest-example1"
},
{
"name": "device_request_ids",
"type": "text",
"value": "devreqe0470"
},
{
"name": "encounter_ids",
"type": "text",
"value": "pat015-rad-encounter"
},
{
"name": "medication_request_ids",
"type": "text",
"value": "medicationrequest-example1"
},
{
"name": "nutrition_order_ids",
"type": "text",
"value": "nutritionorder-example1"
},
{
"name": "service_request_ids",
"type": "text",
"value": "servreq-g0180-1"
},
{
"name": "task_ids",
"type": "text",
"value": "cdex-task-example19"
},
{
"name": "vision_prescription_ids",
"type": "text",
"value": "visionprescription-example1,visionprescription-example2"
}
]
}
1 change: 1 addition & 0 deletions lib/davinci_dtr_test_kit/create_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module DaVinciDTRTestKit
module CreateTest
def perform_create_test(create_resources, resource_type)
skip_if(create_resources.blank?, 'No resources to create provided, skipping test.')
assert_valid_json(create_resources)
create_resources_list = JSON.parse(create_resources)
skip_if(!create_resources_list.is_a?(Array), 'Resources to create not inputted in list format, skipping test.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ class QuestionnaireResponseCreateTest < Inferno::Test
description 'A sever SHALL support the QuestionnaireResponse create interaction'

id :questionnaire_response_create
optional
input :create_questionnaire_resources,
type: 'textarea',
description:
'Provide a list of QuestionnaireResponse resources to create. e.g., [json_resource_1, json_resource_2]'
'Provide a list of QuestionnaireResponse resources to create. e.g., [json_resource_1, json_resource_2]',
optional: true

def resource_type
'QuestionnaireResponse'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ class QuestionnaireResponseUpdateTest < Inferno::Test
description 'A server SHALL support the QuestionnaireResponse update interaction'

id :questionnaire_response_update
optional
input :update_questionnaire_resources,
type: 'textarea',
description:
'Provide a list of QuestionnaireResponse resources to update. e.g., [json_resource_1, json_resource_2]'
'Provide a list of QuestionnaireResponse resources to update. e.g., [json_resource_1, json_resource_2]',
optional: true

def resource_type
'QuestionnaireResponse'
Expand Down
4 changes: 3 additions & 1 deletion lib/davinci_dtr_test_kit/profiles/task/task_create.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ class TaskCreateTest < Inferno::Test
description 'A server SHOULD support the Task create interaction'

id :task_create
optional
input :create_task_resources,
type: 'textarea',
description:
'Provide a list of Task resources to create. e.g., [json_resource_1, json_resource_2]'
'Provide a list of Task resources to create. e.g., [json_resource_1, json_resource_2]',
optional: true

def resource_type
'Task'
Expand Down
4 changes: 3 additions & 1 deletion lib/davinci_dtr_test_kit/profiles/task/task_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ class TaskUpdateTest < Inferno::Test
description 'A server SHOULD support the Task update interaction'

id :task_update
optional
input :update_task_resources,
type: 'textarea',
description:
'Provide a list of Task resources to update. e.g., [json_resource_1, json_resource_2]'
'Provide a list of Task resources to update. e.g., [json_resource_1, json_resource_2]',
optional: true

def resource_type
'Task'
Expand Down
1 change: 1 addition & 0 deletions lib/davinci_dtr_test_kit/update_test.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module DaVinciDTRTestKit
module UpdateTest
def perform_update_test(update_resources, resource_type)
skip_if(update_resources.blank?, 'No resources to update provided, skipping test.')
assert_valid_json(update_resources)
update_resources_list = JSON.parse(update_resources)
skip_if(!update_resources_list.is_a?(Array), 'Resources to update not inputted in list format, skipping test.')
Expand Down

0 comments on commit 0685b41

Please sign in to comment.