Thank you @Liubov Zelenskaia
- Log in to post comments
Thank you @Liubov Zelenskaia
Thank you! @Muhammad Waseem
Thank you for recognition and kudo to the team!
Thanks @Prasanth Annamreddy
Thanks @Vachan C Rannore
Thank you @Irène Mykhailova
I’m incredibly grateful for the opportunity to serve as a Community Moderator in the InterSystems Community! Thank you for the trust and recognition. I’m excited to continue contributing actively and supporting our amazing community.
Thank you!
Hi everyone! 👋
I’m based in India and would love to join a Random Coffee Chat ☕
Availability: Mon–Fri, 11:00–20:00
Happy to connect and chat!
Done!
Hi @Scott Roth
The /api/mgmnt endpoint was previously used to retrieve OpenAPI 2.0 (Swagger) information for the web application. Therefore, if the web application class (%CSP.REST) is created using the traditional approach (manually created), use.
/api/mgmnt/v1/:namespace/spec/TableLookupto get the openapi 2.0 information.
Get all REST apps
/api/mgmnt/v1/:namespace/restapps The invalid oref error because of the target object "osuwmc.Epic.FHIR.DataStructures.PatientSearch.Response" not initiated. instantiating the target if it's not OREF.
If '$IsObject(target){
Set target = ##class(osuwmc.Epic.FHIR.DataStructures.PatientSearch.Response).%New()
}'Class queries (%SQLQuery) are designed specifically for SELECT operations (retrieving data) rather than for data modification (INSERT, UPDATE, DELETE). This is because the class compiler translates the query definition into ObjectScript code that implements Cursor Logic, which consists of three distinct segments:
Because this framework and its constraints, it does not support INSERT, UPDATE, or DELETE.
Glad to hear that. Thank you!
To get specific details like the line number, class, and function name during an exception, you can use the traceback module to extract the "execution frame" from the error.
By incorporating this logic into your code, we can generate a structured error message in IRIS format. However the PYTHON EXCEPTION has stack information but not detailed error information
ClassMethod pyClsError() [ Language = python ]
{
import traceback
import iris
class MathOperations:
def divide_numbers(self):
try:
print(1/0)
except Exception as e:
tb = e.__traceback__
stack = traceback.extract_tb(tb)[-1]
name = f"<{type(e).__name__.upper()}>"
cls = self.__class__.__name__
loc = stack[2]
lineNo = stack[1]
data = f"{loc}+{lineNo}^{cls}"
errobj=iris.cls("%Exception.General")._New(name,2603,data)
a=errobj.Log()
print("Caught exception: " + str(e))
obj = MathOperations()
obj.divide_numbers()
}ClassMethod pyFuncError() [ Language = python ]
{
import traceback
import os
import iris
try:
print(1/0)
except Exception as e:
tb = e.__traceback__
last_frame = traceback.extract_tb(tb)[-1]
# 2. Extract specific parts
error_name = f"<{type(e).__name__.upper()}>" # e.g., <NAMEERROR>
line_no = last_frame.lineno # e.g., 6
func_name = last_frame.name # e.g., <module> or my_func
filename = os.path.basename(last_frame.filename).replace('.py', '')
iris_error = f"{func_name}+{line_no}^{filename}"
errobj=iris.cls("%Exception.General")._New(error_name,2603,iris_error)
a=errobj.Log()
}Application Error Log
.png)
Thank you @Stephen Canzano
I'll try myself.
Thank you! ZPM load actually skip the .dfi file and eventually failed with " ERROR! Unable to import file '/home/irisowner/dev/Test/Test-UTest.pivot.DFI' as this is not a supported type"
Hi @Evgeny Shvarov
Thank you for the details. So, Do I need to keep the files in .xml format in my repo not in .dfi
Kudos to all the winners and the participants!
You can determine whether the value is an object by using $IsObject(value) before processing it.
Alternatively, you can rely on the third argument of %GetNext(,,.type), which tells you the datatype of the value.
Example code
set iter = identifiers.%GetIterator()
while iter.%GetNext(.key, .value, .type) {
if$IsObject(value) {
set text = value.%Get("text")
}
}set iter = identifiers.%GetIterator()
while iter.%GetNext(.key, .value, .type) {
if type = "object" {
set text = value.%Get(key) ;for example value.%Get("text")
}
if type = "array" {
set text = value.%Get(index) ; for example: value.%Get(0)
}
}AutoParallel and Adaptive Mode are enabled by default in InterSystems IRIS SQL query optimizer. Because of this, IRIS will automatically determine when parallel query execution is beneficial. Therefore, you usually don’t need to manually specify %PARALLEL unless you want to force parallelism or override the optimizer’s decision.
Hi @Anastasia Dyubaylo
How do I submit an application for this contest? Is there a specific option I need to select when submitting the application?
This is a really interesting idea, and I think it raises an important point: the InterSystems ecosystem has grown big enough that community tools are now essential, not just “nice extras.” Even though most of these tools are maintained by individuals, creating a foundation could potentially make their management more efficient by providing structure, funding, and shared resources to support maintainers and help ensure long-term sustainability.
Thank you for the clarification @Julius Kavay
Hi @Julius Kavay
The literal array syntax set outArray = [] internally creates a %DynamicArray object. If both approaches ultimately produce a %DynamicArray, why is using the literal syntax reportedly about 50% faster than explicitly calling set outArray = ##class(%DynamicArray).%New()?
Thank you for pointing the projection and it works!
Hi @Lucrezia Puntorieri
Yes you can create a method and classmethod programmatically.
Set clsmethodObj = ##class(%Dictionary.MethodDefinition).%New()
Set clsmethodObj.Name="TestClsMethod"Set clsmethodObj.ClassMethod=1Do clsmethodObj.Implementation.WriteLine($C(9)_"Set ^test=""Test"" ")
Do clsmethodObj.Implementation.WriteLine($C(9)_"Quit ^test ")
Set methodObj = ##class(%Dictionary.MethodDefinition).%New()
Set methodObj.Name="TestMethod"Set methodObj.ClassMethod=0Do methodObj.Implementation.WriteLine($C(9)_"For I=1:1:10 { S ^test(i)=i} ")
Do methodObj.Implementation.WriteLine($C(9)_"Quit ^test ")
Do clsObj.Methods.Insert(clsmethodObj)
Do clsObj.Methods.Insert(methodObj)Hi Jack
IRIS does not provide built-in functionality to generate classes directly from a JSON Schema, unlike the support available for XML Schema (XSD). However, you can programmatically create and compile classes at runtime using the %Dictionary.ClassDefinition API.
Here is the sample code to generate a class.
ClassMethod CreateClass()
{
Set clsObj = ##class(%Dictionary.ClassDefinition).%New()
Set clsObj.Name="Test.NewClass"Set clsObj.Super="%RegisteredObject,%JSON.Adaptor"Set clsObj.Description="Class created via code"Set clsObj.DdlAllowed = 1Set clsObj.Inheritance="left"Set propObj = ##class(%Dictionary.PropertyDefinition).%New()
Set propObj.Name="Name"Set propObj.Type="%String"Set propObj.SqlColumnNumber=2Do propObj.Parameters.SetAt(70,"MAXLEN")
Set indexObj = ##class(%Dictionary.IndexDefinition).%New()
Set indexObj.Name="NameIdx"Set indexObj.Properties="Name"Do clsObj.Properties.Insert(propObj)
Do clsObj.Indices.Insert( indexObj)
Set st= clsObj.%Save()
D$SYSTEM.OBJ.Compile("Test.NewClass","ckb")
If$$$ISERR(st) w$SYSTEM.OBJ.DisplayError(st)
}Hi Jack,
Can you check the class parameter ROWLEVELSECURITY
Hello @Julius Kavay
Thanks for pointing that out — you're absolutely right. The generator method for property initialization is missing. However, we are able to create an instance of %CSP.Page