lib/neutrino/gateway/patient_document.rb
# Gets the base URI for a patient document
#
# @param [Hash] params specify what patient to get, must specify either `:id` or `:root` and `extension`
# @return [String] the base URI for a patient document
Gets the base URI for a patient document
Gets the base URI for a patient document
def base_uri(params, options = {})
          url = "#{api(options)}"
          url << '/patient_document'
          if params[:id].present?
            url << "/#{params[:id]}"
          elsif params[:root].present? && params[:extension].present?
            url << "/#{URI.escape(params[:root])}/#{URI.escape(params[:extension])}"
            if params[:extension_suffix].present?
              url << "/#{URI.escape(params[:extension_suffix])}"
              url << "/#{params[:document_source_updated_at].iso8601(3)}" if params[:document_source_updated_at].present?
            end
          elsif params[:root].present?
            url << "/#{URI.escape(params[:root])}"
          else
            fail Neutrino::Gateway::Exceptions::BadRequestError, 'Either id or root and extension are required to create patient document path'
          end
          url
        end
def base_uri ( params , options = { } ) url = "#{api(options)}" url << '/patient_document' if params [ :id ] . present? url << "/#{params[:id]}" elsif params [ :root ] . present? && params [ :extension ] . present? url << "/#{URI.escape(params[:root])}/#{URI.escape(params[:extension])}" if params [ :extension_suffix ] . present? url << "/#{URI.escape(params[:extension_suffix])}" url << "/#{params[:document_source_updated_at].iso8601(3)}" if params [ :document_source_updated_at ] . present? end elsif params [ :root ] . present? url << "/#{URI.escape(params[:root])}" else fail Neutrino :: Gateway :: Exceptions :: BadRequestError , 'Either id or root and extension are required to create patient document path' end url end
Gets the base URI for a patient document
Gets the base URI for a patient document
the base URI for a patient document
the base URI for a patient document
String
params
<not_specific>
options
<not_specific>
<not_specific>
params specify what patient to get, must specify either `:id` or `:root` and `extension`
params specify what patient to get must specify either ` : id ` or ` : root ` and ` extension `