Liking cljdoc? Tell your friends :D

com.eldrix.hermes.core

Provides a terminology service, wrapping the SNOMED store and search implementations as a single unified service.

Provides a terminology service, wrapping the SNOMED store and
search implementations as a single unified service.
raw docstring

active-association-targetsclj

(active-association-targets svc component-id refset-id)

Return the active association targets for a given component.

Return the active association targets for a given component.
sourceraw docstring

all-childrenclj

(all-children svc concept-id)
(all-children svc concept-id type-id)

Returns a set of concept ids of the children of the specified concept. By design, this includes the concept itself.

Returns a set of concept ids of the children of the specified concept. By
design, this includes the concept itself.
sourceraw docstring

all-parentsclj

(all-parents svc concept-id-or-ids)
(all-parents svc concept-id-or-ids type-id)

Returns a set of concept ids of the parents of the specified concept(s). By design, this includes the concept(s).

Returns a set of concept ids of the parents of the specified concept(s). By
design, this includes the concept(s).
sourceraw docstring

are-any?clj

(are-any? svc concept-ids parent-ids)

Are any of the concept-ids subsumed by any of the parent-ids?

Checks the is-a relationships of the concepts in question against the set of parent identifiers.

Are any of the concept-ids subsumed by any of the parent-ids?

Checks the is-a relationships of the concepts in question against the set of
parent identifiers.
sourceraw docstring

build-search-indexcljdeprecated

DEPRECATED: Use index instead

DEPRECATED: Use [[index]] instead
sourceraw docstring

build-search-indicescljdeprecated

DEPRECATED: Use index instead

DEPRECATED: Use [[index]] instead
sourceraw docstring

child-relationships-of-typeclj

(child-relationships-of-type svc concept-id type-concept-id)

Returns a set of identifiers representing the child relationships of the specified type of the specified concept.

Returns a set of identifiers representing the child relationships of the
specified type of the specified concept.
sourceraw docstring

closeclj

(close svc)
source

compactclj

(compact root)
source

component-refset-idsclj

(component-refset-ids svc component-id)

Returns a collection of refset identifiers to which this concept is a member.

Returns a collection of refset identifiers to which this concept is a member.
sourceraw docstring

component-refset-itemsclj

(component-refset-items svc component-id)
(component-refset-items svc component-id refset-id)

Returns a sequence of refset items for the given component.

Returns a sequence of refset items for the given component.
sourceraw docstring

component-refset-items-extendedclj

(component-refset-items-extended svc component-id)
(component-refset-items-extended svc component-id refset-id)

Returns a sequence of refset items for the given component, supplemented with a map of extended attributes as defined by the refset descriptor

Returns a sequence of refset items for the given component, supplemented
with a map of extended attributes as defined by the refset descriptor
sourceraw docstring

conceptclj

(concept svc concept-id)

Return the concept with the specified identifier.

Return the concept with the specified identifier.
sourceraw docstring

concrete-valuesclj

(concrete-values svc concept-id)

Returns a sequence of concrete values for the given concept.

Returns a sequence of concrete values for the given concept.
sourceraw docstring

create-serviceclj

(create-service root import-from)

Create a terminology service combining both store and search functionality in a single step. It would be unusual to use this; usually each step would be performed interactively by an end-user.

Create a terminology service combining both store and search functionality
in a single step. It would be unusual to use this; usually each step would be
performed interactively by an end-user.
sourceraw docstring

descriptionclj

(description svc description-id)

Return the description with the specified identifier.

Return the description with the specified identifier.
sourceraw docstring

descriptionsclj

(descriptions svc concept-id)

Return a sequence of descriptions for the given concept.

Return a sequence of descriptions for the given concept.
sourceraw docstring

ecl-contains?cljdeprecated

(ecl-contains? svc concept-ids ecl)

DEPRECATED: use intersect-ecl instead.

Do any of the concept-ids satisfy the constraint expression specified? This is an alternative to expanding the valueset and then checking membership.

DEPRECATED: use [[intersect-ecl]] instead.

Do any of the concept-ids satisfy the constraint expression specified?
This is an alternative to expanding the valueset and then checking membership.
sourceraw docstring

expand-eclclj

(expand-ecl svc ecl)
(expand-ecl svc ecl max-hits)

Expand an ECL expression. Results are ordered iff max-hits is specified. It's usually more appropriate to use expand-ecl*.

Expand an ECL expression. Results are ordered iff max-hits is specified.
It's usually more appropriate to use [[expand-ecl*]].
sourceraw docstring

expand-ecl*clj

(expand-ecl* svc ecl language-refset-ids)

Expand an ECL expression returning only preferred descriptions for the language reference set(s) specified. Use match-locale to determine a set of language reference set ids for a given 'Accept-Language' language range as defined in RFC3066, or manually specify language reference set ids if required. In order to return a single term per concept, use a single language reference set. Also see expand-ecl and expand-ecl-historic.

Expand an ECL expression returning only preferred descriptions for the language reference set(s) specified.
Use [[match-locale]] to determine a set of language reference set ids for a given 'Accept-Language' language range
as defined in RFC3066, or manually specify language reference set ids if required. In order to return a single
term per concept, use a single language reference set. Also see [[expand-ecl]] and [[expand-ecl-historic]].
sourceraw docstring

expand-ecl-historicclj

(expand-ecl-historic svc ecl)

Expand an ECL expression and include historic associations of the results, so that the results will include now inactive/deprecated concept identifiers.

Expand an ECL expression and include historic associations of the results,
so that the results will include now inactive/deprecated concept identifiers.
sourceraw docstring

extended-conceptclj

(extended-concept svc concept-id)

Return an extended concept that includes the concept, its descriptions, its relationships and its refset memberships. See com.eldrix.hermes.snomed/ExtendedConcept:

  • :concept : the concept
  • :descriptions : a sequence of Description items
  • :parentRelationships : a map of relationship type to a set of concept ids
  • :directParentRelationships : as per :parentRelationships but only proximal
  • :concreteValues : a sequence of ConcreteValue items
  • :refsets : a set of reference set ids to which concept a member
