go to post Enrico Parisi · Mar 10 I know this is an old question, but in case someone will search for the same question, another option (better, IMHO) is to use: $$$ClassSQLTable("my.ClassName") In case you need it for current class: $$$ClassSQLTable($classname()) To use the $$$ClassSQLTable macro your class needs: Include Ensemble
go to post Enrico Parisi · Mar 4 select count(*) from (select SessionIdfrom Ens.MessageHeaderwhere TimeCreated between '2025-02-01 00:00:00' and '2025-02-28 23:59:59'group by SessionId)
go to post Enrico Parisi · Mar 4 Ciao Riccardo, <PROTECT> error, evidently the caller or the web application does not have enough permission. Is the caller being authenticated? How? What user? What roles has the user? Check the associated Web Application authentication and the user used by the caller to connect to your (FHIR) Web Application.
go to post Enrico Parisi · Feb 28 To get the XML rule definition from SQL you can write/define a stored procedure that returns the XML rule definition, then....parse the XML. Something like: Class Community.Rule.XDATA { ClassMethod GetXML(RuleName As %String) As %String(MAXLEN="") [ SqlProc ] { Set xdataOBJ = ##class(%Dictionary.XDataDefinition).IDKEYOpen(RuleName,"RuleDefinition") Quit xdataOBJ.Data.Read($$$MaxLocalLength) } } Then from SQL: select Community_Rule.XDATA_GetXML('Your.Rule.Name')
go to post Enrico Parisi · Feb 14 Whatever you use, portal, code or SQL, I'd suggest NOT to delete the suspended messages. If you delete a message, only the message header will be deleted, leaving all the associated requests/responses orphaned. I suggest discarding the messages using SQL. Be careful doing so with a single update SQL statement for 2M messages, with more that 1000 records lock escalation will lock the entire Ens.MessageHeader table/class and your production will have big trouble. To avoid it use %NOLOCK. Using Display mode: Update %NOLOCK Ens.MessageHeader set Status ='Discarded' where Status = 'Suspended' Using Logical or ODBC mode: Update %NOLOCK Ens.MessageHeader set Status = 4 where Status = 5
go to post Enrico Parisi · Feb 10 That property contains the last run status of a specific task, so first you need to know what task you are interested and then open that task and get the last status, like: Set BckTask=##class(Backup.Task).%OpenId("FullDBList") Set status=BckTask.LastRunStatus
go to post Enrico Parisi · Feb 2 I think/guess you are using the wrong port number in vs code. Vs code uses the web server port to connect to IRIS. What port do you use to connect to the IRIS Management Portal? Likely you are using port 80 and/or 443, the same port should be used in vs code.
go to post Enrico Parisi · Jan 22 There is no such a stream you are looking for. Data is sent to the browser (via WEB Gateway and WEB Server) as you write it from your CSP page/application, IS NOT held in a stream and sent "at the end" (what's the end BTW?).
go to post Enrico Parisi · Jan 17 I doubt it's possible to change the prefix in your use case (using virtual XML doc.). The produced xml is perfectly valid and compliant to the xds, changing the prefix makes no sense.
go to post Enrico Parisi · Jan 16 To me it looks that the remote system (147.185.133.137) it's connecting and then disconnect before sending any data.Maybe setting Archive IO can provide some hint, but I'm not sure what happen with Archive IO when no data is received, like seems in this case. I would try to test/connect using something like Postman and see if it works as expected. Please note that %GlobalCharacterStream class in deprecated in favor of %Stream.GlobalCharacter class. I'm puzzled by the line: That method convert an object to a stream, but in fact you are passing a stream and it seems you expect it returns an object. Also note that this two lines: don't do anything, you can safely remove them.
go to post Enrico Parisi · Jan 14 To exchange (in/out) ObjectScript collections (arrays/lists) and streams to/from Java using the new $system.external interface you use the "magical undocumented" %getall() and %setall() methods. You can get some sample code of using it in the Open Exchange project samples-dynamicgateway-java. For example for streams you can try something like: w !,"TRY #"_$I(TEST) #Dim argc As %Stream.GlobalCharacter = ##Class(%Stream.GlobalCharacter).%New() do argc.Write($C(40)) do argc.Write($C(41)) Set bytesArrayIn=javaGate.new("byte["_argc.Size_"]") Do bytesArrayIn.%setall(argc) do test.testByteArr(bytesArrayIn)
go to post Enrico Parisi · Jan 13 Sorry, I forgot to mention that to implement properly ACID you need transactions AND locking mechanism using LOCK command.
go to post Enrico Parisi · Jan 10 To my knowledge there is no Action to log an entry in the Interoperability Event Log, but it can be achieved using a custom function. What you can do is implementing a function as documented in Defining Custom Utility Functions. Something like: Class MyPackage.CustomFunctions Extends Ens.Rule.FunctionSet { /// Log an INFO type message in the Iteroperability Event Log ClassMethod LogInfo(Message as %String) As %String { $$$LOGINFO(Message) Quit Message } } Then in your Rule add a Debug action that call/use the function: Then, in the Business Process where the Rule is used, add the "d" flag to the RuleLogging settings: Thisway you will have your message logged in the event log AND in the rule log.
go to post Enrico Parisi · Jan 6 As @Chandrasekar Angaiah pointed out you need to create a new class that extends EnsLib.SQL.InboundAdapter and then you use the new class instead of EnsLib.SQL.InboundAdapter. Within that new class override OnInit(), something like: Class My.SQL.InboundAdapter Extends EnsLib.SQL.InboundAdapter { Method OnInit() As %Status { Set sc=##super() If $$$ISOK(sc) Set ..%Row.MaxRowsToGet=-1 Quit sc } }
go to post Enrico Parisi · Jan 5 Ciao Fabrizio, access to the HealthShare Management portal section (also known as HS Navigation app) can be granted using the %HSAdmin_NavAppConfigurationManagement resource or the %HS_NavigationApp role. Once your user has that role or resource it can access the HS Navigation app page. Within that page there are many"functionality" and they have their own permissions/resources associated that the user must have to perform the functionality. So, with only access to HS Navigation app (and no other role/resource) you see an empty page. It's not clear what functionality you need/want to enable and if you need read/write permissions. Long story short, I suggest to create a new role, during creation copy from %HS_Administrator role and then remove resources you don't need (there maybe many you don't need/want) and the modify R/W permissions for the resource.
go to post Enrico Parisi · Jan 5 Ciao Fabrizio, in your machine edit the hosts file and add the FQDN of your HS server so it can be resolved and then use the FQDN in the browser instead of the IP address.
go to post Enrico Parisi · Jan 3 Remember, what you write in/from that method is javascript. I think the simplest solution for debugging is using javascript alert(), another option can be injecting your debug info into page html/dom using javascript (this depend on page structure).For simple alert() you can: Set sc = sftp.Get(remoteFile, localFile, "0666") If $$$ISERR(sc) { &js< alert(#(..QuoteJS("Error downloading file: "_fileName_" -> "_$system.Status.GetErrorText(sc)))#);> } else { &js< alert(#(..QuoteJS("File Successfully Downloaded"_fileName))#);> }
go to post Enrico Parisi · Jan 3 Hi @Andreas Schneider, you can create a SQLGateway connection using ObjectScript code, if you create it using SQL then, as you discovered, you have an issue with the password because using ObjectScript the password is "processed" before saving it. If you want/need a pure SQL solution without (directly) coding/using ObjectScript you can define and use a Stored Procedure (that use ObjectScript 😉) to change the password, something like: CREATE PROCEDURE Community_SqlGw.SetPassword(ConnectionName VARCHAR(50), NewPassword VARCHAR(50)) RETURNS BIT LANGUAGE OBJECTSCRIPT { New gw,sc Set gw=##class(%SQLConnection).NameIndexOpen(ConnectionName) If gw="" Quit 0 Set gw.pwd=NewPassword Set sc=gw.%Save() Quit (sc=1) } Then, after creating the GW Connection, change the password: select Community_SqlGw.SetPassword('MyGwConnectionName','MyGwPassword')
go to post Enrico Parisi · Dec 30, 2024 In your sample code AltOrEmpty property contains a not null value of Mandatory property or $c(0), so: set testInstance = ##class(TestIndex).AlternateMandatoryOpen(2,$c(0),.st)
go to post Enrico Parisi · Dec 13, 2024 Is return supposed to return a boolean (0/1) or the non empty value of check1? I'm asking because you write "will return false even for non-empty strings (due to conversion to integers for string prefixes)". In general to check for not empty string (check1'="") is used. If you need to return a boolean depending of empty/not empty, then you can use: return (check1'="")