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.
(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.
(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.
(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).
DEPRECATED. Use transitive-synonyms
instead.
DEPRECATED. Use [[transitive-synonyms]] instead.
(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.
DEPRECATED: Use build-search-indices
instead
DEPRECATED: Use [[build-search-indices]] instead
DEPRECATED: Use [[build-indices]] instead
DEPRECATED: Use [[build-indices]] instead
(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.
(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.
(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.
(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
(concept svc concept-id)
Return the concept with the specified identifier.
Return the concept with the specified identifier.
(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.
(create-service root import-from)
(create-service root import-from locale-preference-string)
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.
(description svc description-id)
Return the description with the specified identifier.
Return the description with the specified identifier.
(descriptions svc concept-id)
Return a sequence of descriptions for the given concept.
Return a sequence of descriptions for the given concept.
(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.
(expand-ecl svc ecl)
(expand-ecl svc ecl max-hits)
Expand an ECL expression.
Expand an ECL expression.
(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.
(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]]
Return an extended concept that includes the concept, its descriptions, its relationships and its refset memberships. See [[com.eldrix.hermes.snomed/ExtendedConcept]]
(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.
(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 system default locale will be used.
Return the fully specified name for the concept specified. If no language preferences are provided the system default locale will be used.
DEPRECATED. Use all-children
instead.
DEPRECATED. Use [[all-children]] instead.
DEPRECATED. Use all-parents
instead.
DEPRECATED. Use [[all-parents]] instead.
DEPRECATED. Use child-relationships-of-type
instead.
DEPRECATED. Use [[child-relationships-of-type]] instead.
DEPRECATED. Use component-refset-ids
instead.
DEPRECATED. Use [[component-refset-ids]] instead.
DEPRECATED. Use component-refset-items
instead.
DEPRECATED. Use [[component-refset-items]] instead.
DEPRECATED. Use component-refset-items-extended
instead.
DEPRECATED. Use [[component-refset-items-extended]] instead.
DEPRECATED. Use concept
instead
DEPRECATED. Use [[concept]] instead
DEPRECATED. Use description
instead.
DEPRECATED. Use [[description]] instead.
DEPRECATED. Use descriptions
instead.
DEPRECATED. Use [[descriptions]] instead.
DEPRECATED. Use extended-concept
instead.
DEPRECATED. Use [[extended-concept]] instead.
DEPRECATED. Use fully-specified-name
instead.
DEPRECATED. Use [[fully-specified-name]] instead.
DEPRECATED. Use installed-reference-sets
instead.
DEPRECATED. Use [[installed-reference-sets]] instead.
DEPRECATED. Use parent-relationships
instead.
DEPRECATED. Use [[parent-relationships]] instead.
DEPRECATED. Use parent-relationships-expanded
instead.
DEPRECATED. Use [[parent-relationships-expanded]] instead.
DEPRECATED. Use parent-relationships-of-type
instead.
DEPRECATED. Use [[parent-relationships-of-type]] instead.
DEPRECATED. Use preferred-synonym
instead.
DEPRECATED. Use [[preferred-synonym]] instead.
(get-reference-sets svc component-id)
DEPRECATED: use get-component-refset-items
instead.
DEPRECATED: use [[get-component-refset-items]] instead.
DEPRECATED. Use refset-descriptor-attribute-ids
instead.
DEPRECATED. Use [[refset-descriptor-attribute-ids]] instead.
DEPRECATED. Use refset-item
instead.
DEPRECATED. Use [[refset-item]] instead.
DEPRECATED. Use refset-members
instead.
DEPRECATED. Use [[refset-members]] instead.
DEPRECATED. Use relationship
instead.
DEPRECATED. Use [[relationship]] instead.
DEPRECATED. Use release-information
instead.
DEPRECATED. Use [[release-information]] instead.
(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.
DEPRECATED. Use synonyms
instead.
DEPRECATED. Use [[synonyms]] instead.
(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.
(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
(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:
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).
(index root)
(index root language-priority-list)
Build search indices for the database in directory 'root' specified.
Build search indices for the database in directory 'root' specified.
(installed-reference-sets svc)
Return a set of identifiers representing installed reference sets.
Return a set of identifiers representing installed reference sets.
(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.
(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.
(map-features svc source-concept-ids target)
DEPRECATED: Use map-into
instead.
DEPRECATED: Use [[map-into]] instead.
(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:
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).
(match-locale svc language-range)
Return an ordered sequence of refset ids that are the best match for the
required language range. 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.
Return an ordered sequence of refset ids that are the best match for the required language range. `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.
(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' 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' for the 'field' specified. For example, to perform a reverse map from ICD-10: ``` (member-field svc 447562003 "mapTarget" "G35") ```
(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 'value' 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 'value' for the 'field' specified. Example: ``` (member-field-prefix svc 447562003 "mapTarget" "G3") ```
(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?") ```
(module-dependencies svc)
Returns a sequence of module dependencies, containing:
Returns a sequence of module dependencies, 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]].
(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:
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]].
(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.
(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'.
(open root)
(open root {:keys [quiet] :or {quiet false}})
Open a (read-only) SNOMED service from root
, which should be anything
coercible to a java.io.File
Open a (read-only) SNOMED service from `root`, which should be anything coercible to a `java.io.File`
(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.
(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.
(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.
(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)) ```
(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
.
Valid formats are:
: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
language-range
should be a language range such as "en-GB".
Pretty print properties. Keys and values can be formatted using `fmt` or separately using `key-fmt` and `value-fmt`. Valid formats are: :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 `language-range` should be a language range such as "en-GB".
(preferred-synonym svc concept-id)
(preferred-synonym svc concept-id language-range)
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:
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.
(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.
(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."
(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.
(refset-item svc uuid)
Return a specific refset item by UUID.
Return a specific refset item by UUID.
(refset-members svc refset-id & more)
Return a set of identifiers for the members of the given refset(s).
Parameters:
Return a set of identifiers for the members of the given refset(s). Parameters: - refset-id - SNOMED identifier representing the reference set.
(relationship svc relationship-id)
Return the relationship with the specified identifier.
Return the relationship with the specified identifier.
(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
(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]].
(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]].
(search svc params)
Perform a search against the index.
Parameters:
keyword | description (default) |
---|---|
:s | search string to use |
:max-hits | maximum hits (if omitted returns unlimited but |
unsorted results) | |
: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) |
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 (default) |
---|---|
:query | additional Lucene ^Query to apply |
:show-fsn? | show FSNs in results? (default, false) |
:inactive-concepts? | search descriptions of inactive concepts? (false) |
:inactive-descriptions? | search inactive descriptions? (default, true) |
:properties | a map of properties and their possible values. |
:concept-refsets | a collection of refset ids to limit search |
The properties map contains keys for a property and then either a single identifier or vector of identifiers to limit search. For example
(do-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 (default) | |--------------------- |---------------------------------------------------| | :s | search string to use | | :max-hits | maximum hits (if omitted returns unlimited but | | | *unsorted* results) | | :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) | 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 (default) | |--------------------- |---------------------------------------------------| | :query | additional Lucene ^Query to apply | | :show-fsn? | show FSNs in results? (default, false) | | :inactive-concepts? | search descriptions of inactive concepts? (false) | | :inactive-descriptions? | search inactive descriptions? (default, true) | | :properties | a map of properties and their possible values. | | :concept-refsets | a collection of refset ids to limit search | The properties map contains keys for a property and then either a single identifier or vector of identifiers to limit search. For example ``` (do-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.
(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]`
(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.
(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.
(status root)
(status root {:keys [log?] :as opts})
Return status information for the database at 'root'.
Return status information for the database at 'root'.
(status* svc
{:keys [counts? modules? installed-refsets?]
:or {counts? true installed-refsets? false modules? false}})
(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.
(subsumed-by? svc concept-id subsumer-concept-id)
Is concept-id
subsumed by subsumer-concept-id
?
Is `concept-id` subsumed by `subsumer-concept-id`?
(synonyms svc concept-id)
Returns a sequence of synonyms for the given concept.
Returns a sequence of synonyms for the given concept.
(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
(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.
(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.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close