SQL Server DB on external server Query within DTL

96 views
Skip to first unread message

R Ali

unread,
Apr 14, 2011, 5:31:45 AM4/14/11
to InterSystems: Ensemble in Healthcare
We have a DB which stores a lot of our PAS data and would like to pull
a identifier based on an alias we get from a foreign system via
messaging.

What I would like to do, is query this external system for data based
on the alias we have. Bit like a Lookup table within Ensemble but
seeing as this information exists on this DB already, one less thing
to maintain (i.e. Lookup table).

A form of connect and then query retrive and populate whilst doing the
DTL, or acheiving this in a round about way?

I havent done anything previously and sure Ensemble is capable, but
wondered if anyone had used such a method previously and if so how I
go abouts doing this.

Any help or where to look would be great :)

Many Thanks

David Loveluck

unread,
Apr 14, 2011, 6:07:18 AM4/14/11
to ensemble-in...@googlegroups.com
You have two choices. You can use the SQL gateway to configure the external table as a linked table. You can then write SQL in Ensemble query the table directly. It is probably best to write a function that wraps that SQL and call the function from your DTL.

The alternative is to use BPL to process the message and a Business Operation to communicate with the external database with the SQL Outbound adapter. The BP would send a request to the BO and then use the response in processing the message.

The gateway approach allows makes the processing of the message easier but the BPL approach is allows you much more control in configuring access to the remote database (credentials, DSN etc.) and is more robust in cases where the remote database can't be reached for some reason.

Dave

Many Thanks

--
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

Ali Ruhul (RQ8) Mid Essex Hospital

unread,
Apr 14, 2011, 6:15:27 AM4/14/11
to ensemble-in...@googlegroups.com
Many Thanks Dave, will look into both, but whichever is easiest really with minimal fuss suits me more so.

Looking up the Ensemble Gateway via the documentation.

If anyone has any examples of such a function and its calling in DTL would be most appreciated.

Many Thanks

Dave

Many Thanks

Mid Essex Hospital Services NHS Trust Caring for you, Caring about you.

Information in this message may contain confidential and privileged information. If you are not the intended recipient please accept our apologies; please do not disclose, copy or distribute information in this e-mail or take any action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray before deleting it.

Content of emails received by this Trust will be subject to disclosure under the Freedom of Information Act 2000. Unless the information is legally exempt from disclosure, confidentiality of this e-mail and your reply cannot be guaranteed. Thank you for your co-operation.

Graham, Ben

unread,
Apr 14, 2011, 10:01:01 AM4/14/11
to ensemble-in...@googlegroups.com
At Inland Imaging, we use the BPL method with several of our interfaces, and it does work well.
Specifically, it handles DB downtimes cleanly.

I would recommend the BPL solution.

-Ben

Many Thanks

Dave

Many Thanks

This electronic transmission and any documents accompanying this electronic transmission may contain information that is confidential and/or legally privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this message immediately.

Ali Ruhul (RQ8) Mid Essex Hospital

unread,
Apr 14, 2011, 10:58:36 AM4/14/11
to ensemble-in...@googlegroups.com
Many thanks Ben,

You wouldn't by any chance have any test/dummy BPL's that you might be able to send?

Looking at a BPL setup would prob be best way to get my head round it.

I already have a routing rule set for the collection of messages already, so something that would slot in to my current setup would be brilliant amongst my existing routing setup would be excellent.

Gary

unread,
Apr 14, 2011, 11:36:44 AM4/14/11
to InterSystems: Ensemble in Healthcare
We have approached this using the BPL option, we created a method in
the code view of the BPL which calls ..SendRequestSync (we call this
from a code activity using process.MethodName etc.) and passes the
business operation, and the two request / response messages:

...
set tSC = ..SendRequestSync("SQLLookup", msgRequest, .IRResp)

if $$$ISOK(tSC)
{
quit IRResp
}
else
{
$$$TRACE(tSC)
quit IRResp
}

We believe we have to do this in order to wait for the response from
the business operation before moving on. The business operation
basically uses the EnsLib.SQL.OutboundAdapter
and ..Adapter.ExecuteQuery method to query the SQL database. We also
set the ReplyActionCodes to E=D on the bpl so if the database could
ever not be queried (i.e. if the SQL server was down etc.) then the
bpl would be disabled.

I can't say whether this is the best approach or not as it was our
first go at doing something like this as we are fairly new to Ensemble
but it seems to work fine for us and handles the issue of the SQL db
being unavailable which we could not seem to handle very well using
the Gateway option.

Regards,
Gary


On Apr 14, 3:58 pm, "Ali Ruhul (RQ8) Mid Essex Hospital"
> For more options, visit this group athttp://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 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 athttp://groups.google.com/group/Ensemble-in-Healthcare?hl=en
>
> Mid Essex Hospital Services NHS Trust Caring for you, Caring about you.
>
> Information in this message  may contain  confidential and privileged information.  If you are not the intended recipient please accept our apologies; please do not disclose,  copy or distribute information in this e-mail or take any  action in reliance on its contents: to do so is strictly prohibited and may be unlawful. Please inform us that this message has gone astray  before  deleting it.
>
> Content of emails received by this Trust will be subject to disclosure under the Freedom of Information Act 2000. Unless the information is legally exempt from disclosure, confidentiality of this e-mail and your reply cannot be guaranteed. Thank you for your co-operation.
>
> --
> 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 athttp://groups.google.com/group/Ensemble-in-Healthcare?hl=en
>
> This electronic transmission and any documents accompanying this electronic transmission may contain information that is confidential and/or legally privileged. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or the taking of any action in reliance on or regarding the contents of this electronically transmitted information is strictly prohibited. If you have received this e-mail in error, please notify the sender and delete this message immediately.
>
> --
> 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 athttp://groups.google.com/group/Ensemble-in-Healthcare?hl=en
>
> Mid Essex Hospital Services NHS Trust Caring for you, Caring about you.- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages