Robert Cemper · Nov 30, 2021 go to post

suggestion

ClassMethod Login(ByRef streamReturn As %GlobalBinaryStream, user As %String, pass As %String) As %Status [ ProcedureBlock = 1 ]
{
 set streamReturn=##class(%GlobalBinaryStream).%New()
 set cswReturn={}
 set cswReturn.success=1
 ;
 set format=##class(%JSON.Formatter).%New()
 set format.Indent=0
 set format.LineTerminator=""
 set sc=format.FormatToStreamFromObject(cswReturn,.streamReturn)  
 quit sc
}
Robert Cemper · Nov 30, 2021 go to post

I have to add a few personal remarks.
This issue of the monthly reviews is exceptional as there is no package rated below 5*
In that sense, you may feel it be a Christmas edition.  And that's true for me.
It points out that the quality of contributions has significantly improved.
And as I try every package myself  I find problems and sometimes solutions too,
that I post as Pull Request on GitHub.
Pls understand, if I place Pull Request it is meant as help, suggestion but never as critics.
Some of you have already consumed this support as a kind of field testing.
And I offer it again to you to improve the quality of your package also before publishing.
My resources at home are of course limited and connections to external systems are not available.
I don't have medical devices or a machine park at home.
In addition, I'd like to thank you for your trust and your examples.
And over time I learned a lot about Docker configurations and various tricks to run them.
And there are areas where I just have no expertise. I skip these subjects.
Finally.
You are an exceptional society and I enjoy again and again to work with you

Robert Cemper · Nov 29, 2021 go to post

case sensitivity of packages is an ongoing challenge.
top-level := developer is ok.
but who should use top-level dc ?
I ask because every template uses dc for the example packages. which is ok.
but users follow this example (often).   

Robert Cemper · Nov 28, 2021 go to post

this is the method description  it seems that you should your call parameters differently

method ExecuteProcedure(ByRef pResultSnapshots As %ListOfObjects,
        Output pOutputParms As %ListOfDataTypes,
        pQueryStatement As %String,
        pIO As %String,
        pInputParms...)
 as %Status [ Language = objectscript ]

The pOutputParms list returns the output values of all scalar output and input/output parameters.
This would result in this order

SET tSC = ..Adapter.ExecuteProcedure( , .outparmSQLQuery2 , "io*"pRequest.StringValue )

>> 1st par  - skipped
>> 2nd par = output byRef
>> 3rd par = SqlQuery
>> 4th par = io
>>par 5 ... query input parameters
 

This explains the log

Robert Cemper · Nov 28, 2021 go to post

pass outparm by reference    .outparm

  SET tSC = ..Adapter.ExecuteProcedure(,,SQLQuery2,"io*",pRequest.StringValue,.outparm )

Robert Cemper · Nov 28, 2021 go to post

intersystemsdc/irishealth-community:2021.1.0.215.3-zpm should do it
or simply the latest

docker run --name my-iris -d -p 9091:1972 -p 9092:52773 intersystemsdc/irishealth-community
Robert Cemper · Nov 26, 2021 go to post

BINGO! 
that''s the way to go.

I typically use from Terminal

>SET ^GO=0

and in code 

SET ^JOB($h)=$JOB FOR x=1:0 HANG 1 IF $GET(^GO) QUIT

and of course Studio to attach
or I use $system.CSP.Shell()  as described here
 

Robert Cemper · Nov 26, 2021 go to post

as official documentation tells you:
https://docs.intersystems.com/iris20211/csp/docbook/DocBook.UI.Page.cls?KEY=GSQL_langelements#GSQL_langelements_ops_precedence

 
USER>SET status=$SYSTEM.SQL.Util.SetOption("ANSIPrecedence",1,.oldval)
 
USER>do $system.SQL.Shell()
SQL Command Line Shell
---------------------------------------------------

[SQL]USER>>SELECT 1+2*3+4*5
1.      SELECT 1+2*3+4*5
Expression_1
27
^^^^-----------------------------------------------
[SQL]USER>>q
 
USER>SET status=$SYSTEM.SQL.Util.SetOption("ANSIPrecedence",0,.oldval)
 
USER>do $system.SQL.Shell()
SQL Command Line Shell
---------------------------------------------------
 
[SQL]USER>>SELECT 1+2*3+4*5
3.      SELECT 1+2*3+4*5
 
Expression_1
65 
^^^^----------------------------------------------
[SQL]USER>>

.

Robert Cemper · Nov 26, 2021 go to post

Even the possibility of changing this elementary rule after 60+years
has the power and the risk of breaking millions of lines of code worldwide.
It's for people like you that are not willing to accept these rules that
the introduction of Embedded Python is encouraged. 

