Sha256: 4e447a7c41dec61f6ebe85641a30f0bc20d11d62fdec816d4a6dd1b14d1b8331

Contents?: true

Size: 837 Bytes

Versions: 7

Compression:

Stored size: 837 Bytes

Contents

module Inferno
  module Jobs
    class InvokeValidatorSession
      include Sidekiq::Worker

      def perform(suite_id, validator_name, validator_index)
        suite = Inferno::Repositories::TestSuites.new.find suite_id
        validator = suite.fhir_validators[validator_name.to_sym][validator_index]

        response_body = validator.validate(FHIR::Patient.new, 'http://hl7.org/fhir/StructureDefinition/Patient')

        if response_body.start_with? '{'
          res = JSON.parse(response_body)
          session_id = res['sessionId']
          # TODO: (FI-2311) store this session ID so it can be referenced as needed
          validator.session_id = session_id
        else
          Inferno::Application['logger'].error("InvokeValidatorSession - error from validator: #{response_body}")
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
inferno_core-0.4.29 lib/inferno/jobs/invoke_validator_session.rb
inferno_core-0.4.28 lib/inferno/jobs/invoke_validator_session.rb
inferno_core-0.4.27 lib/inferno/jobs/invoke_validator_session.rb
inferno_core-0.4.26 lib/inferno/jobs/invoke_validator_session.rb
inferno_core-0.4.25 lib/inferno/jobs/invoke_validator_session.rb
inferno_core-0.4.24 lib/inferno/jobs/invoke_validator_session.rb
inferno_core-0.4.23 lib/inferno/jobs/invoke_validator_session.rb