Find

Question
· Dec 25, 2024

FHIR facade, override FHIR Search and return OperationOutcome

Hello,

I'm trying to customize error handling in the overriden HS.FHIRServer.Storage.JsonAdvSQL.Interactions::Search method. It is clear how to add to the resultset a valid FHIR resource (pseudocode):

1 Comment
Discussion (1)1
Log in or sign up to continue
Announcement
· Dec 25, 2024

[Video] InterSystems IRIS Cloud Document

Hey Community,

Enjoy the new video on InterSystems Developers YouTube:

⏯ InterSystems IRIS Cloud Document @ Global Summit 2024

This session will highlight the document model capabilities of a new cloud service we are introducing. The document model enables developers to store data with a flexible schema structure and still query the data through an industry standard query interface via SQL.  

🗣 Presenter: @Stefan Wittmann, Product Manager, InterSystems

Enjoy watching, and look out for more videos! 👍

Discussion (0)1
Log in or sign up to continue
Article
· Dec 25, 2024 2m read

在IRIS 2024.2 中使用 WebTerminal

IRIS 2024.2 版本包含一项变更(DP-432503),该变更要求Web Gateway最初连接到 IRIS 时所使用的用户(通常是 CSPSystem)必须对承载 REST web applicatioon 的dispatch类的数据库具备 READ 权限。

在不满足该条件的情况下,就会引发一个错误,这会向调用者返回一个 HTTP 404 状态码,而非预期的 HTTP 401 状态码。

显然,这个问题将在 2024.3 版本中修复,参考编号为 DP-432898 / ALI048:REST 登录端点将返回 401 HTTP 错误码而非 404,但作为持续交付(CD)版本,2024.2 不会获得维护版本修正。

解决方法是让 CSPSystem 用户对安装WebTerminal所在命名空间的数据库具备读权限。

下面是所需的步骤:

1. 创建一个新的资源 “%DB_WEBTERMINAL”,并设置 “WEBTERMINAL” 数据库使用该资源,而非 “%DB_% DEFAULT”。

2. 创建一个名为 “% DB_WEBTERMINAL” 的角色,该角色能让角色持有者对 “% DB_WEBTERMINAL” 资源具有读写(RW)访问权限。

3. 再创建另一个角色(我将其命名为 “DBread_WEBTERMINAL”),该角色仅赋予角色持有者对该资源的读(R)访问权限。

4. 为 “CSPSystem” 用户赋予 “DBread_WEBTERMINAL” 角色。这样可以解决 2024.2 版本存在的这个漏洞。

5. 编辑 “/terminalsocket” web application,并将 “%DB_WEBTERMINAL” 添加到 “应用程序角色(Application Roles)” 选项卡中。这一步骤是必要的,因为WebTerminal 最初是以 “UnknownUser” 身份运行其 websocket 进程的,并且甚至在切换为以已认证用户身份运行之前,就需要更新其数据库中的状态信息。

另一种简便单但不是安全的方式:

  • 创建一个具有读写(RW)公共权限的新安全资源 “%DB_WEBTERMINAL”,然后设置 “WEBTERMINAL” 数据库使用该资源,而非 “%DB_%DEFAULT”。

更多以及详细信息参见下面内容:https://github.com/intersystems-community/webterminal/issues/155

Discussion (0)1
Log in or sign up to continue
Article
· Dec 24, 2024 1m read

新的WebTerminal —— iterm

Web Terminal 已经存在相当长一段时间了,但它存在诸多限制,并非所有功能都能正常使用。它不支持 shell,也没有诸如嵌入式 Python 支持这样的最新功能。对于那些需要编程模式的工具来说,存在一些问题。基本身份验证也不如简单的登录页面便捷,使用登录页面的话,倘若你想要改变登录应用程序的方式(比如使用单点登录,即 SSO),你还可以自行添加登录页面。

通过将最初的iris terminal 封装到一个网页表单中,利用在网络领域应用极为广泛且同样被像 Visual Studio Code(VSCode)这类工具所使用的 xterm.js,并借助 Python 施展的一些 “魔法”(这些 “魔法” 有助于实现进程间的终端交互),我们就能在网络上完整地实现终端功能了。

安装方法

zn "%SYS"
zpm "install iterm"

iTerm

为了测试它是如何在web中工作的,可以执行 term routine,如下

iTerm

Discussion (0)1
Log in or sign up to continue
Article
· Dec 24, 2024 1m read

如何基于表格现有数据新增数据列

现有一个数据表的数据像这样:

我们的需求是基于表中的Item列新增一个status字段,如果item的内容是第一次出现,那么status列就是New,反之显示Old,

比如,应该是下面的显示内容

 

在原文章的回复中, Robert Cemper给出了下面的建议

新建一个存储过程,并在SELECT查询语句中生效:

/// Return NEW for first occurance of item 
/// otherwise return OLD
Class User.ItemStat Extends %RegisteredObject
{
ClassMethod NewOld(item As %String = "") As %String [ SqlProc ]
{
    if item="" quit "?"
    if $d(^||list(item)) quit "OLD"
    if $i(^||list(item)) quit "NEW"
}
}

使用下面SELECT语句使之生效:

SELECT *, ItemStat_NewOld(item) as Status
FROM items order by 2

结果如下:

ID	date	  item	Status
1	09/13/1932	A	NEW
2	04/06/1933	D	NEW
10	06/15/1940	A	OLD
4	11/26/1940	A	OLD
6	02/19/1956	B	NEW
8	04/22/1957	D	OLD
7	05/01/1959	D	OLD
9	06/29/1961		?
3	07/04/1992	B	OLD
5	12/08/2020	D	OLD
Discussion (0)1
Log in or sign up to continue