Mihoko Iijima · Jul 13, 2016 go to post

My samples is using 2 JavaScript libraries.
 1)  JSZip(http://stuk.github.io/jszip)
 2) FileSaver.js(https://github.com/eligrey/FileSaver.js/).
These library can downloads some files from one path at once and save as one Zip file.
Simple samples is below:
 

<!DOCTYPE html>downloadandzip-mojo-dojo_0.zip
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
 <script type="text/javascript" src="http://stuk.github.io/jszip/dist/jszip.min.jscharset="utf-8"></script>
 <script src="FileSaver.min.js" charset="utf-8"></script>
</head>
<body>
<form name=f1 method=post>
<h2>Download+Zip Simple sample</h2>
Please set urlList variable correct file path in startDL() before testing.
<br>
<input type="button" name="b1" value="Download" onclick=startDL()>
</form>
<script type='text/javascript'>
function startDL(){
// urlListにはダウンロード用ファイルを直接指定しています。
// 【注意】日本語を含むファイル名はダウンロードできません。
var urlList ["./ImageTest/IMG_3587.JPG","./ImageTest/IMG_3598.JPG"]
console.log(urlList);
zip new JSZip();
deferreds $.Deferred();
var promise deferreds;
$.map(urlList,function(value,index) {
    console.log('urlList:index='+index+' = '+value);
    console.log('match() : '+value.match(".+/(.+?)([\?#;].*)?$")[1]);
promise promise.then( function() {
var newPromise new $.Deferred();
var xhrnew XMLHttpRequest();
  xhr.open('GET',value,true);
xhr.responseType='arraybuffer';
xhr.addEventListener('load', function() {
// zipにレスポンスデータ追加
zip.file(value.match(".+/(.+?)([\?#;].*)?$")[1],xhr.response);
newPromise.resolve();
});
xhr.send();
        return newPromise;
});
});
promise.then( function() {
zip.generateAsync({type:"blob"}).then( function(content){
saveAs(content,'test.zip');
});
});
deferreds.resolve();
}
</script>
</body>
</html>

I attached sample for mojo+dojo.

Mihoko Iijima · Jul 13, 2016 go to post

My samples is using 2 JavaScript libraries.
 1)  JSZip(http://stuk.github.io/jszip)
 2)  FileSaver.js(https://github.com/eligrey/FileSaver.js/).
These library can downloads some files from one path at once and save as one Zip file.
Simple samples is below:::
 

<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><script src="http://code.jquery.com/jquery-1.9.1.min.js"></script><script type="text/javascript" src="http://stuk.github.io/jszip/dist/jszip.min.js" charset="utf-8"></script><script src="FileSaver.min.js" charset="utf-8"></script></head><body><form name=f1 method=post><h2>Download+Zip Simple sample</h2>Please set urlList variable correct file path in startDL() before testing.<br><input type="button" name="b1" value="Download" onclick=startDL()></form><script type='text/javascript'>function startDL(){// urlListにはダウンロード用ファイルを直接指定しています。// 【注意】日本語を含むファイル名はダウンロードできません。var urlList = ["./ImageTest/IMG_3587.JPG","./ImageTest/IMG_3598.JPG"]console.log(urlList);zip = new JSZip();deferreds = $.Deferred();var promise = deferreds;$.map(urlList,function(value,index) {console.log('urlList:index='+index+' = '+value);console.log('match() : '+value.match(".+/(.+?)([\?#;].*)?$")[1]);promise = promise.then( function() {var newPromise = new $.Deferred();var xhr= new XMLHttpRequest();xhr.open('GET',value,true);xhr.responseType='arraybuffer';xhr.addEventListener('load', function() {// zipにレスポンスデータ追加zip.file(value.match(".+/(.+?)([\?#;].*)?$")[1],xhr.response);newPromise.resolve();});xhr.send();return newPromise;});});promise.then( function() {zip.generateAsync({type:"blob"}).then( function(content){saveAs(content,'test.zip');});});deferreds.resolve();}</script></body></html>

I attached sample for mojo+dojo.downloadandzip-mojo-dojo_1.zip

Mihoko Iijima · Apr 21, 2022 go to post

@Megumi Kakechi 
I can get correct result on 2022.1! laugh

I use iris 2022.1 container. (image lists :https://community.intersystems.com/node/511986)

USER>write $ZV
IRIS for UNIX (Ubuntu Server LTS for x86-64 Containers) 2022.1 (Build 164U) Tue Apr 5 2022 01:30:47 EDT

USER>do $system.Python.Shell()

Python 3.8.10 (default, Nov 26 2021, 20:14:08)
[GCC 9.3.0] on linux
Type quit() or Ctrl-D to exit this shell.
>>> sql="select name,value from %Library.Global_get('user','^ISJ',,2,2)"
>>> rset=iris.sql.exec(sql)
>>> dataframe=rset.dataframe()
>>> dataframe
      name                value
0  ^ISJ(1)  $lb("名前","年齢","住所")
1  ^ISJ(2)  $lb("佐藤","50","東京")
2  ^ISJ(3)  $lb("加藤","40","大阪")
3  ^ISJ(4)  $lb("伊藤","30","京都")
Mihoko Iijima · Apr 26, 2022 go to post

ImportDDL() method in %SYSTEM.SQL.Schema class can run multiple queries.

Documentation is https://docs.intersystems.com/irislatest/csp/docbook/Doc.View.cls?KEY=GSQL_import#GSQL_import_cache

Step1: preparing import file like below:

You need to use "go" in end of each query.  (c:\temp\updatequeries.txt)

UPDATE Test2.Person Set Name='abc' where ID=1
go
UPDATE Test2.Person Set Name='efg' where ID=2
go
UPDATE Test2.Person Set Name='hij' where ID=3
go

Step2: running  ImportDDL() method like below:

USER>do $system.SQL.Schema.ImportDDL("c:\temp\updatequeries.txt","c:\temp\import.log","IRIS")
 
 
Importing SQL Statements from file: c:\temp\updatequeries.txt
 
 
Recording any errors to principal device and log file: c:\temp\import.log
 
 
  SQL statement to process (number 1):
     UPDATE Test2.Person Set Name='abc' where ID=1
      Preparing SQL statement...
      Executing SQL statement...
  DONE
 
  SQL statement to process (number 2):
     UPDATE Test2.Person Set Name='efg' where ID=2
      Preparing SQL statement...
      Executing SQL statement...
  DONE
 
  SQL statement to process (number 3):
     UPDATE Test2.Person Set Name='hij' where ID=3
      Preparing SQL statement...
      Executing SQL statement...
  DONE
 
Elapsed time: .01458 seconds
USER>
Mihoko Iijima · Jun 3, 2022 go to post

You can convert with $SYSTEM.Util.UTCtoLocalWithZTIMEZONE().

https://cedocs.intersystems.com/ens20141/csp/documatic/%25CSP.Documatic.cls?&LIBRARY=%25SYS&CLASSNAME=%25SYSTEM.Util

USER>write$SYSTEM.Util.UTCtoLocalWithZTIMEZONE($ZTIMESTAMP)
66263,48361.382728
USER>write$ZTIMESTAMP66263,15968.3579578
USER>
 
USER>write$ZDATETIME($SYSTEM.Util.UTCtoLocalWithZTIMEZONE($ZTIMESTAMP),3)
2022-06-0313:26:26
USER>write$ZDATETIME($ZTIMESTAMP,3)
2022-06-0304:26:34
USER>
Mihoko Iijima · Jul 10, 2023 go to post

FYI:

You also use List query in %SYS.Journal.Record.

set rs=##class(%ResultSet).%New("%SYS.Journal.Record:List")
set jrn=##class(%SYS.Journal.System).GetLastFileName()  // or input file pull pathdo rs.Execute(jrn)
write rs.Next()
write rs.Get("Address"),"-",rs.Get("TimeStamp"),"-",rs.Get("ProcessID"),"-",rs.Get("TypeName"),"-",rs.Get("InTransaction"),"-",rs.Get("GlobalNode"),"-",rs.Get("DatabaseName"),!
do rs.Close()

Note: it doesn't work with %SQL.Statement

Although in Japanese, this article is related to it : https://jp.community.intersystems.com/node/492721

Mihoko Iijima · Aug 8, 2023 go to post

Hi @Lorenzo Scalese 

How about Decompress() method in %SYS.Journal.File class?

set f1="C:\InterSystems\IRISHealth\mgr\journal\20230807.001z"set f2="C:\InterSystems\IRISHealth\mgr\journal\test20230807.001"write##class(%SYS.Journal.File).Decompress(f1,f2)

And below method returns 1.

USER>Write##class(%SYS.Journal.File).IsValidJournal(f2)
1
Mihoko Iijima · Sep 23, 2023 go to post

I guess you had set [Interoperability] - [Service Config Name] in your FHIR repogitory like this:

When I start below production on same namespace with FHIR repository, I can get same error in your question. (I didn't set "HS.FHIRServer.Interop.Service" in Service.)

I can make REST requests if I change my production in this way.

Mihoko Iijima · Nov 16, 2023 go to post

Hi @Jani Hurskainen 

It seems the "UserErrors" domain name is the default name of user-defined errors, although it isn't written in the document.

I tested below:

<?xml version="1.0" encoding="UTF-8"?> 
<MsgFileLanguage="en"><MsgDomainDomain="UserErrorsABCDEFG"><MessageId="-911"Name="MyError">Test!!An error has occured</Message> 
    <MessageId="-922"Name="MyError2">Test!!An error has occured 2</Message> 
  </MsgDomain></MsgFile>
setx=##class(%MessageDictionary).Import("/src/test.xml")
set error=$system.Status.Error("<UserErrorsABCDEFG>-911")
set error=$system.Status.Error("<UserErrorsABCDEFG>-911") 
write$system.Status.GetErrorText(error)
//ERROR <UserErrorsABCDEFG>-911: Test!!An error has occured

If you don't add default domain name, you can get the correct user message by specifying the domain name with the error id to create the error messsage.

Mihoko Iijima · Dec 5, 2023 go to post

Hi @Phil Burkhalter 

Does the "class namespace" mean package? (Sorry if I'm wrong.)

If it's correct, you can get class name (=package.class) using WHERE clause to INFORMATION_SCHEMA.TABLES.

Query example: I can filter "Test" package.

SELECT CLASSNAME FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='Test'

Thank you for publishing this wonderful article! This is probably the most pleasant thing that has happened to me in my intersystems 21 years🤩

Do you know [InterSystems FAQ rubric] article?

The article is occasionally published in the US community, and it is based on the FAQ Japanese article.
The FAQ Committee started in 2007 in the Japan office, and the four members ( @Hiroshi Sato @Megumi Kakechi  @Tomoko Furuzono ) discuss which content is frequently and useful each time and create the articles.
Please stay tuned for more FAQ articles in the future!
Let's keep doing together to make more beneficial and enjoyable community!!

Hi @Danusa Calixto 

The answer is "since the instance was started."

$SYSTEM.License.LUMaxConsumed()  : the description said below.

"$SYSTEM.License.LUMaxConsumed() returns the maximum number of license units consumed at the local InterSystems IRIS instance since it started. This value is the high water mark of license consumption on the local InterSystems IRIS instance."

One more from Japan!😆

Embedded Python,  
a strong choice within IRIS.  
ObjectScript too

Our FAQ system uses iFind indices😆 https://faq.intersystems.co.jp

We used to use Mecab for morphological analysis of Japanese text.

Mecab is good, but it can be difficult to identify semantic entities in Japanese sentences like this:

"タスクマネージャー"(Task Manager) is divided "タスク"(Task) and "マネージャー"(Manager).

"アンインストール" (Uninstall) is divided "アン"(Un) and "インストール"(install).

iFind is excellent✨