Yone, what is the data type of the property "datos" in Mensajes.Response.HistoriaClinica.ConsultaCitasResponse. I assume it's a list of a custom class that has two properties named fecha and hora?

Property datos as List of my.class.dato;

If so, you would do something like this:

set dato=##class(my.class.dato).%New()
set dato.fecha=fecha
set dato.hora=hora
do target.datos.InsertAt(dato,indice)

When the delay expires, Ens.Alarm will send a message back to the business process. You can query to find any messages that have been sent to Ens.Alarm but for which it hasn't sent a message back. This is based on the value of status: the status will be "Delivered" until Ens.Alarm sends the message back to the BP, at which point it will change to "Completed".

SELECT * FROM ens.messageheader WHERE status='Delivered' AND sourceconfigname='MyBPL' AND targetconfigname='Ens.Alarm'

As Eduard mentioned, it would be good to understand the use case as there may be another way to accomplish it.

You're right, this code will not work as-is with fields that exceed the max string size (~ 3 MB). If you expect large fields/segments (such as attachments in OBX:5), there are stream-handling methods that you can use.

If OBX:5 is smaller than the max string size then I don't see any problem regardless of what type of data it contains as the OBX:5 content shouldn't include "^".

I just did a test with .Find() and was able to compile with no error and the rule executes correctly depending on the values in the inbound record. Here's what my rule looks like:

Is your router receiving the Record object from the record map or the batch object?

Since Find() doesn't meet your use case, it sounds like you'll need to loop through all of the values in that field. Routing rules can't do loops, so the right way to do this would be to create a custom function and pass it either the main Document or Document.ObservationValue. In your custom function you can iterate through the entire list and return a boolean.

Docs on creating a custom function:
https://docs.intersystems.com/healthconnect20191/csp/docbook/Doc.View.cl...

Hi Neil,

Can you provide some more details?

Is this record map being used for pulling data into the system or for outputting data?
Which component is logging the error -- business service, router/business process, business operation?
What is the error message?
Can you give an example of a record that causes the error?
Can you show the record map definition?

-Marc

As far as I know, there is no configuration option for automatically removing trailing delimiters. So your post-processing approach seems like the way to go.

It looks like Randy's example only removes trailing carats at the end of the segment. I've seen a different version of this code (also by Randy) that includes this additional piece which removes trailing carats from each field in the segment.

       ; Remove trailing up carats within a field
       set tIndex = 0
       while $FIND(tSegment,"^|",tIndex) > 0 {
           set tSegment = $Replace(tSegment,"^|","|")
           do pHL7.SetValueAt(tSegment,tCount)
       }

It's not clear what logic you want to use to evaluate the list properties, but if you want to, for example, check if any of the items in the list contain a particular value, you could use the Find() method in the class %ListOfDataTypes.

In that case the condition in your routing rule would be something like this:

Document.ResultText.Find("MyValue") '= ""

Yone,

I think there's a problem with your Write() method. It is outputting data from the "stream" object, but "stream" is always set to a new (empty) stream and populated with data from "writer", which is also a new (empty) %XML.Writer object. So I don't see how this method could ever output any data.

Regarding the CSP error when requesting the WSDL, have you checked the application log to see what the actual error is?

-Marc

"it is quite curious to see it being replied from the Web Service to the Operation, where we can LOGINFO its propierties, and then, suddenly when we pass it to the Process, it is empty."

This is happening because when you receive it from the web service it is only stored in memory. In order to send it from the operation back to the business process it needs to be persisted in the database. This should be handled automatically by the parent (response) class if the child class is a %SerialObject -- it will automatically serialize the child object and store it under the parent's global.

We can demonstrate this with these two classes:

Class Demo.Obj.ParentClass Extends Ens.Response
{

Property parentProp1 As %String;

Property childList As list Of Demo.Obj.ChildClass;

ClassMethod populate()
{
    s parent=##class(Demo.Obj.ParentClass).%New()
    s parent.parentProp1=$ZDT($h)
    f i=1:1:10 {
        s child=##class(Demo.Obj.ChildClass).%New()
        s child.prop1="child.prop1."_i
        s child.prop2="child.prop2."_i
        zw child
        w "    ",parent.childList.Insert(child),!
    }
    w parent.%Save(), ":", parent.%Id(),!
}
}
Class Demo.Obj.ChildClass Extends (%SerialObject, %XML.Adaptor)
{

Property prop1 As %String;

Property prop2 As %String;
}

It's not clear to me why this isn't working in your example -- possible the storage definition needs to be reset since you changed it from %RegisteredObject to %SerialObject.

https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=GO...