Liking cljdoc? Tell your friends :D

com.nervestaple.clinical.message-parser.interface


ack-messageclj/s

(ack-message options ack-status parsed-message)

Returns a parsed message that contains an acknowledgement message for the provided parsed message, the acknowledgement message will use the same delimiters. If the message indicates that no acknowledgement should be returned, this function will return nil.

The 'option' should be a hash-map with the following keys:

:sending-app, :sending-facility, :production-mode, :version,
:text-message

Optionally, a :message-id key may be provided if you need a specific value.

These values will be used to fill out the ACK message. The 'ack-status' field should be a valid HL7 version 2.x acknowledgment status:

AA (accepted), AE (error), AR (rejected)
Returns a parsed message that contains an acknowledgement message
for the provided parsed message, the acknowledgement message will
use the same delimiters. If the message indicates that no
acknowledgement should be returned, this function will return nil.

The 'option' should be a hash-map with the following keys:

    :sending-app, :sending-facility, :production-mode, :version,
    :text-message

Optionally, a `:message-id` key may be provided if you need a specific
value.

These values will be used to fill out the ACK message. The
'ack-status' field should be a valid HL7 version 2.x acknowledgment
status:

    AA (accepted), AE (error), AR (rejected)
sourceraw docstring

ack-message-fallbackclj/s

(ack-message-fallback options ack-status message)

Returns a parsed message that contains an acknowledgement message for the provided un-parsed message, the acknowledgement message will use default delimiters. Use this function when you have an HL7v2 message that you need to acknowledge but you cannot parse.

The 'option' should be a hash-map with the following keys:

:sending-app, :sending-facility, :production-mode, :version,
:text-message

Optionally, a :message-id key may be provided if you need a specific value.

These values will be used to fill out the ACK message. The 'ack-status' field should be a valid HL7 version 2.x acknowledgment status:

AA (accepted), AE (error), AR (rejected)
Returns a parsed message that contains an acknowledgement message for the
provided un-parsed message, the acknowledgement message will use default
delimiters. Use this function when you have an HL7v2 message that you need to
acknowledge but you cannot parse.

The 'option' should be a hash-map with the following keys:

    :sending-app, :sending-facility, :production-mode, :version,
    :text-message

Optionally, a `:message-id` key may be provided if you need a specific
value.

These values will be used to fill out the ACK message. The
'ack-status' field should be a valid HL7 version 2.x acknowledgment
status:

    AA (accepted), AE (error), AR (rejected)
sourceraw docstring

add-fieldclj/s

(add-field segment field)

Adds the provided field map to the provided segment map and returns a new segment.

Adds the provided field map to the provided segment map and returns a new
segment.
sourceraw docstring

add-fieldsclj/s

(add-fields segment fields)

Adds the provided field maps to the provided segment map and returns a new segment.

Adds the provided field maps to the provided segment map and returns a new
segment.
sourceraw docstring

add-segmentclj/s

(add-segment message segment)

Adds the provided segment map to the provided message map and returns a new message.

Adds the provided segment map to the provided message map and returns a new
message.
sourceraw docstring

ASCII_AMPERSANDclj/s

source

ASCII_BACKSLASHclj/s

source

ASCII_CARATclj/s

source

ASCII_CRclj/s

source

ASCII_FSclj/s

source

ASCII_LFclj/s

source

ASCII_PIPEclj/s

source

ASCII_TILDEclj/s

source

ASCII_VTclj/s

source

convert-valuesclj/s

(convert-values values)

If provided a list of values, any in items are replaced with an empty string. When provided a single value a list with that value will be returned or an empty list of that value is nil.

If provided a list of values, any in items are replaced with an empty string.
When provided a single value a list with that value will be returned or an
empty list of that value is nil.
sourceraw docstring

create-empty-messageclj/s

(create-empty-message)
(create-empty-message delimiters)

Returns a new, empty message map. if no map of delimiters is provided then the default set will be used.

Returns a new, empty message map. if no map of delimiters is provided then the
default set will be used.
sourceraw docstring

create-fieldclj/s

(create-field)
(create-field data)

Returns a new field map populated with the provided data.

Returns a new field map populated with the provided data.
sourceraw docstring

create-messageclj/s

(create-message delimiters & segments)

Accepts a map of delimiters and segments. Returns a new parsed message using the provided delimiters populated with the provided segments.

