Encontrar

質問
· 2025年9月4日

Regex search for Z09 or any string of A-Z followed by 0-9 0-9

..Contains(source.{ORCgrp(x1).OBRuniongrp.NTEi2(x2):Comment(x3)},"(")&&..Matches(source.{ORCgrp(x1).OBRuniongrp.NTEi2(x2):Comment(x3)},"^[A-Z][0-9][0-9]$")

I want to do this to match strings such as X98. Community AI tells me this is correct but I get an error in testing. Specifically, this is the part causing the error;
..Matches(source.{ORCgrp(x1).OBRuniongrp.NTEi2(x2):Comment(x3)},"^[A-Z][0-9][0-9]$")


What do I need to change?

1件の新着コメント
ディスカッション (1)2
続けるにはログインするか新規登録を行ってください
お知らせ
· 2025年9月4日

Be Part of Our 10-Year Anniversary Video!

This year, our InterSystems Developer Community turns 10 years old — and we’re inviting YOU to take part in the celebration!

We’re creating a special community video filled with greetings and memories from members worldwide. Want to join in? It’s simple:

▶️ Record a short clip (1-2 mins) where you:

  • Share a favorite highlight or memorable moment from your time in the Developer Community
  • Send your congratulations on the 10th anniversary 🎊

We’ll combine the contributions into one big celebratory video for everyone to enjoy! 🎬✨

👉 Click here to record your video 

It only takes a couple of minutes — just follow the on-screen prompts; no setup is required. Once you’re done, we’ll automatically receive your video.

Don’t miss your chance to be featured in the official 10th anniversary celebration! 🥂

1件の新着コメント
ディスカッション (1)2
続けるにはログインするか新規登録を行ってください
質問
· 2025年9月4日

Need help with getting data from a Zen page property and setting column widths in my dynaGrid

Given the code below, I need help with getting the collected column widths from the Demo.Configuration table and stored in the columnWidths zne page property. As I understand it, I should be able to retrieve it using zenPage.columnWidths in the setColumnWidths or dgRender clientMethods but the alert is showing that it cannot be retrieved as it shows a value of Null. Once I can retrieve those values, then I want to set the widths of the colmns of the dynaGrid according to the values in the ^Demo.Configuration table. The data pulled in from the CSV file that creates ^Demo.Import can have a different included columns depending on the choices of the user.

