I'm afraid you cannot use the syntax shortcut () within a StrReplace function.
You can use the () syntax to assign a constant string to ALL the repeating fields, like:

<assign value='"PDF"' property='target.{PIDgrpgrp().ORCgrp().OBXgrp().OBX:ValueType}' action='set' />

In your case you need to iterate in each of the 3 repeating segments using foreach actions, like:

<foreach property='source.{PIDgrpgrp()}' key='k1' >
    <foreach property='source.{PIDgrpgrp(k1).ORCgrp()}' key='k2' >
        <foreach property='source.{PIDgrpgrp(k1).ORCgrp(k2).OBXgrp()}' key='k3' >
            <assign value='..ReplaceStr(source.{PIDgrpgrp(k1).ORCgrp(k2).OBXgrp(k3).OBX:ValueType},"ED","PDF")' property='target.{PIDgrpgrp(k1).ORCgrp(k2).OBXgrp(k3).OBX:ValueType}' action='set' />
        </foreach>
    </foreach>
</foreach>

Enrico

Hi Ian, I guess in the copy/paste something went wrong 😉
Same code with different formatting:

ClassMethod ValidNHS(pNHS As %String = "", Output pFailReason) As %Boolean
{
    IF pNHS'?10N {
        set pFailReason = "Num"
        Quit 0
    }
    set nCheckdigit = $Extract(pNHS,10,10)
    set nChi9Digits = $Extract(pNHS,1,9)
    set nMultFact = 2
    set nCalcCheckdigit = 0
    for i = 9 : -1 : 1 {
        set nThisDigit = $Extract(nChi9Digits,i,i)
        set nCalcCheckdigit = nCalcCheckdigit + (nThisDigit * nMultFact)
        set nMultFact = nMultFact + 1
    }
    set nCalcCheckdigit = (nCalcCheckdigit # 11)
    set nCalcCheckdigit = 11 - nCalcCheckdigit
    if (nCalcCheckdigit = 10) {
        set pFailReason = "ChkDig"
        Quit 0
    }
    if (nCalcCheckdigit = 11) {
        set nCalcCheckdigit = 0
    }
    if (nCheckdigit = nCalcCheckdigit) {
        set pFailReason = ""
        Quit 1
    } Else {
        set pFailReason = "ChkDig match"
        Quit 0
    }
}

I would create my "custom" datatype extending %Library.DateTime:

Class Community.dt.CustomDateTime Extends %Library.DateTime
{

/// Converts the %TimeStamp value to the canonical SOAP encoded value.
ClassMethod LogicalToXSD(%val As %TimeStamp) As %String [ ServerOnly = 1 ]
{
	Set %val=##class(%Library.TimeStamp).LogicalToXSD(%val)
	Quit $translate(%val,"TZ"," ")
}

}

Then in your class define your property as:

Property OPDT As Community.dt.CustomDateTime;

Are you sure you really need %Library.DateTime and not %Library.TimeStamp?
The difference is the JDBC/ODBC format.

If you prefer using %Library.TimeStamp, then change the superclass in my sample code.

Enrico

Method OnRequest(pRequest As Ens.StreamContainer, Output pResponse As Ens.Response) As %Status
{ $$$LOGINFO("Inne i XmlFilterProcess")
    set filename = pRequest.OutputFilename
    set stream = pRequest.Stream
    $$$LOGINFO(stream.Read())

 set status=##class(%XML.XPATH.Document).CreateFromStream(stream,.mydoc)
 set status=mydoc.EvaluateExpression("/staff/doc/name","text()",.myresults)
 set count = myresults.Count()
 $$$LOGINFO(count)
 
  for i =1:1:count
 {
 set result = myresults.GetAt(i).Value
 $$$LOGINFO(result)
 }
    Quit status
}

You need to change this two lines:

set status=mydoc.EvaluateExpression("/staff/doc/name","1",.myresults)
set status=mydoc.EvaluateExpression("/staff/doc/name","text()",.myresults)

set result = myresults.GetAt(i)
set result = myresults.GetAt(i).Value

Enrico

EVERY interoperability session start from a Business Service, be it from a message/call received from an external system or triggered by a timed event, like in this case.
Your problem/question is:

"I need to trigger production process/operation every minute"

That's EXACTLY what my BS sample does, all you need is to call your "process/operation" that "exchange data with external system".

This is the way to implement it.
Enrico

Very simple, just create a Business Service that use Ens.InboundAdapter.

The default behavior of Ens.InboundAdapter is to call the BS (ProcessInput()) every "CallInterval" seconds.

Something like:

Class Community.bs.TimedService Extends Ens.BusinessService
{

Parameter ADAPTER = "Ens.InboundAdapter";

Method OnProcessInput(pInput As %RegisteredObject, Output pOutput As %RegisteredObject) As %Status
{
	Set BpRequest=##class(Ens.Request).%New()
	Set sc=..SendRequestSync("YourBusinessProcessName",BpRequest,.BpResponse)
	;
	; OR, if you don't need to wait for the BP to finish:
	;Set sc=..SendRequestAsync("YourBusinessProcessName",BpRequest)
	
	Quit sc
}

}

Add this service to your production, to trigger every one minute set the setting CallInterval=60 (seconds).

Enrico

Again, difficult to tell from the limited info provided.

What are you doing after instantiating  HS.FHIRServer.API.Data.Request ?

HS.FHIRServer.API.Data.Request is a serial class, not a persistent class, are you using it in a SendRequest(Sync/Async) call? If so, then you cannot do that.

But again, this is only a guess, please provide more context.

Enrico

The documentation includes a lot of info about INSERT OR UPDATE Sql command, including:

"An existing row is one in which the value being inserted already exists in a column that contains a unique constraint. For more details, see Uniqueness Checks."

"When using INSERT OR UPDATE, you can only insert IDKEY column values, not update them. If the table has an IDKEY index and another UNIQUE constraint, INSERT OR UPDATE matches these columns to determine whether to perform an insert or an update. If the other key constraint fails, this forces INSERT OR UPDATE to perform an update rather than an insert. However, if the specified IDKEY column values do not match the existing IDKEY column values, this update fails and generates an SQLCODE -107 error, because the update is attempting to modify the IDKEY columns."

I suggest to read carefully the relevant documentation page.

Enrico

It seems that character 8211 (en dash) is not utf-8 but utf-16, google is your best friend and I'm not an expert in unicode, utf-8, utf-16 etc.! 😊

Set xml="<?xml version=""1.0"" encoding=""UTF-8""?>"
Set xml=xml_"<Text>This is n-dash "_$wc(8211)_" in xml</Text>"
Set xml=$ZCONVERT(xml,"O","UTF8")
Set sc=##class(%XML.XPATH.Document).CreateFromString(xml, .xmlDoc)
Write sc
Set sc=xmlDoc.EvaluateExpression("/Text","text()",.result)
Write result.GetAt(1).Value,!

Result:

This is n-dash – in xml

Enrico

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