Every routine, class or global that start with "%" is mapped to a system database, usually "%SYS".

In your case %Test.mac is (by default) mapped to the %SYS database.

It seems that you (the user you connect to IRIS) don't have permissions to write to the %SYS database.

Please note that during IRIS upgrade all routines starting with "%" are DELETED, unless they start with %z or %Z, so I suggest to use a different name or, better, create your code in other namespace/database with consistent naming (package name) and map it from your application namespaces. If you need your code in all namespaces, create a mapping for the %ALL (pseudo) namespace.

Hi Daniel 😊

can you elaborate "$p($view(-1,-3),"^",6)"? 😉

Your code gives the impression that to implement this solution requires knowledge that we "simple humans" don't have.

Fortunately this is not the case, instead of the cryptic, obscure, arcane and undocumented $p($view(-1,-3),"^",6) the simple $ZNAME special variable can be used. 😃

I'd implement a custom function, create a class like:

Class Community.CustomFunctions Extends Ens.Rule.FunctionSet
{

/// Returns Age in years from DOB in YYYYMMDD format
ClassMethod GetAge(DateOfBirth As %String) As %Integer
{
    Quit (($H-$ZDATETIMEH(DateOfBirth,8)) \ 365.25)
}
/// Returns Age in days from DOB in YYYYMMDD format
ClassMethod GetAgeDays(DateOfBirth As %String) As %Integer
{
	Quit ($H-$ZDATETIMEH(DateOfBirth,8))
}

}

Then from any Rule or DTL transformation you can use these two function as any other built in function.

Make sure DOB is not null ("") before calling the function.

You case is simpler, you do know the json structure and all you need is to iterate the "items" array and find all the portalUrl and pureID properties. Note that since there can be many "items", there may be many portalUrl and pureID.
 

	Set itr=responseData.items.%GetIterator()
	while itr.%GetNext(.key, .value) {
		Write value.portalUrl,!
		Write value.pureID,!
	}

P.S.: it's unlikely that the Response you get from a REST call is a %DynamicAbstractObject since, by definition, that's an abstract class and cannot be instantiated, what you actually get is a subclass of %DynamicAbstractObject, a %DynamicObject in this case or a %DynamicArray when the response is an array.

If you receive "special characters, such as non-utf-8 characters either control characters or unicode characters" it means that somewhere upstream character set conversion is not properly configured/handled.

I'm not sure that removing characters from a text is a proper solution, instead I'd fix the problem from the source identifying where the character set conversion is not properly configured/handled and fixing it.

Surely after removing some characters the text can be printed and  parsed by downstream systems, but....it's going to be a different text, potentially with a different meaning!

You did not provide details, so I try to guess.

You are writing a Business Operation that use the EnsLib.HTTP.OutboundAdapter, if so, double check the signature of the method SendFormDataArray() that is:

Method SendFormDataArray(Output pHttpResponse As %Net.HttpResponse, pOp As %String, pHttpRequestIn As %Net.HttpRequest, pFormVarNames As %String = "", ByRef pData, pURL As %String) As %Status

Your call is:

set tSC = ..Adapter.SendFormDataArray(.tHTTPResponse, "POST", tHTTPRequest, tURL, tPayload)

I think the passed arguments don't match the method signature.

It depends on use case.
In my case we use DICOM integration to orchestrate archiving of studies between AETs, so we use commands like CFIND, CMOVE etc. and never download a study.

At the moment we have 290K+ files, the biggest is 1KB.
I think that even when you download studies having the option to use global streams instead of files would be extremely useful in a mirror configuration.

Depending on the environment, having an high availability single shared directory between mirror members can be expensive from MANY point of view (resources, configuration, maintenance, backup, security, etc.).
When an async DR is in place things get even more complicated.

As it stands, using IRIS DICOM interoperability in mirror configuration it's a nightmare.

You edited your post after my answer 😊

Am I missing something or canonicalization does not minify the XML?

For other reasons (how data is consumed) we cannot compress it and the target property is a %String.

Maybe creating a compressed string datatype can be another option in other situations but in this case the target property/class is part of HealthShare (a Registry Slot).

Configure a VIP for the mirror using built in IRIS VIP configuration, or, if you cannot use built in VIP, you can use an external balancer (F5, HAProxy etc.) to handle/create the VIP "externally".

Then instead of using the IP/name of the mirror members you use the VIP address/name to connect to the active mirror member node. Use VIP for ODBC and any other connection to IRIS.

You did not specified what kind of HealthShare environment you have in place (UCR?), depending of your HealthShare setup a VIP is a prerequisite for configuring an HealthShare  federation.

Yes, it's normal, Web Applications are local configuration on each mirror member.

If/when you create a new Web Application you need to create it in all mirror members. Personally I prefer to create the application using a script (a class method) that is deployed and run (typically along with code etc.) in all members nodes.

In addition to Web Applications note that also all security related configuration (Users, Roles, Resources, SQL privileges etc.) are local to each mirror member.

It's my understanding that InterSystems is working on enhancing the mirror to include security configuration synchronization (Web Applications are part of the Security) between mirror member.