I was surprised that overriding the OnFailureTimeout() in the custom BO class did not work! According to the description that was definitely the way to go. But it indeed does not work(ed).

I opened a WRC and it turned out that there is a bug "around" the OnFailureTimeout() implementation in Ens.BusinessOperation.

So, if anyone need to implement OnFailureTimeout()  with Set ..Retry=1, first it requires to contact WRC, explain the problem and reference DP-426250 to get the fix.

Enrico

Sorry, forgot the namespace, try this:

do ##class(%XML.XPATH.Document).CreateFromStream(pResponse.ContentStream, .tPnRXML)
Set tPnRXML.PrefixMappings="ns urn:oasis:names:tc:ebxml-regrep:xsd:rs:3.0"
Set sc=tPnRXML.EvaluateExpression("/XMLMessage/ContentStream/ns:RegistryResponse/ns:RegistryErrorList/ns:RegistryError","@errorCode",.tPnRResult)
Set tPnRResult.GetAt(1).Value ; Value=XDSRegistryDeprecatedDocumentError

Hi Dan! I'm please you are listening 😊

"I am listening! $system.external does not replace the old Java Gateway but the old Java and JDBC Gateways should still be available."

I know it's "still there" and works, however all the documentation for the old Java and .NET Gateway has been removed since long time (starting from IRIS?), so implementing it today it's difficult for any developer without previous experience.
In addition, I'm not sure if it would be a good idea to implement today external calls using the old Gateway, I assume that using the new $system.external is preferred.
In fact the documentation contains some info for converting from old gateway to new $system.external:

"...upgrading your code is a simple matter of replacing certain class and method references..."

Assuming that upgrading is "simple matter of replacing certain class and method references", unfortunately for MANY use cases there is no documentation of what to replace with what.

The problem is that now we have no documentation of the (still available) old gateway and "scarce" documentation for the new one.
I don't remember the details of the old gateway documentation, however it offered two GREAT code samples where most (if not all) the functionality was implemented:

%Net.Remote.DotNet.Test
%Net.Remote.Java.Test

Using only documented feature/methods of $system.external is not possible to convert the old samples to use $system.external.

So, my idea was to encourage the implementation of two samples (maybe Phyton as well?) with all the features.

That's the issue at hand.

Ciao,
Enrico

Try this:

Class Community.HL7.Laboratorio.ORUToCUPv1 Extends Ens.DataTransformDTL [ ClassType = "", DependsOn = EnsLib.HL7.Message, ProcedureBlock ]
{

Parameter IGNOREMISSINGSOURCE = 0;
Parameter REPORTERRORS = 0;
Parameter TREATEMPTYREPEATINGFIELDASNULL = 0;
XData DTL [ XMLNamespace = "http://www.intersystems.com/dtl" ]
{
<transform sourceClass='EnsLib.HL7.Message' targetClass='EnsLib.HL7.Message' sourceDocType='2.5:ORU_R01' targetDocType='2.5:ORU_R01' create='new' language='objectscript' >
<assign value='source.{MSH}' property='target.{MSH}' action='set' />
<assign value='source.{PIDgrpgrp().PIDgrp.PID}' property='target.{PIDgrpgrp().PIDgrp.PID}' action='set' />
<assign value='source.{PIDgrpgrp().PIDgrp.PV1grp}' property='target.{PIDgrpgrp().PIDgrp.PV1grp}' action='set' />
<assign value='source.{PIDgrpgrp().PIDgrp.NTE()}' property='target.{PIDgrpgrp().PIDgrp.NTE()}' action='set' />
<assign value='0' property='ORCCounter' action='set' />
<foreach property='source.{PIDgrpgrp(1).ORCgrp()}' key='ORC' >
<assign value='source.{PIDgrpgrp().ORCgrp(ORC).ORC}' property='target.{PIDgrpgrp(1).ORCgrp(ORC).ORC}' action='set' />
<assign value='source.{PIDgrpgrp().ORCgrp(ORC).OBR}' property='target.{PIDgrpgrp(1).ORCgrp(ORC).OBR}' action='set' />
<assign value='source.{PIDgrpgrp(1).ORCgrp(1).TQ1grp(ORC)}' property='target.{PIDgrpgrp(1).ORCgrp(ORC).TQ1grp(ORC)}' action='set' />
<foreach property='source.{PIDgrpgrp(1).ORCgrp(ORC).OBXgrp()}' key='OBX' >
<if condition='1=0' >
<true>
<assign value='source.{PIDgrpgrp(1).ORCgrp(ORC).OBXgrp(OBX)}' property='target.{PIDgrpgrp(1).ORCgrp(OBX).OBXgrp(OBX)}' action='set' />
</true>
<false>
<assign value='ORCCounter+1' property='ORCCounter' action='set' />
<assign value='source.{PIDgrpgrp(1).ORCgrp(ORC).OBR}' property='target.{PIDgrpgrp(1).ORCgrp(ORCCounter).OBR}' action='set' />
<assign value='source.{PIDgrpgrp(1).ORCgrp(ORC).ORC}' property='target.{PIDgrpgrp(1).ORCgrp(ORCCounter).ORC}' action='set' />
<assign value='source.{PIDgrpgrp(1).ORCgrp(ORC).TQ1grp()}' property='target.{PIDgrpgrp(1).ORCgrp(ORCCounter).TQ1grp()}' action='set' />
<assign value='source.{PIDgrpgrp(1).ORCgrp(ORC).OBXgrp(OBX)}' property='target.{PIDgrpgrp(1).ORCgrp(ORCCounter).OBXgrp(OBX)}' action='set' />
</false>
</if>
</foreach>
</foreach>
</transform>
}

}

