Thanks, Brett! They are not ideal as we can see :) Me too ;)
- Log in to post comments
Thanks, Brett! They are not ideal as we can see :) Me too ;)
%Zen is deprecated in 2025.1. but this method is still useful:
set dynObj = ##class(%ZEN.Auxiliary.altJSONProvider).%ObjectToAET(obj)Are there any similar or "system" methods now to convert persistent instances into a dynamic object?
Thanks for the clarification, @John Murray ! That's helpful! From a UX standpoint, I'd prefer one menu that "goes to the origin" for both cases, so I don't do calc everytime 'if it is a method, then definition if a variable, then declaration'.
Too complex?
The example is in your article:
Class petstoreserver.impl Extends %REST.Impl [ ProcedureBlock ] { Parameter ExposeServerExceptions = 1;
/// Service implemntation for post /pet
ClassMethod addPet(messageRequest As petstoreserver.requests.addPet) As %Status
{ ; Implement your service here.
; Return {}
$$$ThrowStatus($$$ERROR($$$NotImplemented))
} ... }The declaration returns %Status.
The generated stub suggests return {} meaning the method should return json (which is true)
and below it throws status.
I think nothing can be fixed here :) Do we have any datatype to provide meaning that we expect the method to return JSON? %JSON? ))
But this discrepancy is quite confusing when you look at it for the first time.
I managed to get it work.
What was confusing is that REST methods return %Status in a declaration but in fact are expected to return JSON objects
HI @Lorenzo Scalese !
Do you have any examples of implementation classes with your suite?
I managed to generate classes vs openapi v 3.0 but cannot receive any data from implementation methods: either errors or empty results. Not sure what am I doing wrong.
Thank you @Enrico Parisi , this is helpful!
Very useful command, thank you @Vitaliy Serdtsev
BTW, there is another very interesting tool to help in building AI agents - MCP protocol, introduced by Anthropic.
Here is the related video
Here is the related demo project on OEX.
Amazing contributions! Thanks to all the participants!
I see! Thank you, @Luis Angel Pérez Ramos
Hi @Bukhtiar Ahmad ! Both IRIS for Health and Health Connect are equally suitable for high-performance transaction volume use cases. It depends, of course, on the implementation and tasks, but this is not what differentiates these two products from each other.
@Luis Angel Pérez Ramos, great thing! For the sake of testing, could you please share the repo so I can try it locally? And bust the myth on my laptop? )
Thanks @Vitaliy Serdtsev ! Glad to see yet another solution to this question!
Thank you, @Enrico Parisi!
The only thing I have a concern about here is "what is Ensemble,"? and why not Include IRIS? :)
But it is not a question to you of course.
The parameter: set configData.MaxSearchResults = 10000
And an example of how this could be set up.
Hi @Rob Tweed! Which bonus do you think we missed? It can happen. We'll fix it. I'm glad you contributed, and I'm even more glad you have happy users who benefit from the product you created.
Ah, it is more readable indeed!
There is another popular one which I sometimes hate to use:
$$$ThrowOnError(something())
Ah, now I understand the flag's meaning! cool!
Ok, I upgraded errors, so they verbose on demand. now:
USER>s sc=##class(shvarov.objectscript.errors).DIVIDE()
USER>zw sc
sc="0 "_$lb($lb(5002,"<DIVIDE>DIVIDE+3^shvarov.objectscript.errors.1",,,,,,,,$lb(,"USER",$lb("^DIVIDE+3^shvarov.objectscript.errors.1^1","e^^^0"))))/* ERROR #5002: ObjectScript error: <DIVIDE>DIVIDE+3^shvarov.objectscript.errors.1 */
USER>s status.sc=##class(shvarov.objectscript.errors).DIVIDE()
ERROR #5002: ObjectScript error: <DIVIDE>DIVIDE+3^shvarov.objectscript.errors.1
USER>So, every time I need to printout an error I do:
USER>set status.sc=##class(bla.bla).method()
and it prints out an error if it is an error. and if not it is silent?
I like it!
Well done, @David Hockenbroch !
USER>zpm "install watchedstatus" [USER|watchedstatus] Reload START (/usr/irissys/mgr/.modules/USER/watchedstatus/1.0.3/) [USER|watchedstatus] Reload SUCCESS [watchedstatus] Module object refreshed. [USER|watchedstatus] Validate START [USER|watchedstatus] Validate SUCCESS [USER|watchedstatus] Compile START [USER|watchedstatus] Compile SUCCESS [USER|watchedstatus] Activate START [USER|watchedstatus] Configure START [USER|watchedstatus] Configure SUCCESS [USER|watchedstatus] Activate SUCCESS
Installed perfectly!
Not sure about functionality though. I was wondering of a class that gives me an error, and remember another ipm module - objectcript-errors.
Installed:
USER>zpm "install objectscript-errors" [USER|objectscript-errors] Reload START (/usr/irissys/mgr/.modules/USER/objectscript-errors/1.0.2/) [USER|objectscript-errors] Reload SUCCESS [objectscript-errors] Module object refreshed. [USER|objectscript-errors] Validate START [USER|objectscript-errors] Validate SUCCESS [USER|objectscript-errors] Compile START [USER|objectscript-errors] Compile SUCCESS [USER|objectscript-errors] Activate START [USER|objectscript-errors] Configure START [USER|objectscript-errors] Configure SUCCESS [USER|objectscript-errors] Activate SUCCESS
it can generate errors in simple objectscript calls, e.g. null division etc:
USER>s sc=##class(shvarov.objectscript.errors).DIVIDE()
ERROR #5002: ObjectScript error: <DIVIDE>DIVIDE+3^shvarov.objectscript.errors.1
USER>zw sc
sc="0 "_$lb($lb(5002,"<DIVIDE>DIVIDE+3^shvarov.objectscript.errors.1",,,,,,,,$lb(,"USER",$lb("^DIVIDE+3^shvarov.objectscript.errors.1^1","e^^^0"))))/* ERROR #5002: ObjectScript error: <DIVIDE>DIVIDE+3^shvarov.objectscript.errors.1 */So this is what I did:
USER>set status=##class(DH.WatchedStatus).New("RW")
USER>set status.sc=##class(shvarov.objectscript.errors).DIVIDE()
ERROR #5002: ObjectScript error: <DIVIDE>DIVIDE+3^shvarov.objectscript.errors.1ERROR #5002: ObjectScript error: <DIVIDE>DIVIDE+3^shvarov.objectscript.errors.1if I do w status.sc:
USER>w status.sc 1
If I do everything right?
Very cool, @David Hockenbroch! Do you want to pack it into an IPM module and share with the community?
Thanks for sharing, @Edward Clark !
Great work! I'm all for lower case for the packages names.
Great you find it helpful!
Thanks @Enrico Parisi @Oliver Thompson @Robert Cemper @Chris Stewart @David Hockenbroch for sharing your experience!
Ideally it should be an "out-of-the-box" feature as unit-testing is quite a helpful thing for every production solution.
I'll give it a try!
thank you, @Jinyao ! Do you want to add the github repo to https://openexchange.intersystems.com ? to increase the audience?
Works like a charm! Thank you @Hannah Sullivan !
Thank you, @Stephen Canzano !