@maxime keltsma 

You can traverse the entire global with a loop and $Order function.

A simple routine to traverse your global can be:

Teste
    Set ^DataTest = 3
    Set ^DataTest(1) = $lb("","1329","JMMK-G1D6")
    Set ^DataTest(2) = $lb("","1516","AMEV-GVPF")
    Set ^DataTest(3) = $lb("","2333","4QC6-4HW3")
    Set key = ""
    // Print the header filds
    Write "Reference", $Char(9), "Code"	, !	
    For   
    {
        // first parameter is global and key, 
        // second parameter opredr to travers globa. 1 = ascending subscript order (the default) or –1 = descending
        // third is target that receives the value if the key is defined
        Set key = $Order(^DataTest(key),  1, data)
        If (key = "")
        {
            Quit // Exit for loop
        }
        Set reference = $ListGet(data, 2)
        Set code = $ListGet(data, 3)
        //
        Write reference, $Char(9), code, !
        
    }

Output o execution:

> Do Teste^Teste
> Reference Code
> 1329 JMMK-G1D6
> 1516 AMEV-GVPF
> 2333 4QC6-4HW3

See Using Globals Object Script Tutorial , $Order Function for more examples e details.

Hello Adrian,

I think the problem is that you are concatenate a String with a Stream?

"DOC^Application^PDF^Base64^" _ target.{PIDgrpgrp(1).ORCgrp(1).OBXgrp(1).OBX:ObservationValue(1)}

You need to create a new Stream, call method write of the new Stream with the value "DOC^Application^PDF^Base64", after append the old Stream to the new one.

Hi John the diference between the operators &, && are

https://docs.intersystems.com/iris20231/csp/docbook/DocBook.UI.Page.cls?KEY=GCOS_operators#GCOS_operators_logicalcomp_list

And (& or &&)

And tests whether both its operands have a truth value of TRUE (1). If both operands are TRUE (that is, have nonzero values when evaluated numerically), ObjectScript produces a value of TRUE (1). Otherwise, ObjectScript produces a value of FALSE (0).

There are two forms to And:

  • The & operator evaluates both operands and returns a value of FALSE (0) if either operand evaluates to a value of zero. Otherwise it returns a value of TRUE (1).
  • The && operator evaluates the left operand and returns a value of FALSE (0) if it evaluates to a value of zero. Only if the left operand is nonzero does the && operator then evaluate the right operand. It returns a value of FALSE (0) if the right operand evaluates to a value of zero. Otherwise it returns a value of TRUE (1).

The following examples evaluate two nonzero-valued operands as TRUE and produces a value of TRUE (1).

Try to eclousere all expression in parentehsis:

(
    (
        (
            (
                HL7.{MSH:SendingApplication.NamespaceID}="Epic_Cupid"
            ) 
            && 
            (
                HL7.{ORCgrp(1).ORC:OrderControl} IN "NW,CA"
            )
        )
    ) 
    &&
    (
        (
            (
                HL7.{PIDgrp.PV1grp.PV1:AssignedPatientLocation(1).Facility.NamespaceID} NotIn "105,205"
            )
            &&
            (
                HL7.{ORCgrp(1).OBRuniongrp.OBRunion.OBR:UniversalServiceIdentifier.Identifier} NotIn "CATH01,EP22"
            )
        )
    )
) 

The operator & in Business Rule e Editor is string concatenation operator. Take care.

https://docs.intersystems.com/iris20231/csp/docbook/DocBook.UI.Page.cls?KEY=EBUS_rule#EBUS_ruleset_editor_expression_operators

Hi @Christine Nyamu 

Use $Piece function to get the value of a delimited string. In you specific case:

Set value = $Piece(obxValue, "<>", 2)

I assumed that the variable obxValue was set before in the code.

Note if the in the obx segment the value change the order like, "TESTED POSITIVE FOR ANEMIA<>BLOOD WORK WAS DONE<>TESTED NEGATIVE FOR HEPATITIS", the above sample code will fail

@Humza Arshad 

You can create a REST API/ SOAP API, or any other kind of protocol/technology, to get authentication, retrieve and send data to IRIS.

See the documentation: 

REST

SOAP

These other two link are two Open Exchange apllication to create Rest Services and Form UI.

RESTForms2

RESTFormsUI2

Search in the Leraning Portal for some course that help you.

Best Regards.