文章
· 八月 11, 2022 阅读大约需 2 分钟

FHIR 客户端使用嵌入式 python 连接任何打开的 FHIR 服务器

嗨社区,

这篇文章公开介绍我的 iris-fhir-client 客户端应用。

 iris-fhir-client 可以可以借助嵌入式 python 连接到任何开放的 FHIR 服务器 fhirpy 图书馆.

通过终端和使用 CSP Web 应用程序获取资源信息。

查看和激活注册服务器 

连接到 IRIS 终端

docker-compose exec iris iris session iris

应用程序将默认注册 InterSystems FHIR Accelerator Service 和 SmartHealthIT Open FHIR Server,两者都可以使用。
使用以下命令列出已注册的服务器

do ##class(dc.FhirClient).ServerList()

image

InterSystems FHIR 加速器服务处于激活状态。 为了选择 SmartHealthIT 打开 FHIR 服务器,通过传递服务器 ID 使用 dc.FhirClient 类的 SetFhirServer 函数

do ##class(dc.FhirClient).SetFhirServer(2)

 

注册的 FHIR 服务器

要注册新服务器,请使用 dc.FhirClient 类的 RegisterServer() 函数
class(dc.FhirClient).RegsterServer("Server Name","Endpoint","ApiKey"[optional],"EndpointOAuth"[optional]

do ##class(dc.FhirClient).RegisterServer("INTERSYSTEMS FHIR Server","http://localhost:52773/csp/healthshare/samples/fhir/r4/","","")

image

从 FHIR 服务器获取资源

要检索当前服务器的所有资源,请使用 dc.FhirClient 类的 ListResources() 方法

do ##class(dc.FhirClient).ListResources()

为了显示任何资源的记录数,通过传递 dc.FhirClient 的 Resource 使用 CountResource() 方法
下面的命令将从激活的 FHIR 服务器获取患者资源计数器

set count = ##class(dc.FhirClient).CountResource("Patient")
write count

要检索所有创建的资源及其计数,只需将 1 传递给 ListResource() 函数

do ##class(dc.FhirClient).ListResources(1)

要获取资源的详细信息,请通过传递 dc.FhirClient 类的 Resource 使用 GetResource()
下面的命令将从激活的FHIR 服务器中检索所有患者

do ##class(dc.FhirClient).GetResource("Patient")

image

下面的命令将从激活的 FHIR 服务器中检索所有观察结果

do ##class(dc.FhirClient).GetResource("Observation")

image

 

从 FHIR 服务器获取特定患者的资源

下面的命令将从激活的 FHIR 服务器中检索针对 Patinet ID 1 的观察详细信息

do ##class(dc.FhirClient).GetPatientResources("Observation","1")

image

从 CSP Web 应用程序查看 FHIR 服务器信息

导航 http://localhost:55037/csp/fhirclient/index.csp
索引页面将显示激活的服务器中患者、观察、从业者和就诊次数以及患者和注册服务器的详细信息
170881284-b18aebca-e6a2-4a6e-ad20-a537c13ff51c

 

索引页面将显示 FHIR 服务器列表,其中选择了激活的服务器。 从列表中选择其他服务器以查看所选服务器的详细信息
image

将鼠标悬停到患者 ID 并选择以获取患者资源的详细信息
image

此页面将显示一些患者资源的数量以及患者观察的详细信息
170881340-a9cd0c77-bf24-4e8e-85f7-84e04b527b49

谢谢

讨论 (0)1
登录或注册以继续