Oui, but updating the whole system only because of this is not an option. I guess maybe an ad-hoc is the answer... :'( Let's see if someone else can come with another solution.
I'd be interested in that too. There must be an utility that simply emulates what the patient viewer is doing, so calling it using the MPIID should give back all the information from a patient, including demographics and encounters data.
I simply can't find it, but I'm pretty sure it's there. Anyone knows?
I use this on Windows to automatically restart any instance. Probably simply changing "\" by "/" will do the trick, and change stopstart for stop:
//restart instance
d ##class(Ens.Director).StopProduction(1,1)
set cmd=$P($ZU(12),"\",1,$L($ZU(12),"\")-2)_"\bin\iris stopstart "_$P($ZU(86),"*",2)
d $zf(-2,cmd)
I know it's quite old and maybe it's solved, but I had a similar issue with the message ERROR #815: User not authorized for service %Service_WebGateway
In my case, the problem was in the resources setup (/csp/sys/sec/%25CSP.UI.Portal.Resources.zen). By giving public permission to the gateway , the system started to work:
Just for fun, or to see if AI matches the experts, I've asked the question to Mixtral. This is what it is explaining:
Yes, I can certainly explain the difference between %ResultSet.SQL and %SQL.Statement in Intersystems Cache ObjectScript.
%ResultSet.SQL is a class that provides a result set interface for executing SQL queries. It allows you to iterate over the rows returned by a SQL query and access the columns as properties of each row. Here's an example of how to use %ResultSet.SQL:
SET rs = ##class(%ResultSet.SQL).%Open("SELECT * FROM mytable")
DO WHILE (rs.%Next()) {
SET column1 = rs.column1
SET column2 = rs.column2
// Do something with the columns
}
rs.%Close()
On the other hand, %SQL.Statement is a class that provides a statement interface for executing SQL queries. It allows you to prepare a SQL statement and then execute it multiple times with different parameter values. Here's an example of how to use %SQL.Statement:
SET stmt = ##class(%SQL.Statement).%New()
DO stmt.%Prepare("SELECT * FROM mytable WHERE column1 = :val1 AND column2 = :val2")
DO stmt.%Execute(val1, val2)
DO WHILE (stmt.%Fetch()) {
SET column1 = stmt.column1
SET column2 = stmt.column2
// Do something with the columns
}
stmt.%Close()
In summary, the main difference between %ResultSet.SQL and %SQL.Statement is that %ResultSet.SQL is used for iterating over the rows returned by a SQL query, while %SQL.Statement is used for preparing and executing a SQL statement multiple times with different parameter values.
Yes, I would totally recommend running it after any version upgrade. Won't do any harm, and surely solve issues related to changes on depending intersystems classes.
Who needs the flexibility and scalability of a database when you can just hardcode everything into the source code? I'm sure that'll make maintenance and updates a breeze.
Coming from someone with the PI expert badge, I take it as the near-official reason. Thanks for your help :-)
Yes, that's what I finally did. But I was hoping there was some other way around "cleaner". It's kind or surprising to me that the parameters are not stored on a global, but it's just a class created with the values hard-coded in it.
But this is the kind of things I would definetely take advantage of embeded python to speed up the development. To send a message using python, few lines of code are needed:
import pymsteams myTeamsMessage = pymsteams.connectorcard(url) # Initialize the connector card with webhook URL myTeamsMessage.text("This message will end up in team") # Message content myTeamsMessage.send() # Send the message
You can use this set of instructions to compact and truncate any database:
s $namespace="%SYS", Percentage=100, Databasedir="d:\whatever" d ##class(SYS.Database).CompactDatabase(Databasedir,Percentage) d ##class(SYS.Database).GetDatabaseFreeSpace(Databasedir, .FreeSpace) d ##class(SYS.Database).FileCompact(Databasedir, FreeSpace, .ActualFree) d ##class(SYS.Database).ReturnUnusedSpace(Databasedir,0,.newsize)
Very nice article, embedding the python into cache itself without any classmethod fully coded as [Python]. If you are ok, I might try this code in real case scenario ;-)
This is basically same approach as mine, but straight with one single SQL operation.
Even if it works (it does, I've tested), in a database with potentially millions of records it seems to me that we would be missing background and multi-thread capacities. But by looking at the documentation I've been unable to find any method for that purpose.
Sorry for the delay. You were absolutely right, I wasn't forwarding port 1972 but 51773! I just added 1972 and call the JDBC using this port and now it works like a charm.
Actually, when the container is running the error is different than when it's stopped, so I guess my python script really reaches the jdbc server but somehow is not accepted.
Container running:
java.sql.SQLException: java.sql.SQLException: [InterSystems IRIS JDBC] Communication link failure: Communication error: Server closed communication device
Container stopped:
java.sql.SQLException: java.sql.SQLException: [InterSystems IRIS JDBC] Communication link failure: S’ha refusat la connexió (Connection refused)
go to post
Hi Guillaume,
Oui, but updating the whole system only because of this is not an option. I guess maybe an ad-hoc is the answer... :'( Let's see if someone else can come with another solution.
go to post
Hello Eddy,
You might try this:
There is an AddFacility method in HS.Hub.HSWS.WebServicesClientAPI.
go to post
Hi Alexander,
before running the second command, and in order to get the right numbers, shouldn't you clear the buffers so system takes it again from the disk?
go to post
I'd be interested in that too. There must be an utility that simply emulates what the patient viewer is doing, so calling it using the MPIID should give back all the information from a patient, including demographics and encounters data.
I simply can't find it, but I'm pretty sure it's there. Anyone knows?
go to post
I use this on Windows to automatically restart any instance. Probably simply changing "\" by "/" will do the trick, and change stopstart for stop:
go to post
Hello,
I know it's quite old and maybe it's solved, but I had a similar issue with the message ERROR #815: User not authorized for service %Service_WebGateway
In my case, the problem was in the resources setup (/csp/sys/sec/%25CSP.UI.Portal.Resources.zen). By giving public permission to the gateway , the system started to work:
Hope this helps!
go to post
Just for fun, or to see if AI matches the experts, I've asked the question to Mixtral. This is what it is explaining:
go to post
Yes, I would totally recommend running it after any version upgrade. Won't do any harm, and surely solve issues related to changes on depending intersystems classes.
go to post
Who needs the flexibility and scalability of a database when you can just hardcode everything into the source code? I'm sure that'll make maintenance and updates a breeze.
Coming from someone with the PI expert badge, I take it as the near-official reason. Thanks for your help :-)
go to post
Hi Stephen,
Yes, that's what I finally did. But I was hoping there was some other way around "cleaner". It's kind or surprising to me that the parameters are not stored on a global, but it's just a class created with the values hard-coded in it.
Thanks for your help, in any case :)
go to post
This is great Kurro!
But this is the kind of things I would definetely take advantage of embeded python to speed up the development. To send a message using python, few lines of code are needed:
import pymsteams
myTeamsMessage = pymsteams.connectorcard(url) # Initialize the connector card with webhook URL
myTeamsMessage.text("This message will end up in team") # Message content
myTeamsMessage.send() # Send the message
go to post
Hi,
You can use this set of instructions to compact and truncate any database:
s $namespace="%SYS", Percentage=100, Databasedir="d:\whatever"
d ##class(SYS.Database).CompactDatabase(Databasedir,Percentage)
d ##class(SYS.Database).GetDatabaseFreeSpace(Databasedir, .FreeSpace)
d ##class(SYS.Database).FileCompact(Databasedir, FreeSpace, .ActualFree)
d ##class(SYS.Database).ReturnUnusedSpace(Databasedir,0,.newsize)
go to post
Hi Michael,
I'm afraid the only way is to insert the record using SQL and use the %NOTRIGGER and %NOINDEX keywords to prevent the actions.
go to post
Hi Veera,
Very nice article, embedding the python into cache itself without any classmethod fully coded as [Python]. If you are ok, I might try this code in real case scenario ;-)
Best regards
go to post
Hi Eduard,
This is basically same approach as mine, but straight with one single SQL operation.
Even if it works (it does, I've tested), in a database with potentially millions of records it seems to me that we would be missing background and multi-thread capacities. But by looking at the documentation I've been unable to find any method for that purpose.
Thanks for the answer, anyway! :-)
go to post
Finally opened a WRC and got an answer: update to 2021.1 as categories have much improved. :)
go to post
Hi Marcio!
You did a hell of a job here! :-) But I was looking for a specific in-build solution.
go to post
Hi Sean,
Sorry for the delay. You were absolutely right, I wasn't forwarding port 1972 but 51773! I just added 1972 and call the JDBC using this port and now it works like a charm.
Thanks!
go to post
Hi Dmitriy,
Correction: it's not ODBC by JDBC
Actually, when the container is running the error is different than when it's stopped, so I guess my python script really reaches the jdbc server but somehow is not accepted.
Container running:
java.sql.SQLException: java.sql.SQLException: [InterSystems IRIS JDBC] Communication link failure: Communication error: Server closed communication device
Container stopped:
java.sql.SQLException: java.sql.SQLException: [InterSystems IRIS JDBC] Communication link failure: S’ha refusat la connexió (Connection refused)
go to post
I'm working in Linux (Ubuntu)