With the same mindset,
you may demand to revert from Italian, French Spanish, Portuguese
to pure Latin as spoken by Cesar. Or for French to Occitan ?

Robert Cemper · Nov 26, 2021 go to post

Forget about the week  and put your long query into a subselect

SELECT Sum(Dicos),Sum(Gen),Sum(Philo),Sum(Religion), Sum(SHS), ....
FROM (
.... your long query
)  
Robert Cemper · Nov 23, 2021 go to post

the example breaks on Win and in Docker with <DIVIDE>. PullRequest for fix is pending

Robert Cemper · Nov 22, 2021 go to post

Of course! Browser Caching could be a beast.
I remember CSP or ZEN testing when I couldn't get rid of the old cached image version

Robert Cemper · Nov 21, 2021 go to post

a typical feature of DNS resolution is caching of the translations
of servername.domain.name.tld or servername to IP addr.
so the resolution is just done once.
And a clever DNS would detect "oh it's me"
 

Robert Cemper · Nov 19, 2021 go to post

hmmm 4 hours is a lot.
What's the DB you insert it ? If external, jdbc / odbc ?

Robert Cemper · Nov 18, 2021 go to post

it is possible, but I'd rate it as highly inefficient. You have been warned.
working for objects and SQL

/// The company this employee works for.
Relationship Company As Company [ Cardinality = one, Inverse = Employees ];

