Liking cljdoc? Tell your friends :D

ehr-adapter.reference


extractclj

(extract x)

Recursively traverses the given data structure x and collects all unique reference keywords (e.g., :ref/variable or :ref?/variable).

Returns a set containing all the encountered reference keywords intact, preserving their original namespaces so they can be classified later.

Example: (extract {:path [:room :ref/id] :request {:name :ref?/name}}) ;; => #{:ref/id :ref?/name}

Recursively traverses the given data structure `x` and collects all unique 
reference keywords (e.g., :ref/variable or :ref?/variable).

Returns a set containing all the encountered reference keywords intact, 
preserving their original namespaces so they can be classified later.

Example:
  (extract {:path [:room :ref/id] :request {:name :ref?/name}})
  ;; => #{:ref/id :ref?/name}
raw docstring

get-refclj

(get-ref ref-bindings ref)

optional-reference?clj

(optional-reference? x)

Returns true if x is a keyword with the namespace 'ref?' (e.g., :ref/patientId). Otherwise, returns false.

Returns true if x is a keyword with the namespace 'ref?' 
(e.g., :ref/patientId). Otherwise, returns false.
raw docstring

partial-resolveclj

(partial-resolve ref-bindings x)

reference?clj

(reference? x)

referentclj

(referent ref)

Returns the underlying target keyword (the referent) of a given reference by stripping away its 'ref' or 'ref?' namespace.

Example: (referent :ref/patientId) ;; => :patientId (referent :ref?/patientId) ;; => :patientId (referent :plain-keyword) ;; => nil

Returns the underlying target keyword (the referent) of a given reference 
by stripping away its 'ref' or 'ref?' namespace.

Example:
  (referent :ref/patientId)  ;; => :patientId
  (referent :ref?/patientId) ;; => :patientId
  (referent :plain-keyword)  ;; => nil
raw docstring

required-reference?clj

(required-reference? x)

Returns true if x is a keyword with the namespace 'ref' (e.g., :ref/patientId). Otherwise, returns false.

Returns true if x is a keyword with the namespace 'ref' 
(e.g., :ref/patientId). Otherwise, returns false.
raw docstring

resolveclj

(resolve ref-bindings x)

Recursively traverses the given form (maps, vectors, lists, etc.) and replaces any placeholder keyword matching the format :ref/variable-name with its corresponding runtime value extracted from ref-bindings.

Arguments:

  • ref-bindings: A map containing runtime dynamic data (e.g., {:patientId "123"}).
  • form: Any Clojure data structure or template that contains :ref/... keywords.

Returns: The deeply transformed data structure with all references resolved.

Throws: clojure.lang.ExceptionInfo if a required :ref/... keyword found in the form cannot be resolved within the provided ref-bindings map. The exception includes the full original context for deep production debugging.

Recursively traverses the given `form` (maps, vectors, lists, etc.) 
and replaces any placeholder keyword matching the format :ref/variable-name 
with its corresponding runtime value extracted from `ref-bindings`.

Arguments:
  - `ref-bindings`: A map containing runtime dynamic data (e.g., {:patientId "123"}).
  - `form`: Any Clojure data structure or template that contains :ref/... keywords.

Returns:
  The deeply transformed data structure with all references resolved.

Throws:
  clojure.lang.ExceptionInfo if a required :ref/... keyword found in the form 
  cannot be resolved within the provided `ref-bindings` map. The exception 
  includes the full original context for deep production debugging.
raw docstring

validate-ref-bindingsclj

(validate-ref-bindings ref-bindings)

Returns true when ref-bindings is a Clojure map, else throws :invalid/type error

Returns true when ref-bindings is a Clojure map, else throws :invalid/type error
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close