From 0685b41e07ed2390712cfa3b8831aa883e2e7913 Mon Sep 17 00:00:00 2001 From: Elsa Date: Wed, 4 Dec 2024 11:08:46 -0500 Subject: [PATCH] Add preset for prod ref server, make create and update tests optional --- ... => light_ehr_ref_server_local_suite.json} | 4 +- .../light_ehr_ref_server_prod_suite.json | 90 +++++++++++++++++++ lib/davinci_dtr_test_kit/create_test.rb | 1 + .../questionnaire_response_create.rb | 4 +- .../questionnaire_response_update.rb | 4 +- .../profiles/task/task_create.rb | 4 +- .../profiles/task/task_update.rb | 4 +- lib/davinci_dtr_test_kit/update_test.rb | 1 + 8 files changed, 106 insertions(+), 6 deletions(-) rename config/presets/{inferno_dtr_server_suite.json => light_ehr_ref_server_local_suite.json} (99%) create mode 100644 config/presets/light_ehr_ref_server_prod_suite.json diff --git a/config/presets/inferno_dtr_server_suite.json b/config/presets/light_ehr_ref_server_local_suite.json similarity index 99% rename from config/presets/inferno_dtr_server_suite.json rename to config/presets/light_ehr_ref_server_local_suite.json index 8d5676c..54eda83 100644 --- a/config/presets/inferno_dtr_server_suite.json +++ b/config/presets/light_ehr_ref_server_local_suite.json @@ -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": [ { diff --git a/config/presets/light_ehr_ref_server_prod_suite.json b/config/presets/light_ehr_ref_server_prod_suite.json new file mode 100644 index 0000000..7622737 --- /dev/null +++ b/config/presets/light_ehr_ref_server_prod_suite.json @@ -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" + } + ] +} diff --git a/lib/davinci_dtr_test_kit/create_test.rb b/lib/davinci_dtr_test_kit/create_test.rb index dd7e24a..16bc980 100644 --- a/lib/davinci_dtr_test_kit/create_test.rb +++ b/lib/davinci_dtr_test_kit/create_test.rb @@ -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.') diff --git a/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_create.rb b/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_create.rb index 56a0f39..e596120 100644 --- a/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_create.rb +++ b/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_create.rb @@ -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' diff --git a/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_update.rb b/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_update.rb index c4bac4e..bcc00c8 100644 --- a/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_update.rb +++ b/lib/davinci_dtr_test_kit/profiles/questionnaire_response/questionnaire_response_update.rb @@ -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' diff --git a/lib/davinci_dtr_test_kit/profiles/task/task_create.rb b/lib/davinci_dtr_test_kit/profiles/task/task_create.rb index 71dc417..db5195b 100644 --- a/lib/davinci_dtr_test_kit/profiles/task/task_create.rb +++ b/lib/davinci_dtr_test_kit/profiles/task/task_create.rb @@ -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' diff --git a/lib/davinci_dtr_test_kit/profiles/task/task_update.rb b/lib/davinci_dtr_test_kit/profiles/task/task_update.rb index c08a8e8..e5ea108 100644 --- a/lib/davinci_dtr_test_kit/profiles/task/task_update.rb +++ b/lib/davinci_dtr_test_kit/profiles/task/task_update.rb @@ -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' diff --git a/lib/davinci_dtr_test_kit/update_test.rb b/lib/davinci_dtr_test_kit/update_test.rb index 5be2641..afd9ce8 100644 --- a/lib/davinci_dtr_test_kit/update_test.rb +++ b/lib/davinci_dtr_test_kit/update_test.rb @@ -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.')