/// Created using the page template: Title Page
Class Demo.DynaGrid Extends %ZEN.Component.page
{
/// Displayed name of this page.
Parameter PAGENAME = "DynamicDynaGrid";
/// Property to hold column widths
Property columnWidths As %ZEN.Datatype.string;
/// This Style block contains page-specific CSS style definitions.
XData Style
{
<style type="text/css">
/* style for title bar */
#title {
               background: #C5D6D6;
               colorblack;
               font-familyVerdana;
               font-size: 1.5em;
               font-weightbold;
               padding: 5px;
               border-bottom: 1px solid black;
               text-aligncenter;
}
</style>
}
/// This XML block defines the contents of this page.
XData Contents [ XMLNamespace = "http://www.intersystems.com/zen]
{
<page xmlns="http://www.intersystems.com/zentitle="">
<html id="title">Demo: Dynamic Dyna Grid</html>
<spacer height="10"/>
<vgroup width="100%">
<dynaGrid id="dgDynaGrid" OnCreateDataSet="CreateDS"
showColumnLabels="true"
showRowLabels="false"
showZebra="true"
width="100%">
</dynaGrid>
</vgroup>
<!-- gridRow style="text-align:left;"/ -->
<!-- onrender="zenPage.dgRender(zenThis);" -->
</page>
}
ClassMethod CreateDS(pGrid As %ZEN.Component.dynaGrid, pDataSet As %ZEN.Auxiliary.dataSet) As %Status
{
               Set $ZT="Error"
               Kill ^UT("Demo.DynaGrid","CreateDS")
              
               // Clear out data set
               Do pDataSet.%Clear()
              
               // column labels (dimension 2)
               Set tHeader=^Demo.Import("ImportedData",1),colcont=0
               Set colWidths=""
               For p=1:1:$LL(tHeader) {
                              Set colName=$TR($LG(tHeader,p)," ")
                              Do pDataSet.%SetLabel(colName,$I(colcount),2)
                              If colName="Employee" {
                                             Do pDataSet.%SetLabel("CoConsultant",$I(colcount),2)
                              Set colWidths=colWidths_$Get(^Demo.Configuration("ReviewImportData","ColumnWidth","CoConsultant"),"100")_","
                              }
               Set colWidths=colWidths_$Get(^Demo.Configuration("ReviewImportData","ColumnWidth",colName),"100")_","
               }
               Do pDataSet.%SetLabel("Include",$I(colcount),2)
Set colWidths=colWidths_$Get(^Demo.Configuration("ReviewImportData","ColumnWidth","Include"),"100")
              
               // get size of dataSet
               //Set rows = pDataSet.%GetDimSize(1)
               Set cols = pDataSet.%GetDimSize(2)
               // Now populate the data in the new table
               // Do pDataSet.%SetValue(value,row,col)
               For row=2:1 {
                              If '$Data(^Demo.Import("ImportedData",row)) Quit
                              Set rowData=^Demo.Import("ImportedData",row),colcount=0
                              For col=1:1:$LL(tHeader) {
                                             Set val=$LG(rowData,col),cHead=$TR($LG(tHeader,col)," ")
                                             Do pDataSet.%SetValue(val,(row-1),$I(colcount))
                                             If $LG(tHeader,col)="Employee" Do pDataSet.%SetValue("",(row-1),$I(colcount))
                              }
                              Do pDataSet.%SetValue("Yes",(row-1),$I(colcount))
               }
               //
               Set %page.columnWidths = colWidths
               Set ^UT("Demo.DynaGrid","CreateDS","cols")=cols
               Set ^UT("Demo.DynaGrid","CreateDS","colWidths")=colWidths
               Set ^UT("Demo.DynaGrid","CreateDS","%page.columnWidths")=%page.columnWidths
               //Do zenPage.setColumnWidths(pGrid, colWidths)
               //
               Quit $$$OK
Error     //
               Set ^UT("Demo.DynaGrid","CreateDS","Error")=$ZE
               Do ^%ETN
}
ClientMethod dgRender(pGrid) [ Language = javascript ]
{
              
               var colWidths=zenPage.getColumnWidths();
               alert('dgRender:\n\n colWidths = ',colWidths);
               pGrid.columnWidth colWidths;
}
ClientMethod setColumnWidths(pGrid, colWidths) [ Language = javascript ]
{
              
               alert('setColumnWidths:\n\n colWidths = ',colWidths);
}
ClassMethod getColumnWidths() As %String
{
               Set ^UT("Demo.DynaGrid","getColumnWidths","%page.columnWidths")=%page.columnWidths
               Quit %page.columnWidths
}
}

Here is the data:

^Demo.Configuration("ReviewImportData","ColumnWidth","CoConsultant")=110

^Demo.Configuration("ReviewImportData","ColumnWidth","CouponCode")=50

^Demo.Configuration("ReviewImportData","ColumnWidth","Customers")=300

^Demo.Configuration("ReviewImportData","ColumnWidth","Employee")=110

^Demo.Configuration("ReviewImportData","ColumnWidth","Include")=60

^Demo.Configuration("ReviewImportData","ColumnWidth","Note")=300

^Demo.Configuration("ReviewImportData","ColumnWidth","PaymentAmount")=60

^Demo.Configuration("ReviewImportData","ColumnWidth","Service")=200

^Demo.Configuration("ReviewImportData","ColumnWidth","StartTime")=160

^Demo.Configuration("ReviewImportData","ColumnWidth","Status")=100

 

^Demo.Import("ImportedData",1)=$lb("Customers","Employee","Service","Start Time","Payment Amount","Note","Status","Coupon Code")

