 
 (defn create-psf
   "Create a page, sort, filter object optionally using the arguments in the provided map.
+You only need to provide the keys that you want to change from their defaults.
 
    Valid keys are:
      :pageLn                           int

  ([]
     (Psf.)))

(defmacro ^{:private true} defcontentfn
  "Create a function that calls the given content API method."
  [f docstring args api-name]
  `(defn ~f ~docstring [~'conn ~'version ~@args] 
     (. content-service ~api-name (sec/single-use-ticket ~'conn) ~'version ~@args)))

(defcontentfn get-concept
  "Get the concept for the CUI. Returns a ConceptDTO object."
  [cui]
  getConcept)

(defcontentfn get-concept-definitions
  "Get the definitions for the given concept CUI using the provided PSF."
  [cui psf]
  getConceptDefinitions)

(ns clumcl.uts.content
  "This namespace contains functions for accessing the content API of UTS.
Not all of the methods are implemented yet. If there is one missing that you need you can use the defcontentfn macro to create it."
  (:require [clumcl.uts.security :as sec]
            [clojure.java.data :refer [to-java]]
            [taoensso.timbre :as timbre
             :refer (trace debug info warn error fatal spy with-log-level)])
  (:import [gov.nih.nlm.uts.webservice.content Psf UtsWsContentControllerImplService]))

(def ^{:doc "Content service"} content-service
  (.getUtsWsContentControllerImplPort (UtsWsContentControllerImplService.)))

(def ^{:private true} option-application