Ciao,

Enrico

P.S.: I changed the IF condition for testing

Sorry, I mixed things up!

Classes in the package HS.FHIR.vSTU3.* are deprecated but HS.FHIR.DTL.vSTU3.* classes are not deprecated. At least to my knowledge. Why do you think they are deprecated?

When I read your post I assumed you referred to the deprecated HS.FHIR.vSTU3.* classes, in fact you mentioned HS.FHIR.DTL.vSTU3.Model.Resource.Bundle, so I got confused.

Using:
Set payload=##class(HS.FHIR.DTL.vSTU3.Model.Resource.Bundle).FromJSON(pHttpResponse.Data,"vSTU3")

You should be able to "convert" (import) the stream bundle to the corresponding classes and then "navigate" the bundle, including the resources within it, as a classic IRIS class.

Enrico

"we find that the new codes are not visible in the management portal"

Are you sure that your code is from APPCODE database?

Regarding the production settings, replacing the production class only is not sufficient, you need to compile the production class in the final environment. When a production is compiled "some data" is saved in the (APPDATA in your case) database.

Enrico

The idea is simple and I'm not sure it can be considered "documentation improvement" or it make sense in the "open exchange".

The idea is: add all the missing documentation for $system.external!!

The problem in not poor documentation, the problem is the MISSING DOCUMENTATION.

And in case you wonder, yes, I have reported this to WRC and sent a feedback to the ISC documentation team.

Nothing has happened.

On the same topic:

Using arrays in $system.external .NET gateway

Enrico

Ciao Pietro,

I'm afraid you cannot change FailureTimeout "at the first iteration", however, for the specific case you describe, in the Business Operation you can override the method OnFailureTimeout() and there programmatically change the default behavior when the FailureTimeout has been reached. Something like:

/// Override this method to provide custom handling of retry / failure timeout.<p/>
/// Set ..Retry=1 to override normal error return and re-evaluate flag properties.<p/>
/// Return 0 to skip further (default) FailureTimeout processing, 1 to perform default processing.
Method OnFailureTimeout(pRequest As %Library.Persistent, Output pResponse As %Library.Persistent, ByRef pSC As %Status) As %Boolean
{
	If pRequest.severity = "high" {
		Set ..Retry=1
		Quit 0
	} Else {
		Quit 1
	}
}

This is just a simple example, you may want to test/check pSC....

Give it a try and let us know.

Ciao,

Enrico