^Demo.Import("ImportedData",2)=$lb("Mickey Mouse","Adrian Monk","Check-In","April 1, 2025 10:00","50.00","This is a note","Approved","")

^Demo.Import("ImportedData",3)=$lb("Minnie Mouse","Adrian Monk","Check-In","April 4, 2025 10:00","50.00","This is a note","Approved","")

^Demo.Import("ImportedData",4)=$lb("Donald Duck","Adrian Monk","Check-In","April 7, 2025 10:00","50.00","This is a note","Approved","")

^Demo.Import("ImportedData",5)=$lb("Martin Martian","Sharona Fleming","Check-In","April 14, 2025 10:00","50.00","This is a note","Approved","")

^Demo.Import("ImportedData",6)=$lb("Pete Paisano","Adrian Monk","Check-In","April 18, 2025 10:00","50.00","This is a note","Approved","")

^Demo.Import("ImportedData",7)=$lb("Goofy Dogg","Sharona Fleming","Check-In","April 21, 2025 10:00","50.00","This is a note","Approved","")

^Demo.Import("ImportedData",8)=$lb("Mark Mouse","Adrian Monk","Check-In","April 24, 2025 10:00","50.00","This is a note","Approved","")

^Demo.Import("ImportedData",9)=$lb("Popeye Sailorman","Adrian Monk","Check-In","April 25, 2025 10:00","50.00","This is a note","Approved","")

^Demo.Import("ImportedData",10)=$lb("Mickey Mouse","Sharona Fleming","Check-In","April 27, 2025 10:00","50.00","This is a note","Approved","")

 

Thank you

1件の新着コメント
ディスカッション (1)1
続けるにはログインするか新規登録を行ってください
記事
· 2025年9月4日 4m read

IRIS in Docker for beginners

The article was motivated by the 2025 September Article Bounty
***************************************************************


The principle of Docker is just convincing to me.

  • Get a sandbox where you play and try whatever you want/need to do
  • Once done. You drop it without leaving traces in your working environment

This was the technical base for me to run about 700 reviews in OEX 
with almost no side effects  (except those caused by myself).

For beginners, I'll start with straight pure IRIS, no *health, *ML, *whatever

First, you need a Docker installation. It's available on almost any platform.
My personal preference is Windows Docker Desktop for its comfortable admin console.
I don't dig into detailed Docker management.
There's enough reading material around to search in Docker Docs

Second, you decide on an IRIS incarnation of your choice
the most simple: intersystemsdc/iris-community  ready to use

  • runs on Ubuntu
  • has a valid community licence
  • has Apache httpd installed
  • has IPM/ZPM client installed

Warning #1:  As a beginner, don't study packages offered on OEX
They are great (mostly) but always targeted to some Functionality
to some special Application that requires special settings and a tricky installation.

Warning #2:  Docker has a rich set of commands with everything you need
And those commands offer a flood of (sometimes confusing) parameters.
So, I suggest making them reproducible using dedicated scripts.
Dockerfile is the way to take with complex constructs with lots of extras to be
loaded upfront. I typically saw them related to Python and to various AI demo cases
There's no need for this example.
docker-compose.yml is the real to blow your container. It needs:

  • a definition of what you want to "compose"  >> service: 
    • a name for it  >>  iris:
    • which image to run  >> image: intersystemsdc/iris-community
  • Next, you need to define how SuperServer Port 1972 and the   default WebServer Port 52773 will be visible outside the container
    •     ports:      - 41773:1972   - 42773:52773
  • Finally,  it' not an urgent requirement but often very useful to map your local directory to some internal in the container. I used /external Especially at the beginning, this bi-directional path makes life really easy
    • volumes:  - ./:/external

Now this is the final text of docker-compose.yml

services:
  iris:
    image: intersystemsdc/iris-community
    ports: 
      - 41773:1972
      - 42773:52773
    volumes:
      - ./:/external

