Julian is a
Question Whiz
Recap 2024
Publications:
3questions
42comments
Top Post:
530
people reached
User bio
404 bio not found
Member since Nov 11, 2020
Replies:

Hey Enrico.

The value of KeepIntegrity is set to True. I don't believe we have ever run the purge without including message bodies, but it's a non-production environment so stranger things have happened.

However, I did also just try running ##class(EnsLib.HL7.Message).Purge() in our production environment with the settings matching the retention period there, and it ran for a period, freed up around 5gb and then failed over to the other mirror as running the method consumed all of the ram on the box 😅

This namespace has been around for a long time (started life at around caché/ensemble 2014) and has likely accumulated a lot of baggage. I had a similar problem when trying to run Ensemble Orphaned Messages Purge Routine 

Hey David.

Your solution has caught my attention. What led you to this?

I have just run this against a non-production namespace that had a 30 day retention period and was sat at around 6GB. Running this command with the "pDaysToKeep" parameter set to 30 days has managed to free up 5GB and deleted 92158 messages, where I would have expected to have not deleted anything given the retention period for the purge task and the running of this method were the same.

My approach would be to make use of the OAuth 2.0 Client configuration via the Management Portal.

You can configure the Issuer Endpoint here, as well as add the details of the Client, Secret, etc.

To then make use of this configuration within an Operation, you can then do something like this:

Method AuthoriseMe(Output AccessToken As %String) As %Status
{
 //Set basic parameters
 Set tSC = $$$OK
 Set myscopes = "profile"
 Set clientName = ..Client
 Set AccessToken = ""
 //Check to see if client is already authenticated
 Set isAuth=##class(%SYS.OAuth2.AccessToken).IsAuthorized(clientName,,myscopes,.accessToken,.idtoken,.responseProperties,.error)

 //If we're not authorised already, we need to authorise ourselves.
 If isAuth=0{
   //Not Authenticated - authenticate client
   //Quit on error is used here as, if we're unable to get the token 
   $$$QuitOnError(##class(%SYS.OAuth2.Authorization).GetAccessTokenClient(clientName,myscopes,,.error))
   $$$QuitOnError(##class(%SYS.OAuth2.AccessToken).IsAuthorized(clientName,,myscopes,.accessToken,.idtoken,.responseProperties,.error))
   }
 
 Set AccessToken = accessToken
 Quit tSC
}

Where ..Client is in the code snippet, the value of this will need to match the name of the client as configured in the management portal.

Certifications & Credly badges:
Julian has no Certifications & Credly badges yet.
Global Masters badges:
Followers:
Following: