
System Architecture
When you sit down to create a CORE HL7 C# Script the first decision you have to make is which type of script are you writing? Starting with the Library Version 1.0.1 there are 3 different types.
Type 1 Script
A script that requires a HL7 message feed. This means that your script will perform operations on a SINGLE HL7 message which will be passed into it by the Script Hosting Application.

Type 1 Script: System Architecture
Type 2 Script
A "stand-alone" script is one which is just called by the Script Hosting Application and performs some other tasks. It may be a script which runs continuously until STOPPED by the Script Hosting Application. Examples 1 and 3 in Example Scripts demonstrate how to do this. It may also just perform one or more specific discrete tasks and then exits.

Type 2 Script: System Architecture
Type 3 Script
A Type 3 script is a "Listener" script designed to be run by the CORE HL7 TCP/IP Listener. This type of script functions very much like a Type 1 script, but with a different mechanism for feeding the HL7 messages into the script at runtime.

Type 3 Script: System Architecture
NOTE: Scripts designed as Type 3 scripts are NOT compatible with the Script Engine software. They can only be run by a CORE HL7 TCP/IP Listener OR by using the CORE HL7 Viewer to run a Listener Simulation.
Properties of a CORE HL7 C# Script
A CORE HL7 Script is made up of these primary properties.
C# Code: Obviously, but there are other properties associated with the code like the Version, History, Created, Last Modified, Last Compiled etc.
6 optional main properties which you can set in your CORE HL7 Script Library for compiling and testing your script in the CORE HL7 Viewer. They are:
•Output Folder: A valid path to a Windows Folder. Access in your script code via globals.OutputFolder.
•Logs Folder: A valid path to a Windows Folder. Access in your script code via globals.LogFolder.
•Errors Folder: A valid path to a Windows Folder. Access in your script code via globals.ErrorFolder.
•Configuration File: A valid path / file name file on the file system. Access in your script code via globals.ConfigFileName.
•Microsoft SQL Connector: A set of connection information to a Microsoft SQL Database. Access in your script code via globals.MSSQLProfile.
•MySQL Connector: A set of connection information to a MySQL Database. Access in your script code via globals.MySQLProfile.
These properties are all part of your SCRIPT and are saved into every CheckPoint that you create. This allows you to import and export scripts to share between developers with each developer being able to keep their own local copies of the OPTIONAL 6 properties for development and testing using our CORE HL7 Viewer.
For the CORE HL7 Script Engine (Type 1 and Type 2 Scripts)
In your CORE HL7 Script Engines you will OVERRIDE these 6 OPTIONAL properties in your Script Engine Profile(s) with the production values. This allows you to import a CheckPoint into a CORE HL7 Script Engine without having to worry about those values being changed by a developer.
For the CORE HL7 Listener (Type 3 Scripts)
In your CORE HL7 Listener the OutPut Folder, Logs Folder, and Errors Folder in your script are OVERRIDDEN by your CORE HL7 Listener profile(s). The Output Folder will be set to the HL7 Data Folder you select in your Listener Profile and the Logs and Errors folders will be set to sub-folders under that folder (\ScriptLogs and \ScriptErrors respectively). The other 3 properties (Config File, Microsoft SQL and MySQL connectors) are left in place as saved in your script properties.