qie.createHL7Message¶
Signature: qie.createHL7Message(field*, comp*, repeat*, escape*, subComp*, segDel*, encoding*)
Returns: HL7 Message message - the newly created message object
Replace the current message with an empty HL7 formatted message.
Note
Calling qie.createHL7Message() with no parameters creates a new HL7 message using the default delimiters.
Note
The return value MUST ALWAYS be assigned to the bound-in message object.
Parameters¶
| Type | Name | Description | Default |
|---|---|---|---|
| String | field* | (optional) the HL7 field delimiter character | ` |
| String | comp* | (optional) the HL7 field component delimiter character | ^ |
| String | repeat* | (optional) the HL7 field value repeat character | ~ |
| String | escape* | (optional) the HL7 escape character | \ |
| String | subComp* | (optional) the HL7 field sub-component character | & |
| String | segDel* | (optional) the HL7 segment delimiter specified in hexadecimal ('0D' or 'OA') or ascii ('\r' or '\n') | 0D |
| String | encoding* | (optional) the character encoding for this message | Source Node encoding |
Example¶
// Define the separators for the HL7 message
var field = '|'; // Field separator
var comp = '^'; // Component separator
var repeat = '~'; // Repetition separator
var escape = '\\'; // Escape character
var subComp = '&'; // Subcomponent separator
var segDel = '\r'; // Segment delimiter
var encoding = 'UTF-8'; // Encoding
// Create a basic HL7 message
message = qie.createHL7Message(field, comp, repeat, escape, subComp, segDel, encoding);