Return an extended concept that includes the concept, its descriptions,
its relationships and its refset memberships. See
`com.eldrix.hermes.snomed/ExtendedConcept`:

- `:concept`             : the concept
- `:descriptions`        : a sequence of `Description` items
- `:parentRelationships` : a map of relationship type to a set of concept ids
- `:directParentRelationships` : as per :parentRelationships but only proximal
- `:concreteValues`      : a sequence of `ConcreteValue` items
- `:refsets`             : a set of reference set ids to which concept a member
sourceraw docstring

extended-refset-itemclj

(extended-refset-item svc item)

Merges a map of extended attributes to the specified reference set item. The attributes will be keyed based on information from the reference set descriptor information and known field names.

Merges a map of extended attributes to the specified reference set item.
The attributes will be keyed based on information from the reference set
descriptor information and known field names.
sourceraw docstring

fully-specified-nameclj

(fully-specified-name svc concept-id)
(fully-specified-name svc concept-id language-range)

Return the fully specified name for the concept specified. If no language preferences are provided the database default locale will be used.

Return the fully specified name for the concept specified. If no language
preferences are provided the database default locale will be used.
sourceraw docstring

get-reference-setscljdeprecated

(get-reference-sets svc component-id)

DEPRECATED: use component-refset-items instead.

DEPRECATED: use [[component-refset-items]] instead.
sourceraw docstring

get-statuscljdeprecated

(get-status
  root
  &
  {:keys [counts? installed-refsets? modules? log?]
   :or {counts? false installed-refsets? true modules? false log? true}})

Backwards-compatible status report. Use status instead. This flattens the component counts at the top-level to mimic legacy deprecated behaviour.

Backwards-compatible status report. Use [[status]] instead. This flattens the
component counts at the top-level to mimic legacy deprecated behaviour.
sourceraw docstring

historical-associationsclj

(historical-associations svc component-id)

Returns all historical-type associations for the specified component. Result is a map, keyed by the type of association (e.g. SAME-AS) and a sequence of reference set items for that association. Some concepts may be ambiguous and therefore map to multiple targets. Annoyingly, but understandably, the 'moved-to' reference set does not actually reference the new component - but the namespace to which it has moved - so for example an ancient International release may have accidentally including UK specific concepts - so they will have been removed. It is hoped that most MOVED-TO concepts will also have a SAME-AS or POSSIBLY-EQUIVALENT-TO historical association.

See https://confluence.ihtsdotools.org/display/DOCRELFMT/5.2.5.1+Historical+Association+Reference+Sets and https://confluence.ihtsdotools.org/display/editorialag/Component+Moved+Elsewhere

Note: Unlike some other functions that deal with historical associations, this returns the reference set items themselves and will include both active and inactive reference set items. Other functions usually only take into account active reference set items.

Returns all historical-type associations for the specified component.
Result is a map, keyed by the type of association (e.g. SAME-AS) and
a sequence of reference set items for that association. Some concepts
may be ambiguous and therefore map to multiple targets. Annoyingly, but
understandably, the 'moved-to' reference set does not actually reference
the new component - but the namespace to which it has moved - so for example
an ancient International release may have accidentally including UK specific
concepts - so they will have been removed. It is hoped that most MOVED-TO
concepts will also have a SAME-AS or POSSIBLY-EQUIVALENT-TO historical
association.

See https://confluence.ihtsdotools.org/display/DOCRELFMT/5.2.5.1+Historical+Association+Reference+Sets
and https://confluence.ihtsdotools.org/display/editorialag/Component+Moved+Elsewhere

Note: Unlike some other functions that deal with historical associations,
this returns the reference set items themselves and will include both active
*and* inactive reference set items. Other functions usually only take into
account *active* reference set items.
sourceraw docstring

history-profileclj

(history-profile svc profile)

Returns a set of reference sets matching the named profile. Use in conjunction with with-historical:

