How to query in oracle and enter mongoid?

Hello, I hope you are very well, I am working on a rails project that has a connection to oracle and mongo db, the connection to oracle is not made through a configuration file, and what is done is simply client queries to enter data in mongod, an example of an existing method in development is the following

def qgetpatient oracle=Oracleq.new if params[:pid].present? nid=Patient.find(params[:pid]).nid else nid=params[:nid] end

@query=oracle.qpatients_h(nid)

if @query.present?
  #pnids=Patient.pluck(:nid)
  @query["DateFormat"]=@query["DATE_BIRTH"].to_date.strftime('%Y/%m/%d')
  @query["PRIORITY"]=@query["PRIORITY"]

  if @query["MUNICIPALITY"]==""
     @query["MUNICIPALITY"]="05001"
  end

  if @query["PRIORITY"]==""
      @query["PRIORITY"]=null
  end
  
  if @query["COD"].length>5
     @query["COD"]="9900"
  end
  if Patient.where(nid:@query["ID"]).count > 0
    @query["towerexists"]=true
  else
    @query["towerexists"]=false
  end
else
  @query="NO DATA"
end
respond_to do |format|
  format.html
  format.json { render json: @query }
end

end I really don’t know how to obtain oracle data with ruby, please someone help me by sending me documentation on how to do it, I thank you immensely