Creating Logic

Creating your own logic has always been possible within HL7 Comm, but it is now much easier than it was. To enable this a set of logic agents called BshLogicAgentInteractive and BshLogicAgentFromFile have been created. These agents allow you to process incoming data using a script with a well defined programming interface. This gives you control of ACKing or NACKing messages (where applicable, like the Hl7ThreadServer listener), control of the format of the outbound data (that is, you can perform HL7 mappings or even change it to a different data type altogether) and control of messages to send to the HL7 Comm log.

The best place to look for sample logic is to start a new configuration and choose the BshLogicAgentInteractive agent for the logic agent. This will open a window upon starting that will allow you to select from several sample scripts from the start or to load one of your existing scripts. The sample scripts vary from the trivially simple and mundate to more challenging examples using more of the beanshell API.

If you're not familiar with beanshell, think of it as Java in script form. It's more dynamic and less strict than regular java yet has access to all the features. It's a good compromise to get you running quickly with your own scripts for HL7 Comm.

If you have a useful beanshell script to donate to the collective, please send it to me using the email address in the about section of the documentation. Creating a collection of user submitted scripts may make life easier for other users and perhaps eventually for yourself.