go to post Ashok Kumar T · Jul 16, 2024 Hello @Martin Nielsen Quick note, You can get the manually created web applications via /v1/{namespace}/restapps in the web application "/api/mgmnt" ex: http://localhost:52773/api/mgmnt/v1/learning/restapps. This will list down all the v1 applications and from that you can use the web app name to get the openAPI(swagger 2.0) by using the the url /v1/{namespace}/spec/{web app name} ex: http://localhost:52773/api/mgmnt/v1/learning/spec/dc/samprest
go to post Ashok Kumar T · Jul 4, 2024 Hello @Martin Nielsen I did some analysis about this. As of my understanding, I found this is because of the method DispatchRequest in the %CSP.REST. The below piece of code is actually skip your accountId due to forward your request to another "DispatchRequest" in the other dispatch class(for your case "AnotherController" class). But these are rewritten in IRIS already. You can try override this method for testing. Set tMatchUrl=$Piece(tMatchUrl,tMatchcher.Group(1),"2",*),tForward=$LisGet(tMapEntry,3) Actual Url: /1001/anothercontroller/001 Url after above line executed: /001
go to post Ashok Kumar T · Jul 4, 2024 Hello @Sylvie Greverend The sample swagger for produces "image/jpeg" and consumes "application/json" and "application/xml" for sample. Once the spec.cls. Once it's complied it creates a "DownloadImg" classmethod in .disp.cls swagger { "swagger": "2.0", "info": { "title": "test", "version": "1.0.0" }, "paths": { "/Test": { "get": { "summary": "Test download", "operationId": "DownloadImg", "produces": [ "image/jpeg" ], "consumes": [ "application/json", "application/xml" ] } } } } Generated class method ClassMethod DownloadImg() As %Status { Try { Do ##class(%REST.Impl).%SetContentType("image/jpeg") If '##class(%REST.Impl).%CheckAccepts("image/jpeg") { Try { Do ##class(MyLearn.LearnREST.Swag.impl).%ReportRESTError(..#HTTP406NOTACCEPTABLE,$$$ERROR($$$RESTBadAccepts)) } Catch { Do ##class(%REST.Impl).%ReportRESTError(..#HTTP406NOTACCEPTABLE,$$$ERROR($$$RESTBadAccepts)) } Quit } Set response=##class(MyLearn.LearnREST.Swag.impl).DownloadImg() Do ##class(MyLearn.LearnREST.Swag.impl).%WriteResponse(response) } Catch (ex) { Try { Do ##class(MyLearn.LearnREST.Swag.impl).%ReportRESTError(..#HTTP500INTERNALSERVERERROR,ex.AsStatus(),$parameter("MyLearn.LearnREST.Swag.impl","ExposeServerExceptions")) } Catch { Do ##class(%REST.Impl).%ReportRESTError(..#HTTP500INTERNALSERVERERROR,ex.AsStatus(),$parameter("MyLearn.LearnREST.Swag.impl","ExposeServerExceptions")) } } Quit $$$OK } Some useful links HTH.
go to post Ashok Kumar T · Jun 22, 2024 Hello @Sylvie Greverend Using the Oauth tokens "Bearer tokens" instead of basic for Authorization is another way to handle it.
go to post Ashok Kumar T · May 29, 2024 Hello @Scott Roth Did you get a chance to check the ^ISCLOG global for Http request logging. Because configuration done int ^%ISCLOG and logging was written in ^ISCLOG ^FSLOG for internal FHIR server logging Thanks!
go to post Ashok Kumar T · Feb 4, 2024 Hi @Pierre LaFay Define a Method instead of ClassMethod and Instantiate the object for that class and call the required method. It will work Class Bna.Utils.Sql Extends %RegisteredObject { ClassMethod RemoveIrisTestUsers() As %Status { set obj = ..%New() New $NameSpace Set $NameSpace="%SYS" // Get test users by login begining Set query = "select * from Security.Users "_ "where "_ "ID like LOWER('ARS%') or"_ "ID like LOWER('CHERCHEUR%') or"_ "ID like LOWER('CS%') or"_ "ID like LOWER('DGOS%') or"_ "ID like LOWER('CENTRE%')" Set sc =obj.SelectFirstColsInArray(query, .userIds) if 'sc Return sc zw userIds Return $$$OK } Method SelectFirstColsInArray(query, test) { zwrite query,test return $$$OK } }
go to post Ashok Kumar T · Jan 21, 2024 Hello @Andy Stobirski Have you created a web application? If not, You have to create a web application. Configure the necessary details such as namespace, url add your PCRest.disp in dispatch class and assign roles. Save the application and call your RESTFul api from postman. /// Says Hello ClassMethod Hello() As %Stream.Object { return {"status":"ok","message":"working"} }
go to post Ashok Kumar T · Nov 30, 2023 Hello @Michael Wood If those values are not part of the response. Then don't need to worry about it. Code will skip by default. Incase if the property is not defined . Then you have to declare the %JSONIGNOREINVALIDFIELD value as 1 to prevent from that ERROR #9406: Unexpected format for value of field. Parameter %JSONIGNOREINVALIDFIELD As BOOLEAN = 1;
go to post Ashok Kumar T · Nov 30, 2023 Hello @water huang As You can create a class method with name of your property " OPDTLogicalToXSD" and add the code conversion for the datetime as mentioned by @Enrico Parisi at XML export time. It's suitable for both XML and JSON adaptor. Sample code. Class Samples.NewClass2 Extends (%Persistent, %Populate, %JSON.Adaptor, %XML.Adaptor) { Property OPDT As %Library.DateTime; ClassMethod OPDTLogicalToXSD(%val As %TimeStamp) As %String [ ServerOnly = 1 ] { Set %val=##class(%Library.TimeStamp).LogicalToXSD(%val) Quit $translate(%val,"TZ"," ") } } output <NewClass2><OPDT>2023-11-30 11:07:02</OPDT></NewClass2>
go to post Ashok Kumar T · Nov 30, 2023 Hello @water huang, The default implementation of the XMLExportToString in %XML.Adaptor basically converts the date format as 2023-11-28T13:57:26Z for the property value by the logic $translate(value," ","T")_"Z"). So, I guess you may need to convert by own.
go to post Ashok Kumar T · Nov 21, 2023 Hello @Colin Brough Can you try is this approach is suitable. Create a Business Service with Ens.InboundAdapter or without adapter. Call your BPL process as usual interoperability production flow. Eventually Create your custom Task and invoke your Business service from the OnTask Inherited Method Class HL7Task.Test Extends %SYS.Task.Definition { Method OnTask() As %Status { Set status = $$$OK Try { #dim service As Ens.BusinessService Set status = ##class(Ens.Director).CreateBusinessService("HL7.Feed.TriggerService",.service) if $isobject(service) { do service.OnProcessInput(pInput,.pOutpt) } } Catch(ex) { Set status = ex.AsStatus() } return status } } Business service Class HL7.Feed.TriggerService Extends Ens.BusinessService { Parameter ADAPTER = "Ens.InboundAdapter"; Property TargetConfigName As Ens.DataType.ConfigName; Parameter SETTINGS = "TargetConfigName:Basic"; Method OnProcessInput(pInput As %RegisteredObject, Output pOutput As %RegisteredObject) As %Status { Do ..SendRequestSync(..TargetConfigName,pInput,.pOutput) Quit $$$OK } }
go to post Ashok Kumar T · Nov 20, 2023 Hi @Prasanth Annamreddy If you're using Interoperability production to publish your FHIR resources. Then you may instantiate the object for the class HS.FHIRServer.Interop.Request to process the request and production expects this object as a input . Otherwise it will throw "ERROR <Ens>ErrRequestNotHandled: Request message not handled"
go to post Ashok Kumar T · Nov 14, 2023 Hello @Luis Angel Pérez Ramos as of my understanding, We can send the it's as a query parameter or http request body if the design supports. Incase the external system protocol was designed to handled the authorization and some additional custom headers are must be a request header Then it should be part of the headers section otherwise I believe it may creates some issue with the request/response.
go to post Ashok Kumar T · Nov 3, 2023 Basically you should keepIntegrity enabled. Otherwise it will delete all the messages regardless of whether processed or not processed. Select "All types" in Type to purge. You can enable the " Open output file when task is running? " and provide the file location. Once the process is completed or Errored you can check the Ens_Util.Log to get some additional information. Can you try the above steps.
go to post Ashok Kumar T · Nov 3, 2023 The object doesn't throw the <MAXSTRING> error. However variable do. If your serialization the JSON and stored into variable. If it's reaches the maximum string it will throw an error.
go to post Ashok Kumar T · Oct 16, 2023 Hello You can send you're POST/GET URL's as part of the method itself. Refer the below sample codes Set httprequest=##class(%Net.HttpRequest).%New() Set httpRequest.ContentType = "application/json" Set httpRequest.Server = "renderProjectName.onrender.com" set httprequest.https=1 ;add this additional set if you're going to make it as a HTTPS call set httprequest.SSLConfiguration = "your ssl certificate" ; include the certificate as well for HTTPS call's Do httprequest.Post("/")
go to post Ashok Kumar T · Oct 8, 2023 As far as we don't have any default functionality for JSON beautify/Pretty print option in interoperability. There is alternative OEX app(https://openexchange.intersystems.com/package/JsonTraceViewer ) available to do it.
go to post Ashok Kumar T · Oct 6, 2023 Generally we can't execute the macros directly in terminal, studio output. The Macro preprocessor aka MPP do converts the marcos into the expression or function at the time of compilation. So, You can open and use the .int file for the specific code. Test.mac macromac write $$$EnsMajorVersion ; Test.int macromac write $system.Version.GetMajor() ; Get the relevant value of macros and execute it in terminal or output window.
go to post Ashok Kumar T · Oct 4, 2023 You can do $Name for the global and use your subscript runtime set gbl= $NA(^ABC) write @gbl@(1,2) set sub=1 write @gbl@(sub)
go to post Ashok Kumar T · Sep 26, 2023 Hi @RKumar You need to set the properties SSLConfiguration and UseSTARTTLS for enabling SSL configuration set smtp=##class(%Net.SMTP).%New() set smtp.SSLConfiguration="TestSSL" ;your SSL configured name in System Management Portal set smtp.UseSTARTTLS=1 /* ... Additional required property set */