go to post Hannah Sullivan · Feb 5 Additionally, non SQL, there is a built in function for this of if ##class(Security.Users).Exists("John") { // user exists } which confirms if the IRIS user exists using the users username (here, assuming username of John). Documentation on the Security.Users docs page.
go to post Hannah Sullivan · Oct 16, 2024 Hi Alin, Looking in the Caché & Ensemble 2018.1.4 – 2018.1.9 documentation there is a class %OAuth2.JWKS with method AddOct() for Cache almost identical to the one you described above for IRIS. This method is available for Cache 2018.1.9 the version you listed in your question. Hope this documentation helps. For others reference w.r.t. IRIS, the method and class you described above are deprecated in later versions of IRIS and %Net.JSON.JWK or %Net.JSON.JWKS should be used instead.
go to post Hannah Sullivan · Sep 18, 2024 Hi John, In the same class %ZEN.Auxiliary.jsonProvider that you used for the JSON to Object version there is another method %ObjectToJSON which I believe is what you are looking for. This will write out the contents of object instance pObject to the current device using JSON notation. Another slightly different option is to use the %DynamicAbstractObject class and methods %FromJSON which given a valid JSON string will parse it and return an object of datatype %DynamicAbstractObject and %ToJSON which will convert an instance of %DynamicAbstractObject into a JSON string. Please note that the version of Documentation I consulted for these was Cache and Ensemble Version 2018.1.9
go to post Hannah Sullivan · Sep 17, 2024 Another possible solution to this, ClassMethod PadNumberWithZeros(number As %String, ln As %Integer) As %String { set num = number while $length(num) < ln { set num = "0" _ num } return num } Returns 0000025 for 25 and 0000009 for 9 for the provided test cases
go to post Hannah Sullivan · Aug 14, 2024 Upon further debugging, the line set template = ##class(%Library.RoutineMgr).%OpenId(templateName) in the ObjectScript method returns an empty object if it could not find the expected template for templateName. For the case where we called the method from ObjectScript it was able to find the expected template and opened. When called from the Language = python method we needed to have an explicit Load of the template file prior to the method call. We resolved this by adding do $$$AssertStatusOK(##class(pkg.isc.airspeed.API).Load(<directory>_"_resources/trivial.vm","ck")) prior to the call to Merge. Calling the load before the MergeInternal() method call resolved the issue.
go to post Hannah Sullivan · Aug 7, 2024 Hi Krishnaveni, $HOROLOG is an ObjectScript special variable that contains the local date and time for the current process. It can be used to grab the current date and time for the comparison. I used $zdatetime to convert the $HOROLOG (in my code shortened with $h) to convert the current time to the same format you provided as YYYY-MM-DD HH:MM:SS. Currently as I did this the value returned was 2024-08-07 13:46:13. > w $zdatetime($h, 3) 2024-08-07 13:46:13 Then, a classmethod Diff() from class %Library.UTC can be used to perform the difference calculation and returns the difference in seconds. > w ##class(%Library.UTC).Diff($zdatetime($h,3), "2024-08-07 17:58:51.563") -15063.563 Returns value in seconds that the time you provided is 4 hours and 11 minutes ahead the current time.
go to post Hannah Sullivan · Apr 17, 2024 Hi Pietro, Product version is IRIS 2023.1 does not have an arrayref() reference creation function built in. It is likely you are viewing a more recent version of IRIS documentation which does include arrayref(). This documentation InterSystems IRIS Python Module Core API is specific to your version of 2023.1 and lists the available reference creation functions of cls(), gref(), ref(). This is why the example code using arrayref() is not working for you. One option is to upgrade to IRIS 2023.2 which does include arrayref().
go to post Hannah Sullivan · Apr 15, 2024 Hi Alexandra, If you switch from the Terminal tab to the Output tab and then select ObjectScript from the options dropdown, you will be able to see the compilation status for classes and tables. This will tell you the compilation errors for if / why your classes are not compling.
go to post Hannah Sullivan · Sep 14, 2023 Thank you for the assistance Evan - this solved my problem.
go to post Hannah Sullivan · Aug 29, 2023 The list type of Organizations existed prior to the changes I am making and is in use within the application in other places. As such I was ideally hoping implement the cascade deletion without changing that type. However, a Parent/Child relationship as both you and @Iryna Mykhailova suggested is a great option for the automatic cascade deletion and I will definitely consider the benefits of that change. Thank you!
go to post Hannah Sullivan · Aug 29, 2023 Thank you for the clarification. For the given situation, there would never exist multiple lists that hold the same organization object. Following your example, my tables would be as such. Organization ID 1 2 3 4 5 GetOrgUpdatesResponse ID Organizations 1 2 2 1,3 3 4,5 So that there would not exist a situation where a deletion of a list in GetOrgUpdatesResponse would result in any other list containing incorrect data.