And now you are ready to run your first IRIS instance in Docker

  • docker-compose up  allows you to watch the full startup
  • docker-compose up -d  launches a  start in the background and keeps your command line free
  • docker ps -a    shows ports and running images of your IRIS container

OK your fresh IRIS is in Docker now.
But how can you use it?

  • You have the WebServer and so the Management Portal http://localhost:42773/csp/sys/UtilHome.csp
  • You have the SuperServerPort for ODBC access, IRIS NATIVE, ... (and even Studio) 
  • And you can access IRIS also from the command line inside the container​​​​​​
    • docker-compose exec iris iris session iris
  • Splitting this single line, you access the container first and then IRIS
    • docker-compose exec iris bash
    • Then iris view
      • Instance 'IRIS'   (default)
                directory:    /usr/irissys
                versionid:    2025.1.0.223.0com
                datadir:      /usr/irissys
                conf file:    iris.cpf  (WebServer port = 52773)
                status:       running, since Thu Sep  4 14:35:19 2025
                SuperServers: 1972
                state:        ok
                product:      InterSystems IRIS
      • And iris session iris
      • Node: 3266c5c8b21f, Instance: IRIS 
        USER>
    • Here at the bash level, you have all the options for IRIS operating in your hands Your Ubuntu user is  irisowner
    • for the rare cases where you might need root access docker-compose exec -u root iris bash
    • Stop your container with  docker-compose down

A few considerations on changes during the container session.

  • Whatever you create, change, or modify exists as long as the container exists
    • Once the container is deleted, all changes, .... are gone. 
  • This might be annoying with large setups.
  • Dockerfile takes care of a setup that is done once in a build cycle, differently to run the setup at every start of the container.
  • This is good practice in OEX packages, though it might look like overkill in some cases 
2件の新着コメント
ディスカッション (2)3
続けるにはログインするか新規登録を行ってください
記事
· 2025年9月4日 2m read

Vincular tabelas programaticamente

Rubrica InterSystems FAQ

No InterSystems IRIS, você pode criar tabelas vinculadas usando comandos, ao invés de usar o caminho System Explorer > SQL > Wizard > Linked Tables do Portal de Administração:

Para criar uma tabela vinculada, use o método CreateLinkedTable da classe  %SYSTEM.SQL.Schema. Veja a documentação da classe para detalhes.

Para executar, siga os passos:

set sc = $SYSTEM.SQL.Schema.CreateLinkedTable("<dsn>","<Schema>","<Table>","<primaryKeys>","<localClass>","<localTable>","")

/// 1st argument: dsn - SQL Gateway connection name
/// 2nd argument: Schema - Source schema name
/// 3rd argument: Table - Source table name
/// 4th argument: primaryKeys - Primary key
/// 5th argument: localClass - Linked class name (e.g., User.LinkedClass)
/// 6th argument: localTable - Linked SQL table name (SqlTableName)
/// 7th argument: columnMap - Linked field information

Se você executar o código dessa maneira, a tabela vinculada será criada com o atributo ReadOnly. Se quiser removê-lo, é necessário especificá-lo no sétimo argumento, columnMap.

set columnMap("external field name") = $lb("new class property name","new sql field name","read-only(1/0)")

Nessa amostra, um columnMap é criado, definindo ReadOnly como 0 para todos os campos (colunas), e uma tabela vinculada é criada. A primaryKey é definida para herdar a primaryKey da tabela vinculada. O uso é como a seguir:

do ##class(ISC.LinkUtils).LinkTable("<dsn>","<Schema>","<Table>","<localClass>")

/// First argument: dsn - SQL Gateway connection name
/// Second argument: Schema - Link source schema name
/// Third argument: Table - Link source table name
/// Fourth argument: localClass - Link destination class name (e.g., User.LinkedClass)

Você também pode ver o exemplo usado aqui: https://github.com/Intersystems-jp/CreateLinkedTable

ディスカッション (0)1
続けるにはログインするか新規登録を行ってください