Outbound Document Interface

From Galen Healthcare Solutions - Allscripts TouchWorks EHR Wiki
Jump to navigation Jump to search

Enable

To turn on the Outbound Document Interface, you must set the update a table in the database called Preference. The preference is: DocumentWriteOutboundEvent and must be set to Y in the Works database:

UPDATE Preference SET Setting = 'Y' 
WHERE Name = 'DocumentWriteOutboundEvent'

Events

All actions on documents/notes create an event, with the exception of viewing, printing and faxing. These events are posted to the Event_Table for ConnectR to process. The Outbound Document Interface must be setup to receive and process the events appropriately. You would limit the events in ConnectR, based on Status, Source (the EHR, or Interface) and other appropriate criteria.

Inbound documents

Inbound documents do process in as Events that are sent outbound.

DOC Message Construction

DOC Msg Construction.jpg

Document Text

The document text is not available as output of the "Extract" stored procedures as illustrated above. As such, a ConnectR script is utilized to extract the document text by the DocID (SupersetData-[7] - ItemID):

function GetDocumentTextLIVE(DocID)

Dim oCon
Dim oRS
Dim vcommand
Dim datasource
Dim user
Dim pass

'Pass in Document IDto be searched for.  This script will select against that document table and return the text of the document to be sent in the interface.

datasource = "WorksLive"
user = "connectr"
pass = "connectr"

'Establish the Connection

Set oCon = CreateObject("ADODB.Connection")           'This Creates the database object
oCon.Open "Data Source=" & datasource, user, pass    'This opens the object --  data source, username, password

'Do the lookup on the dictionary

vcommand = "select * from document where documentid="  & DocID

Set oRS = CreateObject("ADODB.Recordset")
oRS.Open vcommand, oCon, 3, 1, -1

Dim oRTF 

Set oRTF = CreateObject("AHSRTFUtility.RTFObject") 

oRTF.Value = oRS("EditableChunk")

GetDocumentTextLIVE = oRTF.Text
          	oRS.Close
	oCon.Close 
	Set oRS = Nothing
	Set oCon = Nothing	
               
                Set oRTF = Nothing
end function