Skip to content

Commit

Permalink
Add ability to specify a locale string for index creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
wardle committed Oct 27, 2021
1 parent c900a17 commit 103f1bc
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,29 @@ I don't believe in the idea of uploading codesystems and value sets in place.
My approach to versioning is to run different services; I simply switch
API endpoints.

### Localisation

SNOMED CT is distributed across the world. The base distribution is the
International release, but your local distribution will include this together
with local data. Local data will include region-specific language reference
sets.

The core SNOMED API relating to concepts and their meaning is not affected
by issues of locale. Locale is used to derive the synonyms for any given
concept. There should be a single preferred synonym for every concept in a
given language reference set.

When you build a database, the search index caches the preferred synonym using
the locale specified during index creation. If no locale is specified, then
the system default locale will be used. In general, you should specify a
locale that will match the distribution you are importing.

You can specify the requested locale using IETF BCP 47, or by using a special
SNOMED CT defined locale that includes the identifier of the language reference
set you wish to use. I have added BCP 47 matching as an extension in hermes
as the burden of managing which reference sets to use is left to the client
in SNOMED standard. Hermes tries to provide a set of sane defaults.

### Can I get support?

Yes. Raise an issue, or more formal support options are available on request,
Expand Down
8 changes: 6 additions & 2 deletions cmd/com/eldrix/hermes/cmd/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@
(do (println "No provider specified. Available providers:")
(download/print-providers))))

(defn build-index [{:keys [db]} _]
(defn build-index [{:keys [db locale]} _]
(if db
(hermes/build-search-index db)
(if (str/blank? locale)
(hermes/build-search-index db)
(hermes/build-search-index locale))
(log/error "no database directory specified")))

(defn compact [{:keys [db]} _]
Expand Down Expand Up @@ -66,6 +68,8 @@
["-d" "--db PATH" "Path to database directory"
:validate [string? "Missing database path"]]

[nil "--locale LOCALE" "Locale to use, if different from system"]

["-h" "--help"]])

(defn usage [options-summary]
Expand Down

0 comments on commit 103f1bc

Please sign in to comment.