Question
· Aug 5, 2020

BPL and Workflow - check/authorisation of HL7 Message

Hi Everyone,

I'm currently implementing an interface solution to send through data to community pharmacies here in the UK from our hospital PAS system. As part of this project i have created a BPL which calls a SQL operation to infiltrate our Data warehouse and add to the message - this is all done and working as i expect.

What I now need to implement is something through Workflow- the idea is the hospital pharmacy team wish to approve and authorise the message before it is sent onto the outbound operation, so i have set up the workflow, set up the actions to enable the pharmacist to approve / reject., and as part of that i have taken some of the fields within the HL7 message, set to context variables and then im able to pull those into the workflow task request as %Formfields and %formValues, which works great for single fields. This is then arranged via a custom form/ csp page.

What im wondering is if it is possible at all to "tabulate" a repeating HL7 segment (in this instance OBX) and then display that within the form e.g:

HL7 Message example (its all test data)

Custom workflow form: (note not finished so ordering all over the place, and just put the HL7 message into the form just so i could see it.)

Ive assigned the values within the custom form to context variables, and they can then be pulled into the form which works great

How (if possible) can i do similar with a repeating segment within the HL7 Message - can i "tabulate" that information and display it at all?

Open to suggestions of course- first time I've used BPL and workflow, certainly the first time workflow has been considered in our trust so not a lot of knowledge out there.

Thanks in advance - happy to give further detail where required.

Discussion (3)2
Log in or sign up to continue

Just to close this one, and to place thanks to Neerav for his help over LinkedIn with his valuable advice, and also the BPL and iterations.

I was able to do this by sending through the HL7 message as a context variable into the workflow task itself, and then (As i didnt realise you could script on a csp page), script within that to iterate over, and display as a table.  so the snippet of code on my csp page is as follows:

<script language="Cache" method="Medtable"
arguments="count:%Integer" returntype="%String">
      New i
   Write "<table class=""meds""><th colspan=""8"">Discharge Medication Details</th>",!
   Write "<tr><th>Medication</th><th>Strength</th><th>Form</th><th>Dose</th><th>Route</th><th>Frequency</th><th>Start Date</th><th>Stop Date</th></tr>"
   For = 1:1:pHL7.GetValueAt("ORCgrp(*)") {
      Write "<tr><td>"_pHL7.GetValueAt("ORCgrp("_i_").RXD:2.2"),!,"</td><td>"_pHL7.GetValueAt("ORCgrp("_i_").RXD:4"),!,"</td><td></td><td></td><td>"_pHL7.GetValueAt("ORCgrp("_i_").RXR:1.2"),!,"</td><td></td><td></td><td></td></tr>"
   }
   Write "</table>",!
   Quit "" </script>
#(..Medtable())#

Which then displays as:

Thanks very much

Warren