app/controllers/application_controller.rb
# Connect the FHIR client with the specified server and save the connection
# for future requests.
Connect the FHIR client with the specified server and save the connection
for future requests.
Connect the FHIR client with the specified server and save the connection for future requests .
def connect_to_server
    if server_url.present?
      @client = FHIR::Client.new(server_url)
      @client.use_r4
      @client.additional_headers = { 'Accept-Encoding' => 'identity' }  
      @client.set_basic_auth("fhiruser","change-password")
      cookies[:server_url] = server_url
      session[:server_url] = server_url      
    end
    rescue => exception
      err = "Connection failed: Ensure provided url points to a valid FHIR server"
      redirect_to root_path, flash: { error: err }
  end
def connect_to_server if server_url . present? @client = FHIR :: Client . new ( server_url ) @client . use_r4 @client . additional_headers = { 'Accept-Encoding' => 'identity' } @client . set_basic_auth ( "fhiruser" , "change-password" ) cookies [ :server_url ] = server_url session [ :server_url ] = server_url end rescue => exception err = "Connection failed: Ensure provided url points to a valid FHIR server" redirect_to root_path , flash : { error : err } end
Connect the FHIR client with the specified server and save the connection
for future requests.
Connect the FHIR client with the specified server and save the connection for future requests .
# 