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()
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/","","")
从 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")
下面的命令将从激活的 FHIR 服务器中检索所有观察结果
do ##class(dc.FhirClient).GetResource("Observation")
从 FHIR 服务器获取特定患者的资源
下面的命令将从激活的 FHIR 服务器中检索针对 Patinet ID 1 的观察详细信息
do ##class(dc.FhirClient).GetPatientResources("Observation","1")
从 CSP Web 应用程序查看 FHIR 服务器信息
导航 http://localhost:55037/csp/fhirclient/index.csp
索引页面将显示激活的服务器中患者、观察、从业者和就诊次数以及患者和注册服务器的详细信息
索引页面将显示 FHIR 服务器列表,其中选择了激活的服务器。 从列表中选择其他服务器以查看所选服务器的详细信息
将鼠标悬停到患者 ID 并选择以获取患者资源的详细信息
此页面将显示一些患者资源的数量以及患者观察的详细信息
谢谢