diff --git a/lib/davinci_pas_test_kit/pas_bundle_validation.rb b/lib/davinci_pas_test_kit/pas_bundle_validation.rb index 319beb1..453ae96 100644 --- a/lib/davinci_pas_test_kit/pas_bundle_validation.rb +++ b/lib/davinci_pas_test_kit/pas_bundle_validation.rb @@ -370,7 +370,7 @@ def evaluate_fhirpath_expression(resource, expression) logger = Logger.new($stdout) begin - validator_url = ENV.fetch('VALIDATOR_URL') # 'https://inferno.healthit.gov/validatorapi/' + validator_url = 'http://localhost:6789' # 'https://inferno.healthit.gov/validatorapi/' path = "#{validator_url}/evaluate?path=#{expression}" response = Faraday.post(path, resource.to_json, 'Content-Type' => 'application/json') @@ -378,10 +378,12 @@ def evaluate_fhirpath_expression(resource, expression) result = JSON.parse(response.body) return result.map { |entry| entry.dig('element', 'reference') if entry['type'] == 'Reference' }.compact else - logger.error "External validator failed: #{response.status}" + logger.error "External evaluator failed: #{response.status}" + raise 'fhirpath service not available' end rescue Faraday::Error => e logger.error "HTTP request failed: #{e.message}" + raise 'fhirpath service not available' end []