go to post Jeffrey Drumm · Jan 24, 2018 If the value you've fetched from the table is stored in a context variable, you can simply refer to the context variable as context.<variablename> in DTL invoked from within the BPL.
go to post Jeffrey Drumm · Jan 22, 2018 Thank you, Eduard.I'm still a bit concerned that this violates the abstraction layer, but I'm coming to the conclusion that there's just no other way.
go to post Jeffrey Drumm · Jan 19, 2018 If the Caché account name is the same as the OS account name, select System Administration | Security | System Security | Authentication/CSP Session Options and check Allow Operating System authentication. You'll automatically be logged on using an account with the same name as the OS account, assuming one has been created in Caché, and will have all permissions set for that account and its roles.If you don't care who you're logged in as, enable Allow Unauthenticated Access on the same page and make sure the UnknownUser account is enabled. You'll still be prompted for user/password, but you can press enter twice to bypass. You'll then have all permissions that have been set for UnknownUser and its associated roles.
go to post Jeffrey Drumm · Jan 18, 2018 You can treat a lookup table (Ens.Util.LookupTable) like any SQL table, using the LIKE operator to perform either "contains" ('%strval%') or "StartsWith" ('%strval') searches, but I don't think that's what you're really looking for. I'm thinking that, based on the logic you supplied, you're looking for two tables: One containing keys that you will use as "StartsWith" strings, and the other as "Contains" strings. You'd like to iterate through one table for your "Contains" comparisons, checking each AIL:3.2 against each key. And for your "StartsWith" comparisons, the other table. This would keep it maintainable in the Ensemble section of the Management Console, but you'd only really be populating the KeyName field. Wrapped in a couple of FunctionSet methods, this would simplify your rule considerably.But here are some examples of "Contains" vs. "StartsWith" queries against Ens.Util.LookupTable, just in case:ISYSDEV>>select KeyName from Ens_Util.LookupTable where TableName = 'ALLERGY_CODES' and KeyName LIKE '%mon%'12. select KeyName from Ens_Util.LookupTable where TableName = 'ALLERGY_CODES' and KeyName LIKE '%mon%'KeyNameAlmondsalmondscinnamonlemons4 Rows(s) Affectedstatement prepare time: 0.1417s, elapsed execute time: 0.0011s.--------------------------------------------------------------------------- ISYSDEV>>select KeyName from Ens_Util.LookupTable where TableName = 'ALLERGY_CODES' and KeyName LIKE 'cin%'13. select KeyName from Ens_Util.LookupTable where TableName = 'ALLERGY_CODES' and KeyName LIKE 'cin%'KeyNamecinnamon1 Rows(s) Affectedstatement prepare time: 0.0006s, elapsed execute time: 0.0003s.---------------------------------------------------------------------------
go to post Jeffrey Drumm · Jan 18, 2018 Barry, Source is the string value from the message header's SourceConfigName property, and source.%Source is an error:
go to post Jeffrey Drumm · Jan 17, 2018 The method takes the message object as its first argument, referenced by the variable Document in the Rule Editor. The call you should be making is, literally, CheckMrnDupForFac(Document,"CKS"). The method will parse the PID:3 and MRG:1 fields for you; you don't need to supply them literally.
go to post Jeffrey Drumm · Jan 17, 2018 The expression editor will often add a period after "Document" ... can you verify that you removed it?
go to post Jeffrey Drumm · Jan 17, 2018 Well, it can ... but you would need to contact the WRC for a version of ServerManager.exe that supports it:
go to post Jeffrey Drumm · Jan 15, 2018 Are you using the correct Context and RuleAssist for EnsLib.EDI.XMLDocument in your routing rule configuration? Here's the documentation link.
go to post Jeffrey Drumm · Jan 15, 2018 @Thembelani Mlalazi, he's specifically looking to get at the element %Source, which is not a field defined by the user in the RecordMap, and is not visible to the Context of the Rule.
go to post Jeffrey Drumm · Jan 15, 2018 @Thembelani, the %Source element is not directly accessible, even with the constraint set. That's why I provided the solution below.
go to post Jeffrey Drumm · Jan 13, 2018 Here's a potential solution. It's a method that will extract the %Source value from the message, and it should work for any Ensemble message type:Class User.Util.MsgBody Extends Ens.Rule.FunctionSet{ ClassMethod GetMsgSource(pMsg As Ens.Request) As %String { Return pMsg.%Source } }Since it extends Ens.Rule.FunctionSet, it's available as a function in the rule editor:
go to post Jeffrey Drumm · Jan 11, 2018 So, here's where the ability to write a little custom function in COS for use in the Routing Rule engine comes in handy. You may need to modify the HL7 paths depending on the schema you're using:Class User.Util.FunctionSet Extends Ens.Rule.FunctionSet{ ClassMethod CheckMrnDupForFac(pMsg As EnsLib.HL7.Message, pFac As %String) As %Boolean{ Set tPid3Cnt = pMsg.GetValueAt("PIDgrp(1).PID:3(*)") Set tMrg1Cnt = pMsg.GetValueAt("PIDgrp(1).MRG:1(*)") for i=1:1:tPid3Cnt { If pMsg.GetValueAt("PIDgrp(1).PID:3("_i_").5") = pFac { Set tPidMrn = pMsg.GetValueAt("PIDgrp(1).PID:3("_i_").1") for j=1:1:tMrg1Cnt { Set tMrgMrn = pMsg.GetValueAt("PIDgrp(1).MRG:1("_j_").1") if (pMsg.GetValueAt("PIDgrp(1).MRG:1("_j_").5") = pFac) && (tPidMrn '= tMrgMrn) { Return 1 } } } } Return 0} }(updated for readability/word-wrap)The method above will return true only when CKS entries exist in both fields and are different. Your specific needs may vary :)It will be available in the function drop-down list in the rule editor.
go to post Jeffrey Drumm · Jan 11, 2018 Thanks, Marc, that's what I'm doing now, including the creation of some custom functions to get at things like child node counts that aren't normally accessible via EnsLib.MsgRouter.RoutingEngine. An efficient mechanism for conversion of a Cache object to class EnsLib.EDI.XML.Document would have given me access to all of that VDoc's methods with minimal coding, though.
go to post Jeffrey Drumm · Jan 11, 2018 And if they're not always in the same repetition but the number of repetitions is fixed, it gets a little bit messy; you could do something like:HL7.{MRG:1.1} CONTAINS HL7.{PID:3(1).1}ORHL7.{MRG:1.1} CONTAINS HL7.{PID:3(2).1}ORHL7.{MRG:1.1} CONTAINS HL7.{PID:3(3).1}If they're completely arbitrary in the number of repetitions, you're gonna have to write some COS :)
go to post Jeffrey Drumm · Jan 11, 2018 Are the identifiers you are trying to compare always at the same position in each field, i.e. 3rd repetition? If yes, you should be able to use HL7.{PID:3(3).1}=HL7.{MRG:1(3).1} to compare them.
go to post Jeffrey Drumm · Jan 8, 2018 Are you sure that:The host is running HealthShare 2016.2 or later?The web server for HS/Caché is actually running on port 80? 57772 is the default for "stock" installations.
go to post Jeffrey Drumm · Jan 1, 2018 Ah, very good. Looks like I was on the right track; thanks for the confirmation!
go to post Jeffrey Drumm · Jan 1, 2018 Thank you so much for the detailed response, Eduard.Upon further reflection, though, I'm not sure this is exactly the solution I'm looking for. There may be multiple "sidelined" messages that are eligible for update from a single response; consider the situation where lab orders may be created in an external system for delivery to a Lab system, but the patient is registered in the Lab via a separate interface that is driven by a request made of the registration system by Ensemble. All orders for a given patient encounter would need to be held until the registration is received, but only one event will trigger the release (and enrichment) of all orders for that encounter.Assuming tokens are unique across all deferred responses, I'll need to create a token management system that supports a one-to-many relationship between the "public" token sent to/received from the external system and the "private" tokens that identify deferred messages eligible for update from a given deferred response. If a single token can satisfy the response requirement for multiple messages, though, that may not be necessary. If that capability is mentioned in the documentation, I haven't come across it yet.
go to post Jeffrey Drumm · Dec 30, 2017 Thank you, Eduard. As mentioned in my response to Robert, I need to understand the criteria that matches the response to the request given that they may be returned out of order. I'll take a look at the link you've provided.