Liking cljdoc? Tell your friends :D

com.eldrix.dmd.import

Support the UK NHS dm+d XML data files. This namespace provides a thin wrapper over the data files, keeping the original structures as much as possible and thus facilitating adapting to changes in those definitions as they occur.

For more information see https://www.nhsbsa.nhs.uk/sites/default/files/2021-02/dm%2Bd%20data%20model%20%28V2%29%2002.2021.pdf https://www.nhsbsa.nhs.uk/sites/default/files/2017-02/Technical_Specification_of_data_files_R2_v3.1_May_2015.pdf https://www.nhsbsa.nhs.uk/sites/default/files/2017-02/Data_Model_R2_v3.1_May_2015.pdf

Support the UK NHS dm+d XML data files.
This namespace provides a thin wrapper over the data files, keeping the
original structures as much as possible and thus facilitating adapting
to changes in those definitions as they occur.

For more information see
https://www.nhsbsa.nhs.uk/sites/default/files/2021-02/dm%2Bd%20data%20model%20%28V2%29%2002.2021.pdf
https://www.nhsbsa.nhs.uk/sites/default/files/2017-02/Technical_Specification_of_data_files_R2_v3.1_May_2015.pdf
https://www.nhsbsa.nhs.uk/sites/default/files/2017-02/Data_Model_R2_v3.1_May_2015.pdf
raw docstring

cardinalitiesclj

(cardinalities dir)

Determines the cardinalities for the different product components.

Determines the cardinalities for the different product components.
sourceraw docstring

ch->seqclj

(ch->seq ch)

Turns a clojure core.async channel into a lazy sequence.

Turns a clojure core.async channel into a lazy sequence.
sourceraw docstring

dfclj

source

dmd-file-seqclj

(dmd-file-seq dir)
(dmd-file-seq dir & {:keys [include exclude]})

Return an ordered sequence of dm+d files from the directory specified. Components are returned in an order to support referential integrity. Each result is a map containing :type, :date, :order and :file. Optionally takes a set of file types to include or exclude.

Return an ordered sequence of dm+d files from the directory specified.
Components are returned in an order to support referential integrity.
Each result is a map containing :type, :date, :order and :file.
Optionally takes a set of file types to include or exclude.
sourceraw docstring

get-componentclj

(get-component dir file-type component-type)

Convenience function to stream only the specified component. Useful for testing. Parameters:

  • dir : directory from which to load dm+d files
  • file-type : dm+d type e.g. :LOOKUP
  • component-type : component type e.g. :COMBINATION_PACK_IND

file-type and component-type are keywords representing the names from the dm+d specification. :VTM :VTM - returns all VTMs :VMP :VMP - returns all VMPs :VMP :ONT_DRUG_FORM - returns all ONT_DRUG_FORMS from the VMP file.

Convenience function to stream only the specified component.
Useful for testing.
Parameters:
- dir            : directory from which to load dm+d files
- file-type      : dm+d type  e.g. :LOOKUP
- component-type : component type e.g. :COMBINATION_PACK_IND

`file-type` and `component-type` are keywords representing the names from the
dm+d specification.
:VTM :VTM   - returns all VTMs
:VMP :VMP   - returns all VMPs
:VMP :ONT_DRUG_FORM - returns all ONT_DRUG_FORMS from the VMP file.
sourceraw docstring

get-release-metadataclj

(get-release-metadata dir)

Return release metadata from the directory specified. Unfortunately, the dm+d distribution does not include a metadata file containing release information, so version information is derived from the filenames within the release.

Parameters:

  • dir : directory to examine

Result:

  • a map containing release information: |- :release-date - date of the release (java.time.LocalDate)

As far as I am aware, there is no formal specification for dm+d filenames, but currently the last six digits of the filename are a date of format 'ddMMyy' so we use the latest date as the date of the release.

Return release metadata from the directory specified.
Unfortunately, the dm+d distribution does not include a metadata file
containing release information, so version information is derived from
the filenames within the release.

Parameters:
 - dir   : directory to examine

Result:
 - a map containing release information:
   |- :release-date   - date of the release (java.time.LocalDate)

As far as I am aware, there is no formal specification for  dm+d filenames,
but currently the last six digits of the filename are a date of format
'ddMMyy' so we use the latest date as the date of the release.
sourceraw docstring

parse-gtinclj

(parse-gtin loc)

Note: unlike other AMPP related components, this uses :AMPPID as the key!

Note: unlike other AMPP related components, this uses :AMPPID as the key!
sourceraw docstring

(print-cardinalities {:keys [dir]})
source

should-include?clj

(should-include? include exclude file-type)
source

statistics-dmdclj

(statistics-dmd dir)

Return statistics for dm+d data in the specified directory.

Return statistics for dm+d data in the specified directory.
sourceraw docstring

stream-dmdclj

(stream-dmd dir
            ch
            &
            {:keys [_include _exclude close?] :or {close? true} :as opts})

Streams dm+d components from the directory to the channel. Components are ordered to maintain relational integrity should it be required. This does minimal processing; streamed data is a close representation of the dm+d data structures.Some properties are parsed such as dates (xxxDT) to a java.time.LocalDate, flags (e.g. invalidity) to booleans, and identifiers to 'long's. Each component is labelled with its type as :TYPE. This is a tuple of file and entity: e.g. [:VMP :DRUG_FORM].

Parameters:

  • dir : directory containing dm+d distribution
  • ch : clojure.core.async channel
  • close? : close the channel when done?, default true
  • include : a set of dm+d file types to include (e.g. #{:VTM})
  • exclude : a set of dm+d file types to exclude (e.g. #{:VTM})
Streams dm+d components from the directory to the channel.
Components are ordered to maintain relational integrity should it be required.
This does minimal processing; streamed data is a close representation of the
dm+d data structures.Some properties are parsed such as dates (xxxDT) to a
java.time.LocalDate, flags (e.g. invalidity) to booleans, and identifiers to
'long's. Each component is labelled with its type as :TYPE. This is a tuple of
file and entity: e.g. [:VMP :DRUG_FORM].

Parameters:
- dir      : directory containing dm+d distribution
- ch       : clojure.core.async channel
- close?   : close the channel when done?, default true
- include  : a set of dm+d file types to include (e.g. #{:VTM})
- exclude  : a set of dm+d file types to exclude (e.g. #{:VTM})
sourceraw docstring

stream-gtinclj

(stream-gtin root ch _ close?)
source

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

× close