Ashok Kumar T · Nov 20, 2023 go to post

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"

Ashok Kumar T · Nov 15, 2023 go to post

Maybe you're using literal properties for list operation. It causes the list error.

Ashok Kumar T · Nov 14, 2023 go to post

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.

Ashok Kumar T · Nov 9, 2023 go to post

Have you verified? Did you get all the values whether the hl7 message is properly imported to the object after executing XMLImportSDAString for all the properties.

do reqObj.XMLImportSDAString(xml.Read())
Ashok Kumar T · Nov 9, 2023 go to post

Hello @MARK PONGONIS

Get/Post/Put any method will return status if error while executing otherwise return 1. The HttpResponse object property actually contains the response details such as status code, content length, content type, response etc... 

So, As you mentioned the code is "http.HttpResponse.StatusCode" is used to get the status code of the response.

Ashok Kumar T · Nov 7, 2023 go to post

I believe the simulator/JWT.io uses Base64UrlEncode instead of Base64Encode
The problem with Base64Encode is that it contains the characters + , / , and = ,. So Base64UrlEncode solves this by replacing + with - and / with _ .

Ashok Kumar T · Nov 7, 2023 go to post

Hello @Yone Moreno 

Try removing the = after $system.Encryption.Base64Encode(). You can also check the  %OAuth2.JWT  class to as well. 

do ##Class(%OAuth2.JWT).ObjectToJWT(.JOSE,body,,,.jwt)
Ashok Kumar T · Nov 3, 2023 go to post
  1. Basically you should keepIntegrity enabled. Otherwise it will delete all the messages regardless of whether processed or not processed.
  2. Select "All types" in Type to purge.
  3. You can enable the " Open output file when task is running? " and provide the file location.
  4. 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.

Ashok Kumar T · Nov 3, 2023 go to post

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.

Ashok Kumar T · Nov 2, 2023 go to post

You need to select the BodiesToo option(whenever the message header details the body also deleted) to delete the messages from the database

Ashok Kumar T · Oct 31, 2023 go to post

You can use %SetStatusCode from the %REST.Impl class definition. This class have additional methods available to set the response related stuffs like below

do ##class(%REST.Impl).%SetStatusCode(..#HTTP401UNAUTHORIZED)
Ashok Kumar T · Oct 25, 2023 go to post

$this is actually return the current class name instead of object if you're using inside ClassMethod. On the other hand if you use $this (It actually holds the object) So,  it returns object inside Method Check the below sample code and output


ClassMethod thistest()
{
    write "$this inside ClassMethod: ",$this,!
    write "$this object check ClassMethod: ",$ISOBJECT($this),!
    set obj = ##class(User.NewClass1)..%New()
    do obj.thistest1()
}

Method thistest1()
{
    write "$this Method: ",$this,!
    write "$this object check Method: ",$ISOBJECT($this),!
}
LEARNING>d ##class(User.NewClass1).thistest()
$this inside ClassMethod: User.NewClass1
$this object check ClassMethod: 0
$this Method: 1@User.NewClass1
$this object check Method: 1

So. If you're trying to get the property value inside classmethod by using $this in $PROPERTY($THIS,propertyName) It throws  <NO CURRENT OBJECT> error . so you should use object for $PROPERTY or use this retrieval $PROPERTY($THIS,propertyName) inside method.

Ashok Kumar T · Oct 24, 2023 go to post

The lock is belongs from different process(9908) and you're trying to terminate  via different process(10376) not is not possible. You can verify and terminate the 9908 in process  (System Operation>Process) if no longer required for prevent multiple locks set again and click remove all locks for process and remove it.

  • Use $test  special variable in your code to check the for success/failure lock. If lock is success it return 1 otherwise return 0 based on this result you can continue your logic flow.
  • Always use incremental lock with timeout (ex: lock +^test:0) 
LEARNING>w $test
0
LEARNING>lock +^test:0
 
LEARNING>w $test
1
LEARNING>
Ashok Kumar T · Oct 24, 2023 go to post

Basically. The tcommiit will commit the current open transaction. Lock -^global (decremental lock ) is used to release the incremental lock( lock +^global) so everytime if you do incremental lock then you should decrement the lock) by using lock -^gbl syntax

Argumentless lock is release all the locks in the process. So this is not highly recommend in code. And incremental locks are highly recommend for use.

Ashok Kumar T · Oct 24, 2023 go to post

