Module: DaVinciPDexTestKit::ClientValidationTest
- Included in:
- PDexClientAllergyIntoleranceSubmitClinicalDataRequestTest, PDexClientCarePlanSubmitClinicalDataRequestTest, PDexClientCareTeamSubmitClinicalDataRequestTest, PDexClientConditionSubmitClinicalDataRequestTest, PDexClientDeviceSubmitClinicalDataRequestTest, PDexClientDiagnosticReportSubmitClinicalDataRequestTest, PDexClientDocumentReferenceSubmitClinicalDataRequestTest, PDexClientEncounterSubmitClinicalDataRequestTest, PDexClientExplanationOfBenefitSubmitClinicalDataRequestTest, PDexClientGoalSubmitClinicalDataRequestTest, PDexClientImmunizationSubmitClinicalDataRequestTest, PDexClientLocationSubmitClinicalDataRequestTest, PDexClientMedicationDispenseSubmitClinicalDataRequestTest, PDexClientMedicationRequestSubmitClinicalDataRequestTest, PDexClientObservationSubmitClinicalDataRequestTest, PDexClientOrganizationSubmitClinicalDataRequestTest, PDexClientPatientSubmitClinicalDataRequestTest, PDexClientPractitionerRoleSubmitClinicalDataRequestTest, PDexClientPractitionerSubmitClinicalDataRequestTest, PDexClientProcedureSubmitClinicalDataRequestTest, PDexClientScratchStorage, PDexInitialMemberMatchMustSupportValidationTest, PDexInitialMemberMatchValidationTest, PDexPayerClientSuite
- Defined in:
- lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb
Instance Method Summary collapse
-
#all_member_match_requests ⇒ Object
def patient_id_from_match_request @patient_id_from_match_request ||= member_match_request ? “999” : nil #TODO: Change from static response end.
- #connect_bundle(export_binary) ⇒ Object
- #everything_request ⇒ Object
- #export_request ⇒ Object
- #export_resources ⇒ Object
- #export_status_request ⇒ Object
- #flattened_all_resources ⇒ Object
- #member_match_request ⇒ Object
- #previous_clinical_data_request_resources ⇒ Object
- #previous_clinical_data_requests ⇒ Object
Instance Method Details
#all_member_match_requests ⇒ Object
def patient_id_from_match_request
@patient_id_from_match_request ||= member_match_request ? "999" : nil #TODO: Change from static response
end
49 50 51 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb', line 49 def all_member_match_requests @all_member_match_requests ||= load_tagged_requests(MEMBER_MATCH_TAG) end |
#connect_bundle(export_binary) ⇒ Object
17 18 19 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb', line 17 def connect_bundle(export_binary) export_binary.split(/(?<=}\n)(?={)/).map { |str| FHIR.from_contents(str)} end |
#everything_request ⇒ Object
29 30 31 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb', line 29 def everything_request @everything_request ||= load_tagged_requests(EVERYTHING_TAG).first end |
#export_request ⇒ Object
37 38 39 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb', line 37 def export_request @export_request ||= load_tagged_requests(EXPORT_TAG).first end |
#export_resources ⇒ Object
21 22 23 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb', line 21 def export_resources @export_resources ||= (load_tagged_requests(BINARY_TAG).map { |binary_read| binary_read.response_body.split("\n") }.flatten).map { |resource_in_binary| FHIR.from_contents(resource_in_binary)} end |
#export_status_request ⇒ Object
41 42 43 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb', line 41 def export_status_request @export_status_request ||= load_tagged_requests(EXPORT_STATUS_TAG).first end |
#flattened_all_resources ⇒ Object
53 54 55 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb', line 53 def flattened_all_resources @flattened_all_resources ||= previous_clinical_data_request_resources.values.flatten end |
#member_match_request ⇒ Object
33 34 35 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb', line 33 def member_match_request @member_match_request ||= load_tagged_requests(MEMBER_MATCH_TAG).first end |
#previous_clinical_data_request_resources ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb', line 4 def previous_clinical_data_request_resources hash = Hash.new { |hash, key| hash[key] = [] } previous_clinical_data_requests.each_with_object(hash) do |request, request_resource_hash| request_resources = if request.status == 200 request.resource.entry.map(&:resource) else [] end request_resource_hash[request].concat(request_resources) end end |
#previous_clinical_data_requests ⇒ Object
25 26 27 |
# File 'lib/davinci_pdex_test_kit/pdex_payer_client/client_validation_test.rb', line 25 def previous_clinical_data_requests @previous_clinical_data_requests ||= load_tagged_requests(SUBMIT_TAG) + [everything_request].compact end |