How about polling the global looking for updates? It would be lightweight to just check if the value of ^FSLOG has incremented since the last check:

set lastFSEntry = ^FSLOG

or use $order:

set lastFSEntry = $order(^FSLOG(""),-1)

As for timestamps, in my test environment all of the ^FSLOG entries seem to end with timestamps already:

^FSLOG(41)="DispatchRequest^HS.FHIRServer.Service^11062|Msg|  [1] -> DO  0|03/14/2022 01:57:19.398158PM"

Vivek,

The method for transforming HL7 to SDA can be found here. Note that this doc covers transforming HL7>SDA>C-CDA, so you'll only be interested in the first half of that:
https://docs.intersystems.com/irisforhealth20191/csp/docbook/DocBook.UI....

And the methods for transforming SDA to FHIR can be found here:
https://docs.intersystems.com/irisforhealth20191/csp/docbook/DocBook.UI....

-Marc

I created a simple inbound adapter and a simple business service that uses it, and the &sql() call succeeds for me. It would be good to check the event log and see if any additional error information got logged.

Class Example.InboundAdapter Extends Ens.InboundAdapter [ ProcedureBlock ]
{

Method OnTask() As %Status
{
        set suspendedCount=-1
        &sql(SELECT count(ID) into :suspendedCount FROM Ens.MessageHeader where TargetQueueName not like '_S%' and TargetQueueName not like 'ENS%' and Status='5')
        
        // log what we got back
        set ^ztest($now(),"SQLCODE") = SQLCODE
        set ^ztest($now(),"suspendedCount") = suspendedCount
        
        quit 1
}

}
Class Example.Service Extends Ens.BusinessService
{

/// The type of adapter used to communicate with external systems
Parameter ADAPTER = "Example.InboundAdapter";

}