Accepts a map of delimiters and segments. Returns a new parsed message using
the provided delimiters populated with the provided segments.
sourceraw docstring

create-segmentclj/s

(create-segment id & fields)

Returns a new, empty segment map with the provided id.

Returns a new, empty segment map with the provided id.
sourceraw docstring

DEFAULT-DELIMITERSclj/s

source

dumpclj/s

(dump parsed-message)
(dump parsed-message show-nulls)

Prints a human-readable version of the HL7 message to the current out stream. If the show-nulls parameter is provided and is true, null fields will also be displayed.

Prints a human-readable version of the HL7 message to the current *out* stream.
If the show-nulls parameter is provided and is true, null fields will also be
displayed.
sourceraw docstring

extract-text-from-segmentsclj/s

(extract-text-from-segments parsed-message segment-type index & options)

Extracts the text from the parsed message for the supplied index of the given segments, the text will be concatenated and returned as one String. For instance, this function would extract all of the text from the fifth index of all of the OBX segments:

  (extract-text-from-segments parsed-message 'OBX' 5)

You may pass in an optional argument that contains a character to interleave between the chunks of extracted text (for instance, ' ').

Extracts the text from the parsed message for the supplied index of
  the given segments, the text will be concatenated and returned as
  one String. For instance, this function would extract all of the text
  from the fifth index of all of the OBX segments:

      (extract-text-from-segments parsed-message 'OBX' 5)

  You may pass in an optional argument that contains a character to
  interleave between the chunks of extracted text (for instance,
  '
').
sourceraw docstring

filter-messages-bysegmentclj

(filter-messages-bysegment segment-id parsed-messages)

Returns a lazy sequence of messages that have a matching segment id in their first segment.

Returns a lazy sequence of messages that have a matching segment id in their
first segment.
sourceraw docstring

format-timestampclj/s

(format-timestamp)
(format-timestamp date)

Returns an HL7 compatible timestamp (yyyyMMddHHmmss) in local time for the provided date (a java.util.Date or a JavaScript Date), or for the current time if no date is provided.

Returns an HL7 compatible timestamp (yyyyMMddHHmmss) in local time for the
provided date (a java.util.Date or a JavaScript Date), or for the current time
if no date is provided.
sourceraw docstring

get-fieldclj/s

(get-field message segment-id field-index)

Returns the field with the provided index from the segment with the given id of the provided message.

Returns the field with the provided index from the segment with the
given id of the provided message.
sourceraw docstring

get-field-componentclj/s

(get-field-component message segment-id field-index component-index)

Returns the component at the provided index from the field with the provided index from the segment with the given id in the provided message.

Returns the component at the provided index from the field with the
provided index from the segment with the given id in the provided
message.
sourceraw docstring

get-field-firstclj/s

(get-field-first parsed-message segment-id field-index)

Returns the first instance of the field with the provided index from the segment with the given id of the provided message. This function is handy when you know there's only one instance of a particular segment (like 'MSH'), you won't have to grab the first element; it will be returned by this function.

Returns the first instance of the field with the provided index
from the segment with the given id of the provided message. This
function is handy when you know there's only one instance of a
particular segment (like 'MSH'), you won't have to grab the first
element; it will be returned by this function.
sourceraw docstring

get-field-first-valueclj/s

(get-field-first-value parsed-message segment-id field-index)

Returns the value of the first instance of the field with the provided index from the segment with the given id of the provided message. This function is handy when you know there's only one instance of a particular segment (like 'MSH'), you won't have to grab the first element and then it's :content value; it will be returned by this function.

Returns the value of the first instance of the field with the
provided index from the segment with the given id of the provided
message. This function is handy when you know there's only one
instance of a particular segment (like 'MSH'), you won't have to
grab the first element and then it's :content value; it will be
returned by this function.
sourceraw docstring

get-readerclj/smultimethod

Returns a pushback reader for the provided Object. We want to wrap another Reader but we'll cast to a String and read that if required. On ClojureScript the Object is always read as a String.

Returns a pushback reader for the provided Object. We want to wrap
another Reader but we'll cast to a String and read that if
required. On ClojureScript the Object is always read as a String.
sourceraw docstring

get-segment-fieldclj/s

(get-segment-field segment index)
(get-segment-field segment index raw?)

Returns the field with the provided index from the given segment. Keep in mind that this function expects the index to adhere to the HL7 specification where the first field of data is located at index 1. Another gotcha in the MSH segment, the first field of data starts at index 2 and that's the list of delimiters.

This function will return the id of the segment if you ask for index 0. For the MSH segment, it will return nil for index 1 instead of returning the field delimiter. If you want the field delimiter you can get it under the :delimiter key of the message. If the provided index is out of bounds then nil will be returned.

Returns the field with the provided index from the given
segment. Keep in mind that this function expects the index to adhere
to the HL7 specification where the first field of data is located at
index 1. Another gotcha in the MSH segment, the first field of data
starts at index 2 and that's the list of delimiters.

This function will return the id of the segment if you ask for index 0. For
the MSH segment, it will return nil for index 1 instead of returning the field
delimiter. If you want the field delimiter you can get it under the :delimiter
key of the message. If the provided index is out of bounds then nil will be
returned.
sourceraw docstring

get-segmentsclj/s

(get-segments message segment-id)

Returns all of the segments in the message that have the provided segment id.

Returns all of the segments in the message that have the provided
segment id.
sourceraw docstring

message-id-unparsedclj/s

(message-id-unparsed message)

Returns the message id for an HL7 message by doing some simple regular expression matching on the message. This function does not involve parsing the message and may be faster.

Returns the message id for an HL7 message by doing some simple
regular expression matching on the message. This function does *not*
involve parsing the message and may be faster.
sourceraw docstring

parseclj/s

(parse message-source)

Reads data from the provided source (a Reader, String, etc.) and parses that data into a map that represents the content of the message.

Reads data from the provided source (a Reader, String, etc.) and parses that
data into a map that represents the content of the message.
sourceraw docstring

pr-delimitersclj/s

(pr-delimiters delimiters)

Returns an HL7 compatible text representation of the provided delimiters.

Returns an HL7 compatible text representation of the provided
delimiters.
sourceraw docstring

pr-fieldclj/s

(pr-field delimiters field)

Returns an HL7 compatible String representation of the provided field.

Returns an HL7 compatible String representation of the provided
field.
sourceraw docstring

pr-messageclj/s

(pr-message message)

Prints the provided HL7 message to the current out stream.

Prints the provided HL7 message to the current *out* stream.
sourceraw docstring

pr-segmentclj/s

(pr-segment delimiters segment)

Returns an HL7 compatible String representation of the provided segment.

Returns an HL7 compatible String representation of the provided
segment.
sourceraw docstring

read-messagesclj

(read-messages data-in)
(read-messages message lines)

Reads through a source of multiple messages (String, File, etc.) or a sequence of messages and returns a lazy sequence of parsed HL7 v2 messaging messages. If a sequence is provided it will be read directly otherwise a reader will be opened on the provided data.

Reads through a source of multiple messages (String, File, etc.) or a sequence
of messages and returns a lazy sequence of parsed HL7 v2 messaging messages.
If a sequence is provided it will be read directly otherwise a reader will be
opened on the provided data.
sourceraw docstring

sanitize-messageclj/s

(sanitize-message message)

Removes all control characters from a message.

Removes all control characters from a message.
sourceraw docstring

segment-idsclj/s

(segment-ids message)

Returns a list of the segment ids present in the message.

Returns a list of the segment ids present in the message.
sourceraw docstring

set-fieldclj/s

(set-field message segment-id field-index value)

Updates the message by altering the field value for the specified segment. When specifying field indexes, be sure to use the correct HL7 index (the segment id would be 0, the first field is at index 1).

Your value should be an atom or an collection, a collection indicates a field with components. Subcomponents are represented as a collection containing a collection. Pass in a collection of fields to indicate repeating fields.

Updates the message by altering the field value for the specified
segment. When specifying field indexes, be sure to use the correct
HL7 index (the segment id would be 0, the first field is at index
1).

Your value should be an atom or an collection, a collection
indicates a field with components. Subcomponents are represented as
a collection containing a collection. Pass in a collection of fields
to indicate repeating fields.
sourceraw docstring

str-messageclj/s

(str-message message)

Returns the provided HL7 message as a string.

Returns the provided HL7 message as a string.
sourceraw docstring

test-messageclj/s

(test-message)

Returns a test message with a unique message id.

Returns a test message with a unique message id.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close