Store provides access to a key value store.
Store provides access to a key value store.
(all-transitive-synonyms store concept-id)
(all-transitive-synonyms store concept-id {:keys [include-inactive?]})
Returns all of the synonyms of the specified concept, including those of its descendants.
Returns all of the synonyms of the specified concept, including those of its descendants.
(get-all-children store concept-id)
(get-all-children store concept-id type-id)
Returns all child concepts for the concept. It takes 3500 milliseconds on my 2013 laptop to return all child concepts of the root SNOMED CT concept, so this should only be used for more granular concepts generally, or used asynchronously / via streaming. Parameters:
concept-id
type-id
, defaults to 'IS-A' (116680003).Returns all child concepts for the concept. It takes 3500 milliseconds on my 2013 laptop to return all child concepts of the root SNOMED CT concept, so this should only be used for more granular concepts generally, or used asynchronously / via streaming. Parameters: - store - `concept-id` - `type-id`, defaults to 'IS-A' (116680003).
(get-all-parents store concept-id)
(get-all-parents store concept-id type-id)
Returns all parent concepts for the concept, including self. Parameters:
store
the MapDBStoreconcept-id
type-id
, defaults to 'IS-A' (116680003).Returns all parent concepts for the concept, including self. Parameters: - `store` the MapDBStore - `concept-id` - `type-id`, defaults to 'IS-A' (116680003).
(get-child-relationships-of-type store concept-id type-concept-id)
Returns a collection of identifiers representing the parent relationships of the specified type of the specified concept.
Returns a collection of identifiers representing the parent relationships of the specified type of the specified concept.
(get-component-refset-items store component-id)
(get-component-refset-items store component-id refset-id)
Get the refset items for the given component, optionally limited to the refset specified.
Get the refset items for the given component, optionally limited to the refset specified. - store : MapDBStore - component-id : id of the component (e.g concept-id or description-id) - refset-id : (optional) - limit to this refset.
(get-component-refsets store component-id)
Return the refset-id's to which this component belongs.
Return the refset-id's to which this component belongs.
(get-concept store concept-id)
Returns the concept specified.
Returns the concept specified.
(get-concept-descriptions store concept-id)
Return the descriptions for the concept specified.
Return the descriptions for the concept specified.
(get-description store description-id)
Return the description with the given description-id
.
This uses the descriptionId-conceptId index to determine the concept-id,
as all descriptions are actually stored by conceptId-descriptionId-concept because
that's a more common operation that finding a description by identifier alone.
Return the description with the given `description-id`. This uses the descriptionId-conceptId index to determine the concept-id, as all descriptions are actually stored by conceptId-descriptionId-concept because that's a more common operation that finding a description by identifier alone.
(get-description-refsets store description-id)
Get the refsets and language applicability for a description. Returns a map containing:
Example: (map #(merge % (get-description-refsets store (:id %))) (get-concept-descriptions store 24700007))
Get the refsets and language applicability for a description. Returns a map containing: - refsets : a set of refsets to which this description is a member - preferredIn : refsets for which this description is preferred - acceptableIn : refsets for which this description is acceptable. Example: (map #(merge % (get-description-refsets store (:id %))) (get-concept-descriptions store 24700007))
(get-fully-specified-name store concept-id)
(get-fully-specified-name store concept-id language-refset-ids fallback?)
Return the fully specified name for the concept specified. If no language preferences are provided the first
description of type FSN will be returned. If language preferences are provided, but there is no
match and fallback?
is true, then the first description of type FSN will be returned.
Return the fully specified name for the concept specified. If no language preferences are provided the first description of type FSN will be returned. If language preferences are provided, but there is no match *and* `fallback?` is true, then the first description of type FSN will be returned.
(get-grouped-properties store concept-id)
(get-grouped-properties store concept-id type-id)
Return a concept's properties as a collection of maps, each map representing related properties in a 'relationshipGroup'. By default, all groups are returned, but this can optionally be limited to those containing a specific relationship type.
Return a concept's properties as a collection of maps, each map representing related properties in a 'relationshipGroup'. By default, all groups are returned, but this can optionally be limited to those containing a specific relationship type.
(get-installed-reference-sets store)
Returns the installed reference sets. While it is possible to use the SNOMED ontology to find all reference sets:
(get-leaves store (get-all-children store 900000000000455006))
This will return reference sets with no actual members in the installed edition. Instead, we keep track of installed reference sets as we import reference set items, thus ensuring we have a list that contains only reference sets with members.
Returns the installed reference sets. While it is possible to use the SNOMED ontology to find all reference sets: ``` (get-leaves store (get-all-children store 900000000000455006)) ``` This will return reference sets with no actual members in the installed edition. Instead, we keep track of installed reference sets as we import reference set items, thus ensuring we have a list that contains only reference sets with members.
(get-leaves store concept-ids)
Returns the subset of the specified concept-ids
such that no member of the subset is subsumed by another member.
Parameters:
Returns the subset of the specified `concept-ids` such that no member of the subset is subsumed by another member. Parameters: - concept-ids : a collection of concept identifiers
(get-parent-relationships store concept-id)
Returns the parent relationships of the specified concept. Returns a map key: concept-id of the relationship type (e.g. identifier representing finding site) value: a set of concept identifiers for that property.
See get-parent-relationships-expanded to get each target expanded via transitive closure tables.
Returns the parent relationships of the specified concept. Returns a map key: concept-id of the relationship type (e.g. identifier representing finding site) value: a set of concept identifiers for that property. See get-parent-relationships-expanded to get each target expanded via transitive closure tables.
(get-parent-relationships-expanded store concept-id)
Returns all of the parent relationships, expanded to include each target's transitive closure table. This makes it trivial to build queries that find all concepts with, for example, a common finding site at any level of granularity.
Returns all of the parent relationships, expanded to include each target's transitive closure table. This makes it trivial to build queries that find all concepts with, for example, a common finding site at any level of granularity.
(get-parent-relationships-of-type store concept-id type-concept-id)
Returns a collection of identifiers representing the parent relationships of the specified type of the specified concept.
Returns a collection of identifiers representing the parent relationships of the specified type of the specified concept.
(get-parent-relationships-of-types store concept-id type-concept-ids)
(get-preferred-description store
concept-id
description-type-id
language-refset-id)
Return the preferred description for the concept specified as defined by the language reference set specified for the description type.
Possible description-type-ids: 900000000000013009: synonym (core metadata concept) 900000000000003001: fully specified name
Example language-refset-ids: 900000000000509007: US English language reference set 999001261000000100: UK English (clinical) language reference set.
Return the preferred description for the concept specified as defined by the language reference set specified for the description type. - store : - concept-id : - description-type-id : type of description (e.g. synonym or FSN) - language-refset-id : language reference set Possible description-type-ids: 900000000000013009: synonym (core metadata concept) 900000000000003001: fully specified name Example language-refset-ids: 900000000000509007: US English language reference set 999001261000000100: UK English (clinical) language reference set.
(get-preferred-fully-specified-name store concept-id language-refset-ids)
(get-preferred-synonym store concept-id language-refset-ids)
Returns the preferred synonym for the concept specified, looking in the language reference sets specified in order, returning the first 'preferred' value. The ordering of the reference set identifiers is therefore significant.
Notes: We have a frustrating situation in that there are three language reference sets in the UK that might give a 'good' answer to the 'preferred' description for any given concept. 900000000000508004 : Great Britain English language reference set 999001261000000100 : NHS realm language (clinical part) 999000691000001104 : NHS Realm language (pharmacy part) (supercedes the old dm+d realm subset 30001000001134). This means that we need to be able to submit multiple language reference set identifiers.
Returns the preferred synonym for the concept specified, looking in the language reference sets specified in order, returning the first 'preferred' value. The ordering of the reference set identifiers is therefore significant. - store : store - concept-id : concept-id - language-refset-ids : an ordered list of language reference set identifiers Notes: We have a frustrating situation in that there are three language reference sets in the UK that might give a 'good' answer to the 'preferred' description for any given concept. 900000000000508004 : Great Britain English language reference set 999001261000000100 : NHS realm language (clinical part) 999000691000001104 : NHS Realm language (pharmacy part) (supercedes the old dm+d realm subset 30001000001134). This means that we need to be able to submit *multiple* language reference set identifiers.
(get-refset-item store uuid)
(get-refset-item store msb lsb)
Get the specified refset item. Parameters:
Get the specified refset item. Parameters: - store : MapDBStore - UUID : the UUID of the refset item to fetch - msb/lsb : the most and least significant 64-bit longs representing the UUID.
(get-release-information st)
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
(get-reverse-map store refset-id s)
Returns the reverse mapping from the reference set and mapTarget specified.
Returns the reverse mapping from the reference set and mapTarget specified.
(get-reverse-map-range store refset-id prefix)
(get-reverse-map-range store refset-id lower-bound upper-bound)
Returns the reverse mapping from the reference set specified, performing what is essentially a prefix search using the parameters. For example (get-reverse-map-range store "D86.") will return all items with a map target with prefix 'D86.'
Parameters:
Prefixes are case sensitive, with natural string sorting used.
Returns the reverse mapping from the reference set specified, performing what is essentially a prefix search using the parameters. For example (get-reverse-map-range store "D86.") will return all items with a map target with prefix 'D86.' Parameters: - store : a MapDBStore - refset-id : the reference set in which to search - lower-bound : lower bound prefix, inclusive - upper-bound : upper bound prefix, exclusive - prefix : prefix; lower and upper bounds derived automatically Prefixes are case sensitive, with natural string sorting used.
(get-source-association-referenced-components store component-id refset-id)
Returns a sequence of component identifiers that reference the specified component in the specified association reference set.
Returns a sequence of component identifiers that reference the specified component in the specified association reference set.
(get-source-associations store component-id)
(get-source-associations store component-id refset-id)
Returns the associations in which this component is the target. targetComponentId - refsetId - itemId1 -itemId2.
Returns the associations in which this component is the target. targetComponentId - refsetId - itemId1 -itemId2.
(paths-to-root store 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. (sort-by count (paths-to-root store 24700007)) result (truncated): ((24700007 414029004 64572001 404684003 138875005) (24700007 6118003 80690008 362975008 64572001 404684003 138875005) (24700007 39367000 23853001 246556002 118234003 404684003 138875005) (24700007 6118003 80690008 23853001 246556002 118234003 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. (sort-by count (paths-to-root store 24700007)) result (truncated): ((24700007 414029004 64572001 404684003 138875005) (24700007 6118003 80690008 362975008 64572001 404684003 138875005) (24700007 39367000 23853001 246556002 118234003 404684003 138875005) (24700007 6118003 80690008 23853001 246556002 118234003 404684003 138875005))
(prefix-upper-bound s)
Given a string, generate an upper bound suitable for a prefix search. For example, 123 should give 124.
Given a string, generate an upper bound suitable for a prefix search. For example, 123 should give 124.
(stream-all-concepts store ch)
(stream-all-concepts store ch close?)
Asynchronously stream all concepts to the channel specified, and, by default, closing the channel when done unless specified. Returns a channel which, by default, will be closed when done.
Asynchronously stream all concepts to the channel specified, and, by default, closing the channel when done unless specified. Returns a channel which, by default, will be closed when done.
(write-batch-one-by-one batch store)
Write out a batch one item at a time.
Write out a batch one item at a time.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close