I see you're locking the global  +^IudexNqlInByte not unlocking. can you check the below

tstart
	if staten["IUDX" {
		lock +^IudexNqlInByte(1):0
		if $test{ 
			set IudexNqlInByte(1,inc)=obj.%Id()
			lock -^IudexNqlInByte(1)
		}
	}
	else {
		lock +^ToshibaNQLIn(1):0
		if $test {
			set ^ToshibaNQLIn(1,inc)=obj.%Id()
			lock -^ToshibaNQLIn(1)
		}
	}
tcommit
Ashok Kumar T · Oct 23, 2023 go to post

Hello Yone,

Why don't you use %Stream.GlobalCharacter stream object to store  Long string instead of %String property. You can extend your class with %JSON.Adaptor and create a JSON object and directly import with your contents like below.

ClassMethod Import()
{
    set json=[{"ID_SICH":"121212","FECHA_DERIVACION":123,"MEDICO_PETICIONARIO":(tResponse.Data)}]
    set obj = ##Class(Mensajes.Response.Radiologia.CConcertados.BusquedaOrdenesNEGRINResponse).%New()
    set stt= o.%JSONImport(json)
    if $$$ISERR(stt) write $SYSTEM.OBJ.DisplayError(stt)
    set stt= obj.%Save()
    if $$$ISERR(stt) write $SYSTEM.OBJ.DisplayError(stt)
}
Ashok Kumar T · Oct 22, 2023 go to post

Hello @Chad Severtson 

We have streams to store it for long time. So, As per the documentation. I was thinking to to create a separate database to move the existing streams, create a new streams and maintain it accordingly. Can you add bit more details about this the instance wide consideration rather than only a database level consideration because allocating buffers of 32KB reserves a portion of the memory for blocks of that sizeHow much memory is allocated and how to calculate it

Thanks!

Ashok Kumar T · Oct 20, 2023 go to post

Hello @Kari Vatjus-Anttila 

This was a nice implementation for securing the individual REST calls. However, Will loose the benefits of built JWT Authentication for web application(from 2022 version). Maintaining two separate web applications for secure and unsecured seems useful.

Ashok Kumar T · Oct 19, 2023 go to post

Thanks @Dmitry Maslennikov 

It works. I thought "Initial (25% of physical memory)" of the global buffer will also applicable for other block size. However It's not that kind. There is default 0 for those blocks. So, it's mandatory to make it specific amount.

Once I made the changes it works!

Ashok Kumar T · Oct 18, 2023 go to post

Thank you for the samples. Now it works fine and I get JWT. I have seen this parameters in some other post in community. What is the exact use of these parameters dispatcher class.

 Parameter TokenLoginEndpoint = "login"; Parameter TokenLogoutEndpoint = "logout"; Parameter TokenRevokeEndpoint = "revoke"; Parameter TokenRefreshEndpoint = "refresh";
Ashok Kumar T · Oct 18, 2023 go to post

Yes. my web application is /api and invoked this http://localhost:52774/api/login

Ashok Kumar T · Oct 18, 2023 go to post

Hello @Luis Angel Pérez Ramos 

I've enabled and configured JWT in my Web application. I'm trying to call the /login method from post man with body of contents  {"user":"{YOURUSER}", "password":"{YOURPASSWORD}"} but I got 404 not found error. Did I anything missed/required.

As you mentioned 

With this configuration we will not need anything else to start using this authentication mode in our web applications.

However This is for clarification

Do I need to write a custom login method or existing is enough? 

Do I need to include  /login, /logout etc.. endpoints in urlmap?

Ashok Kumar T · Oct 17, 2023 go to post

Hello @Yone Moreno 
Just a thought. Convert the HL7 message into SDA. Create a clone class like SDA with extends of Ens.Request. Create a instance of the class and import the String into the object and finally store it like below.


ClassMethod HL7ToCustomEnsReq()
{
    #dim xml As %Stream.GlobalCharacter
    set hl7 = ##class(EnsLib.HL7.Message).%New()
    
    set tSC = ##class(HS.Gateway.HL7.HL7ToSDA3).GetSDA(hl7,.xml)
    $$$ThrowOnError(tSC)
    
    set reqObj = ##class(Mensajes.Request.ConsentimientoInformado.HUC.ORUHL725OutRequest).%New()
    do reqObj.XMLImportSDAString(xml.Read())
    set tSC = reqObj.%Save()
    $$$ThrowOnError(tSC)
}