Property Cname As %String [ Calculated, SqlComputeCode =
    {set {*}=##class(Company).%OpenId({Company}).Name }, SqlComputed ];
Robert Cemper · Nov 18, 2021 go to post

what's the location to work ?
???  
611 N. Iron Bridge Way
Spokane, WA 99202
???

Robert Cemper · Nov 16, 2021 go to post

It was an additional pleasure to see your verbose comments in dock-compose.yml.
not just the usual plain parameters with no explanation of what the intention is!

yesyesyes

Robert Cemper · Nov 16, 2021 go to post

running the docker image uncovered the result (interactive:=> docker-compose up)   
only at stopping of the container.  So I changed installer.sh and run the method from iris session

This gave me the full dimension of this EXCELLENT TOOL!  especially the integrity check!
I just can say WOW. 
So delegating of routine jobs of a System Manager becomes safe and easy.

This is the output that kicked me:

-------------------------------------------------------------------------------
irisowner@7aa9b053e544:/opt/irisapp$ iris session iris -U "%SYS" 
Node: 7aa9b053e544, Instance: IRIS
%SYS>do ##class(BackupChecker.Installer).restoreAll("backup.cbk")
Starting to restore the Backup... It will take some time, be patient!
The following directories will be restored:
c:\intersystems\iris\mgr\appcode\ =>
                         /ISC/utiles/Restore/c:\intersystems\iris\mgr\appcode\/
c:\intersystems\iris\mgr\appdata\ =>
                         /ISC/utiles/Restore/c:\intersystems\iris\mgr\appdata\/
c:\intersystems\iris\mgr\cacheuser\ =>
                       /ISC/utiles/Restore/c:\intersystems\iris\mgr\cacheuser\/
c:\intersystems\iris\mgr\remote\ =>
                          /ISC/utiles/Restore/c:\intersystems\iris\mgr\remote\/
c:\intersystems\iris\mgr\user\ =>
                            /ISC/utiles/Restore/c:\intersystems\iris\mgr\user\/ Cannot mount database in /ISC/utiles/Restore/c:\intersystems\iris\mgr\cacheuser\/ because
its default collation is not available (see messages.log).
c:\intersystems\iris\mgr\cacheuser\ will not be restored. Cannot mount database in /ISC/utiles/Restore/c:\intersystems\iris\mgr\remote\/ because
its default collation is not available (see messages.log).
c:\intersystems\iris\mgr\remote\ will not be restored. ***Restoring c:\intersystems\iris\mgr\appcode\ to /ISC/utiles/Restore/c:\intersystems\iris\mgr\appcode\/ at 10:18:55
469 blocks restored in 0.0 seconds for this pass, 469 total restored. ***Restoring c:\intersystems\iris\mgr\appdata\ to /ISC/utiles/Restore/c:\intersystems\iris\mgr\appdata\/ at 10:18:55
413 blocks restored in 0.0 seconds for this pass, 413 total restored. Starting skip of c:\intersystems\iris\mgr\cacheuser\.      skipped 77 blocks in .007096 seconds. Starting skip of c:\intersystems\iris\mgr\remote\.      skipped 77 blocks in .006635 seconds. ***Restoring c:\intersystems\iris\mgr\user\ to /ISC/utiles/Restore/c:\intersystems\iris\mgr\user\/ at 10:18:55
656 blocks restored in 0.1 seconds for this pass, 656 total restored. ***Restoring c:\intersystems\iris\mgr\appcode\ to /ISC/utiles/Restore/c:\intersystems\iris\mgr\appcode\/ at 10:18:55
1 blocks restored in 0.0 seconds for this pass, 470 total restored. ***Restoring c:\intersystems\iris\mgr\appdata\ to /ISC/utiles/Restore/c:\intersystems\iris\mgr\appdata\/ at 10:18:55
1 blocks restored in 0.0 seconds for this pass, 414 total restored. Starting skip of c:\intersystems\iris\mgr\cacheuser\.      skipped 1 blocks in .000007 seconds. Starting skip of c:\intersystems\iris\mgr\remote\.      skipped 1 blocks in .000008 seconds. ***Restoring c:\intersystems\iris\mgr\user\ to /ISC/utiles/Restore/c:\intersystems\iris\mgr\user\/ at 10:18:55
1 blocks restored in 0.0 seconds for this pass, 657 total restored. ***Restoring c:\intersystems\iris\mgr\appcode\ to /ISC/utiles/Restore/c:\intersystems\iris\mgr\appcode\/ at 10:18:55
1 blocks restored in 0.0 seconds for this pass, 471 total restored. ***Restoring c:\intersystems\iris\mgr\appdata\ to /ISC/utiles/Restore/c:\intersystems\iris\mgr\appdata\/ at 10:18:55
1 blocks restored in 0.0 seconds for this pass, 415 total restored. Starting skip of c:\intersystems\iris\mgr\cacheuser\.      skipped 1 blocks in .000022 seconds. Starting skip of c:\intersystems\iris\mgr\remote\.      skipped 1 blocks in .000008 seconds. ***Restoring c:\intersystems\iris\mgr\user\ to /ISC/utiles/Restore/c:\intersystems\iris\mgr\user\/ at 10:18:55
1 blocks restored in 0.0 seconds for this pass, 658 total restored. Mounting /ISC/utiles/Restore/c:\intersystems\iris\mgr\appcode\/
    /ISC/utiles/Restore/c:\intersystems\iris\mgr\appcode\/  ... (Mounted) Mounting /ISC/utiles/Restore/c:\intersystems\iris\mgr\appdata\/
    /ISC/utiles/Restore/c:\intersystems\iris\mgr\appdata\/  ... (Mounted) Mounting /ISC/utiles/Restore/c:\intersystems\iris\mgr\user\/
    /ISC/utiles/Restore/c:\intersystems\iris\mgr\user\/  ... (Mounted) 
[Journal not applied to any directory] 
Restored completed!

Starting the Integrity report
Directory: /ISC/install/mgr/
No errors found
Summary of blocks in /ISC/install/mgr/         87 Pointer Level blocks         696kb (16% full)
     5,908 Data Level blocks             46MB (84% full)
     2,553 Big String blocks             19MB (86% full) # = 1,011
     8,563 Total blocks                  66MB (84% full)
     2,951 Free blocks                   23MB Elapsed time = 14.3 seconds. Directory: /ISC/install/mgr/irisaudit/
No errors found
Summary of blocks in /ISC/install/mgr/irisaudit/         34 Pointer Level blocks         272kb (0% full)
        54 Data Level blocks            432kb (33% full)
         4 Big String blocks             32kb (99% full) # = 1
       107 Total blocks                 856kb (20% full)
        21 Free blocks                  168kb Elapsed time = 6.1 seconds. Directory: /ISC/install/mgr/irislocaldata/
No errors found
Summary of blocks in /ISC/install/mgr/irislocaldata/         35 Pointer Level blocks         280kb (1% full)
       213 Data Level blocks           1704kb (58% full)
        25 Big String blocks            200kb (74% full) # = 13
       288 Total blocks                2304kb (49% full)
     1,130 Free blocks                 9040kb Elapsed time = 6.5 seconds. Directory: /ISC/install/mgr/iristemp/
No errors found
Summary of blocks in /ISC/install/mgr/iristemp/         46 Pointer Level blocks         368kb (0% full)
        81 Data Level blocks            648kb (33% full)
         0 Big String blocks
       142 Total blocks                1136kb (19% full)
     1,177 Free blocks                 9416kb Elapsed time = 8.5 seconds. Directory: /ISC/install/mgr/user/
No errors found
Summary of blocks in /ISC/install/mgr/user/         50 Pointer Level blocks         400kb (0% full)
        73 Data Level blocks            584kb (27% full)
         0 Big String blocks
       138 Total blocks                1104kb (14% full)
     1,270 Free blocks                10160kb Elapsed time = 8.9 seconds. Directory: /ISC/utiles/Restore/c:\intersystems\iris\mgr\appcode\/
No errors found
Summary of blocks in /ISC/utiles/Restore/c:\intersystems\iris\mgr\appcode\/         32 Pointer Level blocks         256kb (2% full)
       379 Data Level blocks           3032kb (71% full)
        43 Big String blocks            344kb (88% full) # = 12
       469 Total blocks                3752kb (66% full)
     1,067 Free blocks                 8536kb Elapsed time = 0.1 seconds. Directory: /ISC/utiles/Restore/c:\intersystems\iris\mgr\appdata\/
No errors found
Summary of blocks in /ISC/utiles/Restore/c:\intersystems\iris\mgr\appdata\/         57 Pointer Level blocks         456kb (0% full)
       241 Data Level blocks           1928kb (66% full)
       100 Big String blocks            800kb (92% full) # = 30
       413 Total blocks                3304kb (61% full)
       995 Free blocks                 7960kb Elapsed time = 0.1 seconds. Directory: /ISC/utiles/Restore/c:\intersystems\iris\mgr\user\/
No errors found
Summary of blocks in /ISC/utiles/Restore/c:\intersystems\iris\mgr\user\/         68 Pointer Level blocks         544kb (1% full)
       447 Data Level blocks           3576kb (70% full)
       126 Big String blocks           1008kb (90% full) # = 33
       656 Total blocks                5248kb (65% full)
       752 Free blocks                 6016kb Elapsed time = 0.2 seconds. Directory: /usr/irissys/mgr/enslib/
No errors found
Summary of blocks in /usr/irissys/mgr/enslib/        130 Pointer Level blocks        1040kb (33% full)
    14,684 Data Level blocks            114MB (97% full)
     4,407 Big String blocks             34MB (88% full) # = 1,606
    19,236 Total blocks                 150MB (94% full)
     1,500 Free blocks                   11MB Elapsed time = 12.6 seconds. Directory: /usr/irissys/mgr/irislib/
No errors found
Summary of blocks in /usr/irissys/mgr/irislib/        180 Pointer Level blocks        1440kb (60% full)
    39,001 Data Level blocks            304MB (98% full)
    11,177 Big String blocks             87MB (86% full) # = 4,234
    50,373 Total blocks                 393MB (95% full)
        59 Free blocks                  472kb Elapsed time = 7.9 seconds. Directory: /usr/irissys/mgr/zpm/
No errors found
Summary of blocks in /usr/irissys/mgr/zpm/         44 Pointer Level blocks         352kb (11% full)
     2,129 Data Level blocks             16MB (97% full)
       453 Big String blocks           3624kb (88% full) # = 175
     2,641 Total blocks                  20MB (94% full)
       431 Free blocks                 3448kb Elapsed time = 7.7 seconds. Run successfully and found NO errors! 
Databases are VALIDATED!
%SYS>
-------------------------------------------------------------------------------
Robert Cemper · Nov 15, 2021 go to post
callSQL ;
 ; compose an SQL Statement
 set query="SELECT something FROM TABLE_A JOIN TABLE_B ON ...........WHERE ...."  
 set rs=##class/%ResultSet.%NEW()
 set sc=rs.Prepare(query)
 if 'sc write $system.OBJ.DisplayError(sc)
 set sc=rs.Execute()
 if 'sc write $system.OBJ.DisplayError(sc)
 while rs.%Next() {
    ;consume the result set  row by row
}

OK yo can write this in .INT, in .MAC, in Methods .....
and SORRY:
IDX is still just 3 chars to me, as Athena is 6 chars. (or the Greek Godess of Wisdom)

Robert Cemper · Nov 12, 2021 go to post

BIG CONGRATULATIONS to the team that made this possible!

When I joined ISC ~20 years ago I was shocked that there was no exchange
of information and code between customers. There was just nothing.
As SSE I met customers that didn't know of each other just living within a mile's distance.

I made noise and rumors and proposals to change this.
Located in Vienna(Austria, EU) with no local office I had zero influence.
I was like an alien from the outer edge of the milky way.

Only 4 years ago, 3  years after my retirement from ISC, and just by accident, I met the Community.  
I'm happy that "my personal" dream became so successful true.
Thanks to the amazing team and their many ideas that move the Community forward. 

Robert Cemper · Nov 11, 2021 go to post

I assume your Classmethod runs from console / terminal.
running as scheduled Task you are always running in Background.
So where do you expect all the WRITE to go.
I did neither see a log file or a Spool device.