An NHS Organisation Directory Service (ODS) file-based index providing UK organisational search functionality.
An NHS Organisation Directory Service (ODS) file-based index providing UK organisational search functionality.
(all-contact-types orgs)
Given a sequence of organisations, return all used contact types.
Given a sequence of organisations, return all used contact types.
(all-organizations reader)
Returns a lazy sequence of all of the organisations. The reader must remain open until the sequence is fully realised.
Returns a lazy sequence of all of the organisations. The reader must remain open until the sequence is fully realised.
(build-index nhspd ch out)
Build an index from NHS ODS data streamed on the channel specified.
Build an index from NHS ODS data streamed on the channel specified.
(doc->organisation doc)
Deserialize a Lucene document into an ODS organisation.
Deserialize a Lucene document into an ODS organisation.
(fetch-org searcher extension)
(fetch-org searcher root extension)
Returns NHS ODS data for the organisation specified. Parameters:
Returns NHS ODS data for the organisation specified. Parameters: - searcher : Lucene IndexSearcher - root : (optional) the identifier root; default '2.16.840.1.113883.2.1.3.2.4.18.48' - extension : organisation code; eg. '7A4BV'.
The default organisation root is the HL7 OID representing a HealthAndSocialCareOrganisationIdentifier
The default organisation root is the HL7 OID representing a HealthAndSocialCareOrganisationIdentifier
(install-index nhspd {:keys [organisations code-systems]} out)
Install an index into the directory 'out' using the data provided.
Install an index into the directory 'out' using the data provided.
(make-metadata-document k m)
Create a Lucene document to store arbitrary data using the key specified.
Create a Lucene document to store arbitrary data using the key specified.
(make-organisation-doc nhspd org)
Turn an organisation into a Lucene document. At the moment, we use postcode to derive WGS84 coordinates (lat/lon) for an organisation. In the future, when ODS contains UPRNs for organisations, we could use UPRN to derive geographical coordinates.
Turn an organisation into a Lucene document. At the moment, we use postcode to derive WGS84 coordinates (lat/lon) for an organisation. In the future, when ODS contains UPRNs for organisations, we could use UPRN to derive geographical coordinates.
(make-search-query {:keys [s n address fuzzy only-active? from-location roles
_limit]
:or {fuzzy 0 only-active? true}})
Create a search query for an organisation. Parameters:
Create a search query for an organisation. Parameters: - :s : search for name or address of organisation - :n : search for name of organisation - :address : search within address of organisation - :fuzzy : fuzziness factor (0-2) - :only-active? : only include active organisations (default, true) - :roles : a string or vector of roles - :from-location : a map containing: - :lat : latitude (WGS84) - :lon : longitude (WGS84) - :range : range in metres (optional) - limit : limit on number of search results
(q-active)
A query to limit to active organisations
A query to limit to active organisations
(q-location [lat lon] distance)
(q-location lat lon distance)
Creates a query for an organisation within 'distance' metres of the location specified.
Creates a query for an organisation within 'distance' metres of the location specified.
(q-orgId extension)
(q-orgId root extension)
Make a query for the identifier specified.
Make a query for the identifier specified. - root : (optional) root OID - extension : organisation extension (code).
(q-roles roles)
Query for the role(s) specified.
Query for the role(s) specified.
(search searcher
{:keys [_s _n _only-active? _roles from-location limit]
:or {limit 1000}
:as q})
Search for an organisation. Parameters:
See make-search-query
for the query terms.
Warning: the results are lazily evaluated, so use doall
if you plan
on closing the IndexReader before processing the results.
Search for an organisation. Parameters: - searcher : Lucene IndexSearcher - q : a map containing your query terms. See `make-search-query` for the query terms. Warning: the results are lazily evaluated, so use `doall` if you plan on closing the IndexReader before processing the results.
(sort-by-distance [lat lon])
(sort-by-distance lat lon)
Creates an Apache Lucene 'Sort' based on distance from the location given.
Creates an Apache Lucene 'Sort' based on distance from the location given.
(tokenize analyzer field-name s)
Tokenize the string 's' according the 'analyzer' and field specified.
Tokenize the string 's' according the 'analyzer' and field specified.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close