Is the table going to change much? If it isn’t then you would be better to populate an Ensemble lookup table from the SQL table. Or is this what you mean?
Assuming you can use an Ensemble lookup then the condition should take place in a routing process and would look something like this…
If the table is frequently changing then you may be better with a custom function if maintenance of a lookup table would be too much. Let me know if you need one of these.
Regards
Dave
|
|
From: ensemble-in...@googlegroups.com [mailto:ensemble-in...@googlegroups.com]
On Behalf Of Priya
Sent: Tuesday, June 27, 2017 1:04 PM
To: InterSystems: Ensemble in Healthcare <Ensemble-in...@googlegroups.com>
Subject: [InterSystems-EnsHlth] Ens.Rule.FunctionSet
Can someone help me to write a custom function for SQL table lookup ? I want to filter hl7 messages based on a certain field and if that value is not found in table to drop the message.
thank you,
Priya
--
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.
Is the table going to change much? If it isn’t then you would be better to populate an Ensemble lookup table from the SQL table. Or is this what you mean?
Assuming you can use an Ensemble lookup then the condition should take place in a routing process and would look something like this…
If the table is frequently changing then you may be better with a custom function if maintenance of a lookup table would be too much. Let me know if you need one of these.
Regards
Dave
David Blake
Technical Specialist - Integration | InterSystems
Direct: +44 01753 855450 | Mobile: +44 7852 265557
InterSystems.com
From: ensemble-in...@googlegroups.com [mailto:ensemble-in-healt...@googlegroups.com] On Behalf Of Priya
Sent: Tuesday, June 27, 2017 1:04 PM
To: InterSystems: Ensemble in Healthcare <Ensemble-in...@googlegroups.com>
Subject: [InterSystems-EnsHlth] Ens.Rule.FunctionSet
Can someone help me to write a custom function for SQL table lookup ? I want to filter hl7 messages based on a certain field and if that value is not found in table to drop the message.
thank you,
Priya
--
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-i...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healthcare-unsub...@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-Healthcare+unsub...@googlegroups.com.
There are a number of issues here, I think.
First of all, this type of code requires that it is in a service or operation that uses one of our SQL adaptors. Normally, it would use the adaptors execute statement to perform the SQL and retrieve the results.
This is not your case here, so you will need to embed the SQL. This itself requires that the code is ran in the same namespace as the table is stored.
Assuming that is the case you can use something like this…
Class Test.MsgRouter.CustomFunctions Extends Ens.Rule.FunctionSet
{
ClassMethod CheckPatientType(ptMRN As %String, ptVisitNumber As %String) As %Boolean
{
&SQL (Select Count(*) into :tPTCount from dbo.table where MRN = :ptMRN and VisitNumber = :ptVisitNumber and PatientType=’I’)
Q ((tPTCount>0))
}
}
Please try this and let me know if you need anything further
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.
--
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.
Is the table going to change much? If it isn’t then you would be better to populate an Ensemble lookup table from the SQL table. Or is this what you mean?
Assuming you can use an Ensemble lookup then the condition should take place in a routing process and would look something like this…
If the table is frequently changing then you may be better with a custom function if maintenance of a lookup table would be too much. Let me know if you need one of these.
Regards
Dave
David Blake
Technical Specialist - Integration | InterSystems
Direct: +44 01753 855450 | Mobile: +44 7852 265557
InterSystems.com
From: ensemble-in...@googlegroups.com [mailto:ensemble-in-healt...@googlegroups.com] On Behalf Of Priya
Sent: Tuesday, June 27, 2017 1:04 PM
To: InterSystems: Ensemble in Healthcare <Ensemble-in...@googlegroups.com>
Subject: [InterSystems-EnsHlth] Ens.Rule.FunctionSet
Can someone help me to write a custom function for SQL table lookup ? I want to filter hl7 messages based on a certain field and if that value is not found in table to drop the message.
thank you,
Priya
--
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-i...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healthcare-unsub...@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-Healthcare+unsub...@googlegroups.com.