Hello Guilherme,

I'm not sure about what your goal is, but alternatively, you can use Stored Procedure attached to each group

<report xmlns="http://www.intersystems.com/zen/report/definition" name="MyName" runonce="true">
    <attribute name='attribute1' expression='..GetXXXXX(..P1)'/>
    <attribute name='attribute2' expression='..GetXXXXX(..P2)'/>
    <group name="GroupQuery1" queryClass='Custom.Reports.ZEN.StoredProc.StoredProc1' queryName='Query1'>
      <parameter field="attribute1"/>
      <parameter expression="..GetYYYY()"/>
      ...
      <group name="GroupResponse1">
        ...
      </group>
    </group>
    <group name="GroupQuery2" queryClass='Custom.Reports.ZEN.StoredProc.StoredProc2' queryName='Query2'>
      <parameter field="attribute2"/>
      <parameter expression="..GetZZZZZZ()"/>
      ...
      <group name="GroupResponse2">
        ...
      </group>
    </group>
</report>

Hope this help

Regards,

Jacques

Hello Everyone,

Thank you for all your really interesting comments. It helped a lot, especially on using ObjectScript classes I wasn't aware of.
But there could be a misunderstanding on the subject of this article.

The goal was not comparing several languages, but rather : "I did it with ObjectScript and the performances the way I did was not matching my expectations, so I would like to use an other language I know that match my expectations".
And to do so, before this language is embedded in ObjectScript I will use the external language Interface.

However, if I have known to use  %Stream.FileCharacter, I still would have done it in Python so that I can use $system.external Interface :)

Hello,

It depends on the SQL Table you are considering.

Some SQL Table have a column Y/N indicating that the record is active or not. In addition to a DateFrom and DateTo.

if the component has a checkbox "active" the SQL can be

Select * from SQLUser.SQL_Table where ActiveColumn = 'Y' and (DateFrom <= CURRENT_DATE or DateFrom is null) and (DateTo >=CURRENT_DATE or DateTo is null)

But it depends on the Table you are considering.

Please can you detail your needs?

Regards,

Jacques

Hello Wanbo Wang,

This error means that you have some element modified in TrakCare as Site level (or deleted), but the Questionnaire is Region Level. To solve this issue, you should check in TrakCare what GUID is missing:

Tools >> Change Control >> Find GUID

 

Check which component should have been saved as Region level or has been removed.

Once you have it saves as Region Level you will be able to commit to P4.


I checked in Perforce and it seems the component was deleted on 6 november 2020 with JIRA TC-260035 but recreated on 1st august 2021 with JIRA TC-301371.

 

 

 

So your problem should have been solved.

Regards,

Jacques

Hello,

You have to navigate through subscript using $order.
Assuming your first node is "under2" and won't change, and assuming your date is "DD-MM-YYYY"

you can do:

ClassMethod TestGlobalAccess()
{
   set ^checker("under2", "Eric David", "02-05-2018") = ""
   set ^checker("under2", "Eric2 David2", "02-07-2016") = ""
   set ^checker("under2", "Name1 Name2", "07-06-2018") = ""
   set Name = ""
   for {
        set Name = $order(^checker("under2", Name))
        quit:Name=""
        set DateBirth = ""
        for {
             set DateBirth = $order(^checker("under2",Name,DateBirth))
             quit:DateBirth=""
             set CacheDateBirth = $zdateh(DateBirth,15)
             if ((+$h-CacheDateBirth)>730) {
                  write $$$FormatText("%1 with Birthdate=%2 is older than 2 years",Name,DateBirth), !
             }
        }
    }
}

I hope this help.

for date conversion I decided to convert the birthdate into Cache Date, instead of converting $horolog into "DD-MM-YYYY" format.
But your method work also.

If you have only one record you can do:

ClassMethod Test()
{
   set ^checker("under2", "Eric David", "02-05-2018") = ""
   set Name = $order(^checker("under2", ""))
   quit:Name=""
   set DateBirth = $order(^checker("under2",Name,""))
   quit:DateBirth=""
   set CacheDateBirth = $zdateh(DateBirth,15)
   if ((+$h-CacheDateBirth)>730) {
      write $$$FormatText("%1 with Birthdate=%2 is older than 2 years",Name,DateBirth), !
   }
}

I hope this help.

Cheers,

Jacques