Ensemble reading HL7 from SQL Server

67 views
Skip to first unread message

icero...@gmail.com

unread,
Nov 19, 2016, 5:15:26 PM11/19/16
to InterSystems: Ensemble in Healthcare

Friends,


We have a situation which I am sure anyone with a moderate amount of Ensemble coding experience would be able to solve in a short space of time.    Ensemble needs to read HL7 messages from SQL Server, the Ensemble Service would send them straight on to the Business Operation (no re-formatting of messages is required) and then there would be a socket connection between the BO and target system. .


Connectivity is not the problem as SQL Server data can be displayed in the Management Portal without any problem.    Here’s what I have done so far:

1/ Created a namespace with nothing in it apart from modules relating to the scenario described above.

2/ Created a production with an inbound service (HL7InboundFromSQL) and outbound operation (HL7Out).

3/ Informational Settings / Class name in the BS contains the name of a class (PkgPhilTest3.Services.Inbound) which has been created within Studio.

3/ 'Basic Settings' – Call Interval, DSN and Credentials all contain appropriate values

4/ 'Data Settings' within the Service are as follows: Query, 'select row_id, hl7message from dbo.ensemble_hl7', Parameters and Delete Query are both blank and Key Field Name reads 'ROW_ID'.     ROW_ID is the PK in the SQL table.

5/ Class PkgPhilTest3.Services.Inbound currently reads as follows:

Class PkgPhilTest3.Services.HL7Inbound Extends Ens.BusinessService [ ProcedureBlock ]
{
Parameter ADAPTER = "EnsLib.SQL.InboundAdapter";
Method OnProcessInput(pInput As EnsLib.SQL.Snapshot, Output pOutput As %RegisteredObject) As %Status
{
 set req=##class(ESQL.request).%New()
 set req.HL7MESSAGE=pInput.Get("HL7MESSAGE")
 set sc=..SendRequestSync("HL7Out",req,.pOutput)
 quit sc
}
}

 

6/ I am thinking that the coding within Class PkgPhilTest3.Services.HL7Inbound is not as it should be, also perhaps a message class needs to be created (?)

7/ When the production is started, the following error is displayed:

 

HL7InboundFromSQL  Processing row ROW_ID '1000005' 

HL7InboundFromSQL  ERROR <Ens>ErrException: <CLASS DOES NOT EXIST>zOnProcessInput+1 ^PkgPhilTest3.Services.HL7Inbound.1 *ESQL.request -- logged as '-' number - @' set req=##class(ESQL.request).%New()'

 

8/ There are 11 rows in the SQL table, the above error is displayed for each row.

9/ Maximum HL7 record length coming in from SQL Server is unlikely to exceed 6,000 characters and the associated column in the SQL Server table is defined as varchar(max) – not sure if this is relevant or not.   Table definition as follows:

    CREATE TABLE [dbo].[ENSEMBLE_HL7](

               [ROW_ID] [int] IDENTITY(1000005,1) NOT NULL,

               [HL7MESSAGE] [varchar](max) NOT NULL,

 CONSTRAINT [PK_ENSEMBLE_HL7] PRIMARY KEY CLUSTERED

 

All suggestions gratefully appreciated.

 

Thanks,   Phil 

Andrew Makinson

unread,
Nov 19, 2016, 6:08:09 PM11/19/16
to Ensemble-in...@googlegroups.com
The first problem is that your ESQL.request class does not exist.

On the line with the error you asking for req to be a new instance of the class ESQL.request

I assume ESQL.request is trying to be a new request message? And you want to store an HL7 message inside it? This is not the approach you should be taking.

An HL7 message should either be or extend EnsLib.HL7.Message class. I wouldn't recommend extending it though.

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this group and stop receiving emails from it, send an email to Ensemble-in-Healt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Lawrence Harris

unread,
Nov 19, 2016, 8:33:44 PM11/19/16
to InterSystems: Ensemble in Healthcare
Just to be sure when you said you created a new namespace you are not putting the SQL code in a different namespace from the Enseble production are you? Execution across namespaces is ok but you need to make sure you are in the right place before you access the classes. The problem of ESQL.Requestnot being found suggests this.

icero...@gmail.com

unread,
Nov 20, 2016, 2:59:57 PM11/20/16
to InterSystems: Ensemble in Healthcare

Dom and Lawrence, thanks for the replies.      Dom – I think I will need to do some research on message classes and extending them etc. because I have very little experience with this kind of thing.    To explain – my background with regard to Interface Engines is all eGate based (Monk not Java) and we are currently in the process of migrating from eGate to Ensemble.   Yours truly landed the job of getting Ensemble and SQL Server to talk to each other and I’ve been hammering away at this problem on and off for a couple of weeks now.

 

Lawrence – if by 'SQL Code' you mean the select statement (select row_id, hl7message from dbo.ensemble_hl7) then this is located in the production GUI which resides within the specially created namespace.    The create table statement was included to provide extra information and resides within SQL Server.   Apart from that, the credential was created within this namespace and DSNs seem to be independent of namespaces.  

Andrew Makinson

unread,
Nov 20, 2016, 3:03:30 PM11/20/16
to Ensemble-in...@googlegroups.com
Iceroads123,

Feel free to message me at andy...@gmail.com or give me a shout on google hangouts on that address if you need more detailed help.

Happy to help guide you through this step by step.

Thanks
Andrew Makinson
(Dom)
Andy...@gmail.com



--

icero...@gmail.com

unread,
Nov 21, 2016, 4:42:55 AM11/21/16
to InterSystems: Ensemble in Healthcare

hi Andy,


Thanks for the offer of help, I was thinking it might be better to continue this conversation within this forum as it is quite possible there will be others who might find this thread to be useful.   Obviously there are coding errors within PkgPhilTest3.Services.Inbound, would it be true to say that once these are sorted out then things will start moving?    I am looking at an Intersystems pdf on SQL adapters but it would be good if you could provide a few pointers.

 

Regards,           Phil

Reply all
Reply to author
Forward
0 new messages