Class: AUPSTestKit::GenerateSummaryBundleTestClass

Inherits:
BasicTest
  • Object
show all
Defined in:
lib/au_ps_inferno/utils/generate_summary_bundle_test_class.rb

Overview

Generates a Bundle via the IPS $summary operation into the group's scratch space

Constant Summary collapse

NO_SUMMARY_INPUTS_MESSAGE =
'No FHIR server URL with patient id or patient identifier was provided, ' \
'so this test group is omitted.'

Constants included from BasicTestCompositionSectionReadModule

BasicTestCompositionSectionReadModule::MANDATORY_SECTIONS_CODES, BasicTestCompositionSectionReadModule::OPTIONAL_SECTIONS_CODES, BasicTestCompositionSectionReadModule::RECOMMENDED_SECTIONS_CODES

Constants included from BasicTestCompositionSectionReadModule::BasicTestCompositionSectionCheckResourcesMSElementsModule

BasicTestCompositionSectionReadModule::BasicTestCompositionSectionCheckResourcesMSElementsModule::AU_PS_PROFILE_BASE_URL

Constants included from BasicTestConstants

BasicTestConstants::AUTHOR_MS_IDENTIFIER_SLICES_BY_TYPE, BasicTestConstants::NO_SERVER_URL_OMIT_MESSAGE, BasicTestConstants::ORGANIZATION_MS_IDENTIFIER_SLICES, BasicTestConstants::PATIENT_MS_IDENTIFIER_SLICES, BasicTestConstants::PRACTITIONER_MS_IDENTIFIER_SLICES, BasicTestConstants::PRACTITIONER_ROLE_MS_IDENTIFIER_SLICES

Constants included from ValidatorHelpers

ValidatorHelpers::DEFAULT_VALUE, ValidatorHelpers::RESPONSE_KEYS, ValidatorHelpers::RESPONSE_VALIDATOR_KEY, ValidatorHelpers::RESPONSE_WRAPPER_KEY, ValidatorHelpers::VALIDATOR_KEY, ValidatorHelpers::WRAPPER_KEY

Constants included from CompositionUtils

CompositionUtils::BUNDLE_SOURCE_GROUPS, CompositionUtils::NO_BUNDLE_OMIT_MESSAGE

Instance Method Summary collapse

Methods included from BasicTestResolveResourceTypeModule

#raw_resource_type_is_valid, #test_resource_type_is_valid?

Methods included from BasicTestMsSubElementsPopulatedModule

#ms_sub_elements_populated_message

Methods included from BasicTestMsElementsPopulatedModule

#ms_elements_populated_message

Methods included from BasicTestResolvePathDebugModule

#resolve_path_with_dar

Methods included from BasicTestCompositionSectionReadIssuesHelpersModule

#references_resolution_report

Methods included from BasicTestCompositionSectionReadModule::BasicTestCompositionSectionCheckResourcesMSElementsModule

#check_ms_elements_populated

Methods included from BasicTestCapabilityOperationsModule

#operation_defined?, #operations, #select_op, #summary_op_defined?

Methods included from BasicTestBundleModule

#bundle_mandatory_ms_elements_info, #mandatory_ms_elements_info, #skip_validation?, #validate_au_ps_bundle, #validate_ips_bundle

Methods included from BasicTestAttesterIdentifierSlices

#test_composition_attester_party_ms_identifier_slices, #validate_attester_party_ms_identifier_slices

Methods included from BasicTestAttesterResource

#attester_party_resource

Methods included from BasicTestCustodianTests

#test_composition_custodian_ms_identifier_slices

Methods included from BasicTestCustodianIdentifierSlices

#validate_custodian_ms_identifier_slices

Methods included from BasicTestCustodianResource

#custodian_resource

Methods included from BasicTestAuthorTests

#test_composition_author_ms_identifier_slices

Methods included from BasicTestAuthorResource

#author_resource

Methods included from BasicTestSubjectPatientMsOtherTests

#test_subject_ms_identifier_slices

Methods included from BasicTestSubjectResource

#subject_resource

Methods included from SectionNamesMapping

#get_section_name, #section_names_mapping

Methods included from SectionTestModule

#entry_resources_info

Methods included from ValidatorHelpers

#show_validator_version

Methods included from CompositionUtils

#bundle_scratch_key, #group_section_output, #omit_unless_bundle_in_scratch, #save_bundle_to_scratch, #scratch_bundle

Methods included from CompositionUtilsBooleanAndStats

#all_entries_have_full_url_info?, #boolean_to_existent_string, #identifier_info?, #timestamp_info?, #type_info?

Instance Method Details

#operation_pathObject



56
57
58
59
60
61
62
63
64
# File 'lib/au_ps_inferno/utils/generate_summary_bundle_test_class.rb', line 56

def operation_path
  if patient_id
    profile ? "Patient/#{patient_id}/$summary?profile=#{profile}" : "Patient/#{patient_id}/$summary"
  elsif profile
    "Patient/$summary?identifier=#{identifier}&profile=#{profile}"
  else
    "Patient/$summary?identifier=#{identifier}"
  end
end

#read_and_save_dataObject



66
67
68
69
70
71
72
# File 'lib/au_ps_inferno/utils/generate_summary_bundle_test_class.rb', line 66

def read_and_save_data
  response = fhir_operation(operation_path, name: :summary_operation, operation_method: :get)
  assert_response_status(200)
  assert_resource_type(:bundle)
  resource_from_request = FHIR.from_contents(response.response_body)
  save_bundle_to_scratch(resource_from_request)
end

#skip_test?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/au_ps_inferno/utils/generate_summary_bundle_test_class.rb', line 52

def skip_test?
  (patient_id.blank? && identifier.blank?) || url.blank?
end