|DotNet Class HL7Connect.Services.HL7V2Manager|
Base for HL7 v2 services provided by HL7Connect
|Create a blank HL7 message|
|HL7Connect.V2.Message CreateMessageForVersion(string version);|
|Create a blank HL7 message and set the version|
|HL7Connect.V2.Message CreateMessageForEvent(string version, string event_, string msg);|
|Create a blank HL7 message and set the version, event, and structure (MSH-9-1 and MSH-9-2)|
|HL7Connect.V2.Message CreateMessageFromStream(Stream stream);|
|Read the stream as a v2 message. May be vertical bar or XML in any character encoding, with or without BOM. The entire stream will be read; it must start at the start of the message and end at the end of the message|
|HL7Connect.V2.Message Clone(HL7Connect.V2.Message message);|
|Clone an HL7 message to a new instance that can be modified without altering the original instance|
|void SaveMessageToStream(HL7Connect.V2.Message message, Stream stream);|
|Save the message to a stream using the default encoding (the format it was read from, the format of the message to which it is an answer - if it is, or vertical bar format)|
|void SaveMessageToStreamWithFormat(HL7Connect.V2.Message message, Stream stream, string format);|
|Save the message to a stream using the specified format. Format is a series
of tokens separated by spaces. The tokens may be one of the following:
|string GetPatientId(HL7Connect.V2.Message message);|
|The patient id of the message if it can be unambiguously determined. a null result may not indicate that a message does not contain an id, just that it cannot be determined with confidence without knowledge of specific interface busines rules. This function should only be used for messaging administration purposes (such as display in logs etc) and not when managing actual patient records|
|Create a transferred message ready for use with sending and/or receiving messages|
|void ExecuteScript(string script, string entryPoint, string language, string param, bool wantDebug, HL7Connect.V2.DataObject context);|
script: the name of a file containing the source, or the source itself entrypoint: the name of the procedure to run, or the coclass name for com language: the name of the language to use. will be inferred from the file extension of the script if there is one. wantDebug: when using windows script host context: the object on which the scripting will occur - either a message, segment, dataelement, or component
Note that the script can change the contents of the object passed to it. Any handles that the host retains to contents of the objects may be invalid after it executes (except for OCL, which cannot change the object)
1. Windows Script Host
If the language is "VBScript", "JScript", or any other language string the Windows Script Host recognises, or if the file extension is (".vbs, *.js, *.py, *.pl).
The script procedure is invoked with a single parameter which is an IExecuteHL7Event event. The kernel objects therwise available in when using scripts in HL7Connect will be null except for the WScript equivalent object.
The script engine is Windows Script Host, like the rest of HL7Connect. The want debug flag is passed through to the windows script host engine for whether to invoke the debugger or not.
If the language is "COM", the script is ignored. The entry point is the coclass name of a registered class that implements the IHL7ConnectEventHandler interface (start mode is single threaded), which will be passed a IExecuteHL7Event.
if the language is "OCL" or he file extension is ".ocl", the ocl provided will be executed against the message. If any assertions in the ocl script fail, an exception will be raised containing the details
|HL7Connect.V2.Message BuildByKScript(string script);|
|Build an IHL7Message by executing a KScript. The KScript must build a valid v2.xml version of a message. The script may be either a filename or the KScript directly|