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.
go to post Jeffrey Drumm · Dec 30, 2017 Thank you, Robert. This sounds promising and I will look into it.Most importantly, I need to understand the criteria upon which the response is matched to the request (and therefore the message that triggered the request), since there's no guarantee that the responses will return in the same order the requests are made.
go to post Jeffrey Drumm · Dec 28, 2017 In Studio's Tools menu, select Options, Environment, Documentation and Proxy. Check "Templates and add-ins will use Proxy server for <hostname>." Enter the address (including 'https://' if you're using SSL/TLS) and port number for your standalone web server. Click Apply.You may have to re-authenticate each time you select a template, but at least you'll be able to get to them (and I'm sure there's a way around that too).
go to post Jeffrey Drumm · Dec 22, 2017 Yes I did, just to see what would happen ... none of my properties are of numeric type, sadly
go to post Jeffrey Drumm · Dec 22, 2017 Hmm. If " is is escaped as \", and the value consists of a single " (or ends with ") then it appears as \"" in the JSON output. A simple $REPLACE becomes a slightly less simple $REPLACE(json, ":""""", ":null""") , with fingers crossed that the output from %ToJSON isn't prettified in the future...Certainly not the end of the world, but I'm a bit concerned that it's the start of a trip down the rabbit hole
go to post Jeffrey Drumm · Dec 21, 2017 Thank you, Eduard.My need is relatively unsophisticated, at least in my mind :)I'm modeling a JSON request payload for a web service as a Persistent class ("Patient") that will be used as the message body for an Ensemble Request (of type Ens.Request). The Patient object will be populated from HL7v2 or possibly other sources via a DTL, and the target HTTP operation will serialize the message body to JSON for submission to an external web service.Your suggestions have given me 98% of what I need ... but I'd like to represent unpopulated values as null rather than "" and/or simply omit keys with null values from the resulting JSON. There are format options for some of the %ZEN.Auxiliary.altJSONProvider methods, but none seem to provide that sort of control (and I swear I saw one or both of my desires addressed in one of the DC threads on JSON serialization but can't find it again).substituting null for "" is a relatively simple $REPLACE operation; scraping out un-valued keys is perhaps a bit more complicated.Thanks for clarifying the current status of the new JSON methods. I'm hoping any current issues get resolved soon.
go to post Jeffrey Drumm · Dec 21, 2017 Thanks, Eduard.So the functionality that a number of posters demonstrated here, where %ToJSON() (or $toJSON()) seemed to have been rolled into Persistent and Registered objects at some point was subsequently removed? This thread is very confusing ...
go to post Jeffrey Drumm · Dec 20, 2017 So did this ever happen? I'm on 2017.2 and the only output I get is <SYNTAX>. I'll post some code if needed, but it's a straightforward persistent object that I'm using as the payload for an Ensemble Ens.Request object.
go to post Jeffrey Drumm · Nov 23, 2017 For checking the progress of deletion of older messages, just bring up the message viewer and set the Sort Order to Oldest First and the Time Format to Complete. Each time you click the Search button, you should see progressively "newer" messages as the older ones are purged.
go to post Jeffrey Drumm · Nov 16, 2017 So, putting it all together ...NOTE: This is NOT production-ready code. There's no error handling or input validation. You get to add that stuff yourself :)Class User.HL7.Operation.Email extends Ens.BusinessOperation { Parameter ADAPTER = "EnsLib.EMail.OutboundAdapter"; Property Adapter As EnsLib.EMail.OutboundAdapter; Parameter INVOCATION = "Queue"; Method SimpleMessage(pInput As EnsLib.HL7.Message, Output pOutput As Ens.Response) As %Status{ Set email=##class(%Net.MailMessage).%New() Set addr = pInput.GetValueAt("PID:13.4") Do email.To.Insert(addr) Set email.Subject="The subject of your message" Do email.TextData.Write("This is the body of your message.") Set tSc=..Adapter.SendMail(email) //send an empty response message after message is sent Set pOutput=##class(Ens.Response).%New() Quit $$$OK} XData MessageMap {<MapItems> <MapItem MessageType="EnsLib.HL7.Message"> <Method>SimpleMessage</Method> </MapItem></MapItems>} }
go to post Jeffrey Drumm · Nov 16, 2017 Scrubbed my existing Eclipse installation and re-installed Oxygen, then the Atelier plugin. So far, so good.
go to post Jeffrey Drumm · Nov 16, 2017 Yikes. The update installed successfully but won't even start for me.
go to post Jeffrey Drumm · Nov 8, 2017 You specify the schema to use in the "Message Schema Category" field of the of the inbound Business Service's configuration.