(with-historical svc [24700007] (history-profile :HISTORY-MIN)

See https://confluence.ihtsdotools.org/display/DOCECL/6.11+History+Supplements

Returns a set of reference sets matching the named profile. Use in
conjunction with [[with-historical]]:
```
(with-historical svc [24700007] (history-profile :HISTORY-MIN)
```
See https://confluence.ihtsdotools.org/display/DOCECL/6.11+History+Supplements
sourceraw docstring

import-snomedclj

(import-snomed root dirs)

Import SNOMED distribution files from the directories dirs specified into the database directory root specified.

Import is performed in three phases for each directory:

  1. import of core components and essential metadata, and
  2. interim indexing
  3. import of non-core and extension files.

Interim indexing is necessary in order to ensure correct reification in subsequent import(s).

Import SNOMED distribution files from the directories `dirs` specified into
the database directory `root` specified.

Import is performed in three phases for each directory:

  1. import of core components and essential metadata, and
  2. interim indexing
  3. import of non-core and extension files.

Interim indexing is necessary in order to ensure correct reification in
subsequent import(s).
sourceraw docstring

indexclj

(index root)

Build component and search indices for the database in directory 'root' specified.

Build component  and search indices for the database in directory 'root'
specified.
sourceraw docstring

installed-reference-setsclj

(installed-reference-sets svc)

Return a set of identifiers representing installed reference sets. Unlike simply using the SNOMED ontology to find all reference sets, this only returns reference sets with at least one installed member item.

Return a set of identifiers representing installed reference sets.
Unlike simply using the SNOMED ontology to find all reference sets, this only
returns reference sets with at least one installed member item.
sourceraw docstring

intersect-eclclj

(intersect-ecl svc concept-ids ecl)

Returns the subset of the concept identifiers that satisfy the SNOMED ECL expression.

Returns the subset of the concept identifiers that satisfy the SNOMED ECL
expression.
sourceraw docstring

log-metadataclj

(log-metadata dir)
source

map-concept-intoclj

(map-concept-into svc concept-id target)

Returns a set of concept identifiers representing the result of mapping a single concept into the target. For efficiency, it is almost always better to use map-into with a collection of identifiers, as the target will be then determined only once for all identifiers to be processed.

Returns a set of concept identifiers representing the result of mapping a
single concept into the target. For efficiency, it is almost always
better to use [[map-into]] with a collection of identifiers, as the `target`
will be then determined only once for all identifiers to be processed.
sourceraw docstring

map-featurescljdeprecated

(map-features svc source-concept-ids target)

DEPRECATED: Use map-into instead.

DEPRECATED: Use [[map-into]] instead.
sourceraw docstring

map-intoclj

(map-into svc source-concept-ids target)

Map the source-concept-ids into the target, usually in order to reduce the dimensionality of the dataset. Returns a sequence of sets of identifiers that are in the 'target'. The target can be a collection of identifiers, an ECL expression or, for convenience, an identifier representing a reference set. The latter two will be expanded into a set of identifiers.

Parameters:

  • svc : hermes service
  • source-concept-ids : a collection of concept identifiers
  • target : one of: - a collection of concept identifiers - an ECL expression - a refset identifier

If a source concept id resolves to multiple concepts in the target collection, then a collection will be returned such that no member of the subset is subsumed by another member.

Callers will usually need to map any source concept identifiers into their modern active replacements, if they are now inactive, as inactive source concepts do not have relationships that can be used to perform map-into.

The use of map-into is in reducing the granularity of user-entered data to aid analytics. For example, rather than limiting data entry to the UK emergency reference set, a set of commonly seen diagnoses in emergency departments in the UK, we can allow clinicians to enter highly specific, granular terms, and map to the contents of that reference set as required for analytics and reporting.

For example, '991411000000109' is the UK emergency unit diagnosis refset:

(map-into svc [24700007 763794005] 991411000000109)
     =>  (#{24700007} #{45170000})

As multiple sclerosis (24700007) is in the reference set, it is returned. However, LGI1-associated limbic encephalitis (763794005) is not in the reference set, the best terms are returned ("Encephalitis" - 45170000).

This can be used to do simple classification tasks - such as determining the broad types of illness. For example, here we use ECL to define a set to include 'neurological disease', 'respiratory disease' and 'infectious disease':

(map-into svc [24700007 763794005 95883001] "118940003 OR 50043002 OR 40733004")
    => (#{118940003} #{118940003} #{40733004 118940003})

Both multiple sclerosis and LGI-1 encephalitis are types of neurological disease (118940003). However, 'Bacterial meningitis' (95883001) is mapped to both 'neurological disease' (118940003) AND 'infectious disease' (40733004).

Map the source-concept-ids into the target, usually in order to reduce the
dimensionality of the dataset. Returns a sequence of sets of identifiers that
are in the 'target'. The target can be a collection of identifiers, an ECL
expression or, for convenience, an identifier representing a reference set.
The latter two will be expanded into a set of identifiers.

Parameters:

- `svc`                : hermes service
- `source-concept-ids` : a collection of concept identifiers
- `target`             : one of:
                         - a collection of concept identifiers
                         - an ECL expression
                         - a refset identifier

If a source concept id resolves to multiple concepts in the target collection,
then a collection will be returned such that no member of the subset is
subsumed by another member.

Callers will usually need to map any source concept identifiers into their
modern active replacements, if they are now inactive, as inactive source
concepts do not have relationships that can be used to perform `map-into`.

The use of `map-into` is in reducing the granularity of user-entered
data to aid analytics. For example, rather than limiting data entry to the UK
emergency reference set, a set of commonly seen diagnoses in emergency
departments in the UK, we can allow clinicians to enter highly specific,
granular terms, and map to the contents of that reference set as required
for analytics and reporting.

For example, '991411000000109' is the UK emergency unit diagnosis refset:
```
(map-into svc [24700007 763794005] 991411000000109)
     =>  (#{24700007} #{45170000})
```
As multiple sclerosis (24700007) is in the reference set, it is returned.
However, LGI1-associated limbic encephalitis (763794005) is not in the
reference set, the best terms are returned ("Encephalitis" - 45170000).

This can be used to do simple classification tasks - such as determining
the broad types of illness. For example, here we use ECL to define a set to
include 'neurological disease', 'respiratory disease' and
'infectious disease':

```
(map-into svc [24700007 763794005 95883001] "118940003 OR 50043002 OR 40733004")
    => (#{118940003} #{118940003} #{40733004 118940003})
```
Both multiple sclerosis and LGI-1 encephalitis are types of neurological
disease (118940003). However, 'Bacterial meningitis' (95883001) is mapped to
both 'neurological disease' (118940003) AND 'infectious disease' (40733004).
sourceraw docstring

match-localeclj

(match-locale svc)
(match-locale svc language-range)
(match-locale svc language-range fallback?)

Return an ordered sequence of refset ids that are the best match for the required language range, or the database default.

language-range should be a single string containing a list of comma-separated language ranges or a list of language ranges in the form of the "Accept-Language " header defined in RFC3066.

If the installed language reference sets are not matched by any of the languages in the list, and fallback? is true, then the database default locale will be used. With no fallback, no reference set identifiers will be returned, which may mean that locale-specific functions may return nil.

Return an ordered sequence of refset ids that are the best match for the
required language range, or the database default.

`language-range` should be a single string containing a list of
comma-separated language ranges or a list of language ranges in the form of
the "Accept-Language " header defined in RFC3066.

If the installed language reference sets are not matched by any of the
languages in the list, and `fallback?` is true, then the database default
locale will be used. With no fallback, no reference set identifiers will be
returned, which may mean that locale-specific functions may return nil.
sourceraw docstring

member-fieldclj

(member-field svc refset-id field s)

Returns a set of referenced component identifiers that are members of the given reference set with a matching value 's' for the 'field' specified. For example, to perform a reverse map from ICD-10:

(member-field svc 447562003 "mapTarget" "G35")
Returns a set of referenced component identifiers that are members of the
given reference set with a matching value 's' for the 'field' specified.
For example, to perform a reverse map from ICD-10:
```
(member-field svc 447562003 "mapTarget" "G35")
```
sourceraw docstring

member-field-prefixclj

(member-field-prefix svc refset-id field prefix)

Return a set of referenced component identifiers that are members of the given reference set with a matching 'prefix' for the 'field' specified. Example:

    (member-field-prefix svc 447562003 "mapTarget" "G3")
Return a set of referenced component identifiers that are members of the
given reference set with a matching 'prefix' for the 'field' specified.
Example:
```
    (member-field-prefix svc 447562003 "mapTarget" "G3")
```
sourceraw docstring

member-field-wildcardclj

(member-field-wildcard svc refset-id field s)

Return a set of referenced component identifiers that are members of the given reference set with a matching wildcard 'value' for the 'field' specified. Supported wildcards are *, which matches any character sequence (including the empty one), and ?, which matches any single character. '' is the escape character. Example:

    (member-field-wildcard svc 447562003 "mapTarget" "G3?")
Return a set of referenced component identifiers that are members of the
given reference set with a matching wildcard 'value' for the 'field'
specified. Supported wildcards are *, which matches any character sequence
(including the empty one), and ?, which matches any single character. '\' is
the escape character.
Example:
```
    (member-field-wildcard svc 447562003 "mapTarget" "G3?")
```
sourceraw docstring

module-dependenciesclj

(module-dependencies svc)

Returns a sequence of module dependencies, each item a map containing:

  • :source : source of the dependency (a map of :moduleId, :version)
  • :target : target on which the source depends (a map of :moduleId, :version)
  • :actual : actual version; may be nil
  • :valid : is this dependency satisfied and consistent?

Versions are represented as java.time.LocalDate. Dependencies are not transitive as per https://confluence.ihtsdotools.org/display/DOCRELFMT/5.2.4.2+Module+Dependency+Reference+Set

Returns a sequence of module dependencies, each item a map containing:

- `:source` : source of the dependency (a map of :moduleId, :version)
- `:target` : target on which the source depends (a map of :moduleId, :version)
- `:actual` : actual version; may be nil
- `:valid`  : is this dependency satisfied and consistent?

Versions are represented as `java.time.LocalDate`.
Dependencies are not transitive as per https://confluence.ihtsdotools.org/display/DOCRELFMT/5.2.4.2+Module+Dependency+Reference+Set
sourceraw docstring

module-dependencies*clj

(module-dependencies* items)

Given a collection of module dependency reference set items, return transformed as :source, :target, :actual and :valid representing module dependencies. Returns a sequence of:

  • :source : source of the dependency (a map of :moduleId, :version)
  • :target : target on which the source depends (a map of :moduleId, :version)
  • :actual : actual version; may be nil
  • :valid : is this dependency satisfied and consistent?

Versions are represented as java.time.LocalDate. Dependencies are not transitive as per https://confluence.ihtsdotools.org/display/DOCRELFMT/5.2.4.2+Module+Dependency+Reference+Set

Given a collection of module dependency reference set items, return
transformed as `:source`, `:target`, `:actual` and `:valid` representing
module dependencies. Returns a sequence of:

- `:source` : source of the dependency (a map of :moduleId, :version)
- `:target` : target on which the source depends (a map of :moduleId, :version)
- `:actual` : actual version; may be nil
- `:valid`  : is this dependency satisfied and consistent?

Versions are represented as `java.time.LocalDate`.
Dependencies are not transitive as per https://confluence.ihtsdotools.org/display/DOCRELFMT/5.2.4.2+Module+Dependency+Reference+Set
sourceraw docstring

module-dependency-problemsclj

(module-dependency-problems svc)

Returns a human-readable report of invalid dependencies and version mismatches.

Returns a human-readable report of invalid dependencies and version mismatches.
sourceraw docstring

mrcm-domainsclj

(mrcm-domains {:keys [store memberSearcher] :as svc})

Return a sequence of MRCM Domain reference set items for the given service. Each item essentially represents an 'MRCM domain'.

Return a sequence of MRCM Domain reference set items for the given service.
Each item essentially represents an 'MRCM domain'. 
sourceraw docstring

openclj

(open root)
(open root {:keys [quiet default-locale] :or {quiet false}})

Open a (read-only) SNOMED service from root, which should be anything coercible to a java.io.File. Use default-locale to set the default fallback locale for functions taking language preferences called without explicit priority lists, or when installed language reference sets don't support a requested language range.

Open a (read-only) SNOMED service from `root`, which should be anything
coercible to a `java.io.File`. Use `default-locale` to set the default
fallback locale for functions taking language preferences called without
explicit priority lists, or when installed language reference sets don't
support a requested language range.
sourceraw docstring

parent-relationshipsclj

(parent-relationships svc concept-id)

Returns a map of the parent relationships keyed by type.

Returns a map of the parent relationships keyed by type.
sourceraw docstring

parent-relationships-expandedclj

(parent-relationships-expanded svc concept-id)
(parent-relationships-expanded svc concept-id type-id)

Returns a map of the parent relationships, with each value a set of identifiers representing the targets and their transitive closure tables. This makes it trivial to build queries that find all concepts with, for example, a common finding site at any level of granularity.

Returns a map of the parent relationships, with each value a set of
identifiers representing the targets and their transitive closure tables. This
makes it trivial to build queries that find all concepts with, for example, a
common finding site at any level of granularity.
sourceraw docstring

parent-relationships-of-typeclj

(parent-relationships-of-type svc concept-id type-concept-id)

Returns a set of identifiers representing the parent relationships of the specified type of the specified concept.

Returns a set of identifiers representing the parent relationships of the
specified type of the specified concept.
sourceraw docstring

parse-expressionclj

(parse-expression _svc s)
source

paths-to-rootclj

(paths-to-root svc concept-id)

Return a sequence of paths from the concept to root node. Each path is a sequence of identifiers, starting with the concept itself and ending with the root node.

e.g.

(paths-to-root svc 24700007)
=>
((24700007 6118003 80690008 23853001 118940003 362965005 64572001 404684003 138875005)
 (24700007 6118003 80690008 23853001 246556002 404684003 138875005)
 (24700007 6118003 80690008 362975008 64572001 404684003 138875005)
 (24700007 39367000 23853001 118940003 362965005 64572001 404684003 138875005)
 (24700007 39367000 23853001 246556002 404684003 138875005)
 (24700007 39367000 363171009 362965005 64572001 404684003 138875005)
 (24700007 39367000 363171009 363170005 128139000 64572001 404684003 138875005)
 (24700007 414029004 64572001 404684003 138875005))
Return a sequence of paths from the concept to root node.
Each path is a sequence of identifiers, starting with the concept itself
and ending with the root node.

e.g.

```
(paths-to-root svc 24700007)
=>
((24700007 6118003 80690008 23853001 118940003 362965005 64572001 404684003 138875005)
 (24700007 6118003 80690008 23853001 246556002 404684003 138875005)
 (24700007 6118003 80690008 362975008 64572001 404684003 138875005)
 (24700007 39367000 23853001 118940003 362965005 64572001 404684003 138875005)
 (24700007 39367000 23853001 246556002 404684003 138875005)
 (24700007 39367000 363171009 362965005 64572001 404684003 138875005)
 (24700007 39367000 363171009 363170005 128139000 64572001 404684003 138875005)
 (24700007 414029004 64572001 404684003 138875005))
```
sourceraw docstring

pprint-propertiesclj

(pprint-properties svc props {:keys [key-fmt value-fmt fmt language-range]})

Pretty print properties. Keys and values can be formatted using fmt or separately using key-fmt and value-fmt. language-range should be a language range such as "en-GB". If language-range is omitted, or does not match any installed reference sets, the database default language range will be used instead.

Valid formats are:

formatdescription
:map-id-synmap of id to synonym
:vec-id-synvector of id and synonym
:str-id-synid and synonym as a string
:synsynonym
:idid

For example,

(pprint-properties svc (properties svc 1231295007) {:fmt :vec-id-syn})
=>
{0 {[116680003 "Is a"] [[779653004 "Lamotrigine only product in oral dose form"]],
    [411116001 "Has manufactured dose form"] [385060002 "Prolonged-release oral tablet"],
    [763032000 "Has unit of presentation"] [732936001 "Tablet"],
    [766939001 "Plays role"] [[773862006 "Anticonvulsant therapeutic role"]],
    [1142139005 "Count of base of active ingredient"] "#1"},
 1 {[732943007 "Has BoSS"] [387562000 "Lamotrigine"],
    [732945000 "Has presentation strength numerator unit"] [258684004 "mg"],
    [732947008 "Has presentation strength denominator unit"] [732936001 "Tablet"],
    [762949000 "Has precise active ingredient"] [387562000 "Lamotrigine"],
    [1142135004 "Has presentation strength numerator value"] "#250",
    [1142136003 "Has presentation strength denominator value"] "#1"}}
Pretty print properties. Keys and values can be formatted using `fmt` or
separately using `key-fmt` and `value-fmt`. `language-range` should be a
language range such as "en-GB". If `language-range` is omitted, or does not
match any installed reference sets, the database default language range will
be used instead.

Valid formats are:

| format        | description                  |
|---------------|------------------------------|
| `:map-id-syn` | map of id to synonym         |
| `:vec-id-syn` | vector of id and synonym     |
| `:str-id-syn` | id and synonym as a string   |
| `:syn`        | synonym                      |
| `:id`         | id                           |

For example,

```
(pprint-properties svc (properties svc 1231295007) {:fmt :vec-id-syn})
=>
{0 {[116680003 "Is a"] [[779653004 "Lamotrigine only product in oral dose form"]],
    [411116001 "Has manufactured dose form"] [385060002 "Prolonged-release oral tablet"],
    [763032000 "Has unit of presentation"] [732936001 "Tablet"],
    [766939001 "Plays role"] [[773862006 "Anticonvulsant therapeutic role"]],
    [1142139005 "Count of base of active ingredient"] "#1"},
 1 {[732943007 "Has BoSS"] [387562000 "Lamotrigine"],
    [732945000 "Has presentation strength numerator unit"] [258684004 "mg"],
    [732947008 "Has presentation strength denominator unit"] [732936001 "Tablet"],
    [762949000 "Has precise active ingredient"] [387562000 "Lamotrigine"],
    [1142135004 "Has presentation strength numerator value"] "#250",
    [1142136003 "Has presentation strength denominator value"] "#1"}}
```
sourceraw docstring

preferred-synonymclj

(preferred-synonym svc concept-id)
(preferred-synonym svc concept-id language-range)
(preferred-synonym svc concept-id language-range fallback?)

Return the preferred synonym for the concept based on the language preferences specified.

Use match-locale and then repeated calls to preferred-synonym* if preferred synonyms of a number of concepts are required (e.g. in a map/reduce etc)

Parameters:

  • svc : hermes service
  • concept-id : concept identifier
  • language-range : a single string containing a list of comma-separated language ranges or a list of language ranges in the form of the "Accept-Language " header defined in RFC3066.
  • fallback? : whether to fall back to database default language.

When fallback? is true, there will always be a result for every concept.

Return the preferred synonym for the concept based on the language
preferences specified.

Use [[match-locale]] and then repeated calls to [[preferred-synonym*]] if
preferred synonyms of a number of concepts are required (e.g. in a map/reduce etc)

Parameters:

- `svc`            : hermes service
- `concept-id`     : concept identifier
- `language-range` : a single string containing a list of comma-separated
                   language ranges or a list of language ranges in the form of
                   the "Accept-Language " header defined in RFC3066.
- `fallback?`      : whether to fall back to database default language.

When `fallback?` is true, there will *always* be a result for every concept.
sourceraw docstring

preferred-synonym*clj

(preferred-synonym* svc concept-id language-refset-ids)

Given an ordered sequence of preferred language reference set ids, return the preferred synonym for the concept specified.

Given an ordered sequence of preferred language reference set ids, return
the preferred synonym for the concept specified.
sourceraw docstring

propertiesclj

(properties svc concept-id)
(properties svc concept-id {:keys [expand]})

Returns a concept's properties, including concrete values. Ungrouped properties are returned under key '0', with other groups returned with non-zero keys. There is no other intrinsic meaning to the group identifier.

Attribute values will be returned as a set of values optionally expanded to include the transitive relationships. If the value for the attribute is a concrete value or the SNOMED machine-readable concept model (MRCM) for the attribute in the context of the concept's domain states that the cardinality of the property is 0..1 or 1..1 and the values are not expanded to include transitive dependencies, the value will be unwrapped to a single value.

e.g. for lamotrigine:

(properties svc (properties svc 1231295007))
=>
{0 {116680003 #{779653004}, 411116001 385060002, 763032000 732936001,
    766939001 #{773862006}, 1142139005 "#1"},
 1 {732943007 387562000, 732945000 258684004, 732947008 732936001,
    762949000 387562000, 1142135004 "#250", 1142136003 "#1"}}

See https://confluence.ihtsdotools.org/display/DOCRELFMT/4.2.3+Relationship+File+Specification

"The relationshipGroup field is used to group relationships with the same sourceId field into one or more logical sets. A relationship with a relationshipGroup field value of '0' is considered not to be grouped. All relationships with the same sourceId and non-zero relationshipGroup are considered to be logically grouped."

Returns a concept's properties, including concrete values. Ungrouped
properties are returned under key '0', with other groups returned with
non-zero keys. There is no other intrinsic meaning to the group identifier.

Attribute values will be returned as a set of values optionally expanded to
include the transitive relationships. If the value for the attribute is a
concrete value or the SNOMED machine-readable concept model (MRCM) for the
attribute in the context of the concept's domain states that the cardinality
of the property is 0..1 or 1..1 and the values are not expanded to include
transitive dependencies, the value will be unwrapped to a single value.

e.g. for lamotrigine:
```
(properties svc (properties svc 1231295007))
=>
{0 {116680003 #{779653004}, 411116001 385060002, 763032000 732936001,
    766939001 #{773862006}, 1142139005 "#1"},
 1 {732943007 387562000, 732945000 258684004, 732947008 732936001,
    762949000 387562000, 1142135004 "#250", 1142136003 "#1"}}
```
See https://confluence.ihtsdotools.org/display/DOCRELFMT/4.2.3+Relationship+File+Specification
>  "The relationshipGroup field is used to group relationships with the same
>  sourceId field into one or more logical sets. A relationship with a
>  relationshipGroup field value of '0' is considered not to be grouped. All
>  relationships with the same sourceId and non-zero relationshipGroup are
>  considered to be logically grouped."
sourceraw docstring

refset-descriptor-attribute-idsclj

(refset-descriptor-attribute-ids svc refset-id)

Return a vector of attribute description concept ids for the given reference set.

Return a vector of attribute description concept ids for the given reference
set.
sourceraw docstring

refset-itemclj

(refset-item svc uuid)

Return a specific refset item by UUID.

Return a specific refset item by UUID.
sourceraw docstring

refset-membersclj

(refset-members svc refset-id & more)

Return a set of identifiers for the members of the given refset(s).

Parameters:

  • refset-id - SNOMED identifier representing the reference set.
Return a set of identifiers for the members of the given refset(s).

Parameters:
- refset-id  - SNOMED identifier representing the reference set.
sourceraw docstring

relationshipclj

(relationship svc relationship-id)

Return the relationship with the specified identifier.

Return the relationship with the specified identifier.
sourceraw docstring

release-informationclj

(release-information svc)

Returns descriptions representing the installed distributions. Ordering will be by date except that the description for the 'core' module will always be first. See https://confluence.ihtsdotools.org/display/DOCTIG/4.1.+Root+and+top-level+Concepts

Returns descriptions representing the installed distributions.
Ordering will be by date except that the description for the 'core' module
will always be first.
See https://confluence.ihtsdotools.org/display/DOCTIG/4.1.+Root+and+top-level+Concepts
sourceraw docstring

reverse-mapclj

(reverse-map svc refset-id code)

Returns a sequence of reference set items representing the reverse mapping from the reference set and mapTarget specified. It's almost always better to use member-field or member-field-prefix directly.

A code in a target codesystem may map to multiple concepts. Each concept may map to multiple codes in that target codesystem. reverse-map-prefix returns only results that would meet the original criteria. This mimics the original behaviour of an older implementation and should be regarded as semi-deprecated. For more control, use member-field.

Returns a sequence of reference set items representing the reverse mapping
from the reference set and mapTarget specified. It's almost always better to
use [[member-field]] or [[member-field-prefix]] directly.

A code in a target codesystem may map to multiple concepts. Each concept may
map to multiple codes in that target codesystem. [[reverse-map-prefix]] returns
only results that would meet the original criteria. This mimics the original
behaviour of an older implementation and should be regarded as semi-deprecated.
For more control, use [[member-field]].
sourceraw docstring

reverse-map-prefixclj

(reverse-map-prefix svc refset-id prefix)

Returns a sequence of reference set items representing the reverse mapping from the reference set and mapTarget. It is almost always better to use member-field or member-field-prefix directly.

A code in a target codesystem may map to multiple concepts. Each concept may map to multiple codes in that target codesystem. reverse-map-prefix returns only results that would meet the original criteria. This mimics the original behaviour of an older implementation and should be regarded as semi-deprecated. For more control, use member-field-prefix.

Returns a sequence of reference set items representing the reverse mapping
from the reference set and mapTarget. It is almost always better to use
[[member-field]] or [[member-field-prefix]] directly.

A code in a target codesystem may map to multiple concepts. Each concept may
map to multiple codes in that target codesystem. `reverse-map-prefix` returns
only results that would meet the original criteria. This mimics the original
behaviour of an older implementation and should be regarded as semi-deprecated.
For more control, use [[member-field-prefix]].
sourceraw docstring

(search svc params)

Perform a search against the index.

Parameters:

  • svc : hermes service
  • params : a map of search parameters, which include:
keyworddescription
:ssearch string
:max-hitsmaximum hits (see note below)
:constraintSNOMED ECL constraint
:fuzzyfuzziness (0-2, default 0)
:fallback-fuzzyif no results, try fuzzy search (0-2, default 0).
:remove-duplicates?remove duplicate results (default, false)
:accept-languagelocales for preferred synonyms in results
`:language-refset-idslanguages for preferred synonyms in results

If max-hits is omitted, search will return unlimited unsorted results.

Example: to search for neurologist as an occupation ('IS-A' '14679004')

 (do-search searcher {:s "neurologist" :constraint "<14679004"})

For autocompletion, it is recommended to use fuzzy=0, and fallback-fuzzy=2.

There are some lower-level search parameters available, but it is usually more appropriate to use a SNOMED ECL constraint instead of these.

keyworddescription
:queryadditional Lucene Query to apply
:show-fsn?show FSNs in results?
:inactive-concepts?search descriptions of inactive concepts?
:inactive-descriptions?search inactive descriptions?
:propertiesa map of properties and their possible values.
:concept-refsetsa collection of refset ids to limit search

By default, :show-fsn? and :inactive-concepts? are false, while :inactive-descriptions? is true.

The properties map contains keys for a property and then either a single identifier or vector of identifiers to limit search. For example

 (search searcher {:s "neurologist" :properties {snomed/IsA [14679004]}})

However, concrete values are not supported, so to search using concrete values use a SNOMED ECL constraint instead.

A FSN is a fully-specified name and should generally be left out of search.

Perform a search against the index.

Parameters:
- svc    : hermes service
- params : a map of search parameters, which include:

| keyword               | description                                       |
|-----------------------|---------------------------------------------------|
| `:s`                  | search string                                     |
| `:max-hits`           | maximum hits (see note below)                     |
| `:constraint`         | SNOMED ECL constraint                             |
| `:fuzzy`              | fuzziness (0-2, default 0)                        |
| `:fallback-fuzzy`     | if no results, try fuzzy search (0-2, default 0). |
| `:remove-duplicates?` | remove duplicate results (default, false)         |
| `:accept-language`    | locales for preferred synonyms in results         |
| `:language-refset-ids | languages for preferred synonyms in results       |

If `max-hits` is omitted, search will return unlimited *unsorted* results.

Example: to search for neurologist as an occupation ('IS-A' '14679004')
```
 (do-search searcher {:s "neurologist" :constraint "<14679004"})
```
For autocompletion, it is recommended to use `fuzzy=0`, and `fallback-fuzzy=2`.

There are some lower-level search parameters available, but it is usually
more appropriate to use a SNOMED ECL constraint instead of these.

| keyword                   | description                                    |
|---------------------------|------------------------------------------------|
| `:query`                  | additional Lucene `Query` to apply             |
| `:show-fsn?`              | show FSNs in results?                          |
| `:inactive-concepts?`     | search descriptions of inactive concepts?      |
| `:inactive-descriptions?` | search inactive descriptions?                  |
| `:properties`             | a map of properties and their possible values. |
| `:concept-refsets`        | a collection of refset ids to limit search     |

By default, `:show-fsn?` and `:inactive-concepts?` are `false`, while
`:inactive-descriptions?` is `true`.

The properties map contains keys for a property and then either a single
identifier or vector of identifiers to limit search.
For example
```
 (search searcher {:s "neurologist" :properties {snomed/IsA [14679004]}})
```
However, concrete values are not supported, so to search using concrete values
use a SNOMED ECL constraint instead.

A FSN is a fully-specified name and should generally be left out of search.
sourceraw docstring

search-concept-idsclj

(search-concept-ids svc)
(search-concept-ids svc
                    {:keys [language-refset-ids accept-language language-range
                            fallback?]
                     :or {fallback? true}})
(search-concept-ids svc
                    {:keys [language-refset-ids accept-language language-range
                            fallback?]
                     :or {fallback? true}}
                    concept-ids)

Return search results containing the preferred descriptions of the concepts specified. Returns a transducer if no concept ids are specified. If a preferred description cannot be found for the locale specified, nil will be returned in the results unless fallback? is true, in which case the default fallback locale will be used.

Parameters: |- svc : service |- options : a map | |- :language-refset-ids | | A collection of reference set ids for the preferred language(s). |- |- :accept-language | | A single string containing a list of comma-separated language ranges | | or a list of language ranges in the form of the "Accept-Language" | | header as per RFC3066 | |- :fallback? (default true) | | Fallback to database default fallback locale if explicit language | | preference not available in installed reference sets |- concept-ids : a collection of concept identifiers.

For backwards compatibilty, :language-range can be used instead of :accept-language.

Return search results containing the preferred descriptions of the concepts
specified. Returns a transducer if no concept ids are specified. If a
preferred description cannot be found for the locale specified, `nil` will be
returned in the results unless `fallback?` is true, in which case the default
fallback locale will be used.

Parameters:
|- svc            : service
|- options        : a map
|  |- :language-refset-ids
|  |      A collection of reference set ids for the preferred language(s).
|- |- :accept-language
|  |      A single string containing a list of comma-separated language ranges
|  |      or a list of language ranges in the form of the "Accept-Language"
|  |      header as per RFC3066
|  |- :fallback? (default true)
|  |      Fallback to database default fallback locale if explicit language
|  |      preference not available in installed reference sets
|- concept-ids    : a collection of concept identifiers.

For backwards compatibilty, `:language-range` can be used instead of
`:accept-language`.
sourceraw docstring

some-indexedclj

(some-indexed pred coll)

Returns index and first logical true value of (pred x) in coll, or nil.

e.g.

(some-indexed #{64572001} '(385093006 233604007 205237003 363169009 363170005 123946008 64572001 404684003 138875005))

returns: [6 664572001]

Returns index and first logical true value of (pred x) in coll, or nil.

e.g.
```
(some-indexed #{64572001} '(385093006 233604007 205237003 363169009 363170005 123946008 64572001 404684003 138875005))
```
returns: `[6 664572001]`
sourceraw docstring

source-historicalclj

(source-historical svc component-id)
(source-historical svc component-id refset-ids)

Return the requested historical associations for the component of types as defined by refset-ids, or all association refsets if omitted.

Return the requested historical associations for the component of types as
defined by refset-ids, or all association refsets if omitted.
sourceraw docstring

source-historical-associationsclj

(source-historical-associations svc component-id)

Returns all historical-type associations in which the specified component is the target. For example, searching for 24700007 will result in a map keyed by refset-id (e.g. SAME-AS reference set) and a set of concept identifiers.

Returns all historical-type associations in which the specified component is
the target. For example, searching for `24700007` will result in a map keyed
by refset-id (e.g. `SAME-AS` reference set) and a set of concept identifiers.
sourceraw docstring

statusclj

(status root)
(status root {:keys [log?] :as opts})

Return status information for the database at 'root' where root is something coercible to java.io.File. This is a convenience wrapper for status* that opens and closes the service for you.

Return status information for the database at 'root' where `root` is
something coercible to `java.io.File`. This is a convenience wrapper for
[[status*]] that opens and closes the service for you.
sourceraw docstring

status*clj

(status* svc
         {:keys [counts? modules? installed-refsets?]
          :or {counts? true installed-refsets? false modules? false}})

Return status information for the given service. Returns a map containing:

  • :releases : a sequence of strings for installed distributions
  • :locales : installed/supported locales
  • :components : a map of component counts and indices
  • :modules : a map of module id to term, for installed modules
  • :installed-refsets : a map of reference set id to term

What is returned is configurable using options:

  • :counts? : whether to include counts of components
  • :modules? : whether to include installed modules
  • :installed-refsets? : whether to include installed reference sets
Return status information for the given service. Returns a map containing:

- `:releases`          : a sequence of strings for installed distributions
- `:locales`           : installed/supported locales
- `:components`        : a map of component counts and indices
- `:modules`           : a map of module id to term, for installed modules
- `:installed-refsets` : a map of reference set id to term

What is returned is configurable using options:

- `:counts?`            : whether to include counts of components
- `:modules?`           : whether to include installed modules
- `:installed-refsets?` : whether to include installed reference sets
sourceraw docstring

stream-all-conceptsclj

(stream-all-concepts svc ch)
(stream-all-concepts svc ch close?)

Streams all concepts on the channel specified. By default, closing the channel when done. Blocking, so run in a background thread.

Streams all concepts on the channel specified. By default, closing the
channel when done. Blocking, so run in a background thread.
sourceraw docstring

subsumed-by?clj

(subsumed-by? svc concept-id subsumer-concept-id)

Is concept-id subsumed by subsumer-concept-id?

Is `concept-id` subsumed by `subsumer-concept-id`?
sourceraw docstring

synonymsclj

(synonyms svc concept-id)
(synonyms svc concept-id language-refset-ids)

Returns a sequence of synonyms for the given concept. If language-refset-ids is provided, then only synonyms that are preferred or acceptable in those reference sets are returned.

Returns a sequence of synonyms for the given concept. If language-refset-ids
is provided, then only synonyms that are preferred or acceptable in those
reference sets are returned.
sourceraw docstring

transitive-synonymsclj

(transitive-synonyms svc params)

Returns all synonyms of the specified concepts, including those of its descendants.

Parameters:

  • svc : hermes service

  • params : search parameters to select concepts; one of:

      - a map        : search parameters as per [[search]]
      - a string     : a string containing an ECL expression
      - a collection : a collection of concept identifiers
    
Returns all synonyms of the specified concepts, including those of its
descendants.

Parameters:
- svc    : hermes service
- params : search parameters to select concepts; one of:

        - a map        : search parameters as per [[search]]
        - a string     : a string containing an ECL expression
        - a collection : a collection of concept identifiers
sourceraw docstring

valid-ecl?clj

(valid-ecl? s)

Is the ECL valid? This does not attempt to expand the ECL, but simply checks that it is valid ECL according to the grammar.

Is the ECL valid?
This does not attempt to expand the ECL, but simply checks that it is valid
ECL according to the grammar.
sourceraw docstring

with-historicalclj

(with-historical svc concept-ids)
(with-historical svc concept-ids refset-ids)

For a given sequence of concept identifiers, expand to include historical associations both backwards and forwards in time.

For a currently active concept, this will return historic inactivated concepts in which it is the target. For a now inactive concept, this will return the active associations and their historic associations.

By default, all types of historical associations except MoveTo and MovedFrom are included, but this is configurable.

For a given sequence of concept identifiers, expand to include historical
associations both backwards and forwards in time.

For a currently active concept, this will return historic inactivated concepts
in which it is the target. For a now inactive concept, this will return the
active associations and their historic associations.

By default, all types of historical associations except MoveTo and MovedFrom
are included, but this is configurable. 
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close