(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)(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)(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.
(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.
(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.
(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.
(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.
(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.
(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.
(create-segment id & fields)Returns a new, empty segment map with the provided id.
Returns a new, empty segment map with the provided id.
(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.
(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,
'
').(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.
(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.
(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.
(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.
(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.
(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.
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.
(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.
(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.
(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.
(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.
(pr-delimiters delimiters)Returns an HL7 compatible text representation of the provided delimiters.
Returns an HL7 compatible text representation of the provided delimiters.
(pr-field delimiters field)Returns an HL7 compatible String representation of the provided field.
Returns an HL7 compatible String representation of the provided field.
(pr-message message)Prints the provided HL7 message to the current out stream.
Prints the provided HL7 message to the current *out* stream.
(pr-segment delimiters segment)Returns an HL7 compatible String representation of the provided segment.
Returns an HL7 compatible String representation of the provided segment.
(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.
(sanitize-message message)Removes all control characters from a message.
Removes all control characters from a message.
(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.
(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.
(str-message message)Returns the provided HL7 message as a string.
Returns the provided HL7 message as a string.
(test-message)Returns a test message with a unique message id.
Returns a test message with a unique message id.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |