发布新帖

查找

问题
· 三月 30, 2021

IRIS and VsCode Questions

Hi Community,

 

I'm developing an IRIS environment for a project and I would like to take some questions to pass on to the developers that I haven't found yet here in the community:

 

1. Is it possible to debug the process in VSCode in real time?

2. How can we use the terminal in VsCode for some configuration or just import applications (Example: Web Terminal)?

12 Comments
讨论 (12)1
登录或注册以继续
文章
· 三月 28, 2021 阅读大约需 9 分钟

InterSystems IRIS医疗行业版创建FHIR服务器

        如果您正打算学习FHIR、或者正在基于FHIR开发,最佳的学习和开发环境需要一个完备的FHIR 服务器,帮助您理解FHIR标准和调试FHIR应用。使用InterSystems IRIS医疗行业版可以快速配置出FHIR服务器和FHIR资源仓库。这篇文章介绍如何在5分钟内在InterSystems IRIS医疗行业版上配置FHIR服务器和FHIR资源仓库;同时对初学者介绍FHIR测试数据生成与加载的方法,和基本的FHIR REST API操作。

 

软件准备

1. InterSystems IRIS医疗行业版

您可以使用已有的2020.1及以上的InterSystems IRIS医疗行业版。如果您还没有,那么就在社区里下载一个最新的、免费的社区版吧。

2. 测试用的FHIR数据

如果您正在做FHIR开发,应该有很多FHIR测试数据。如果您正在学习FHIR,那么Synthea是一个不错的FHIR测试数据生成器选项。

3. REST测试工具

您或许已经有趁手的REST测试工具了。如果还没有,POSTMAN是个不错的选择。我的例子里用到的就是POSTMAN。

 

FHIR服务器配置

1. 安装InterSystems IRIS医疗行业版或社区版

如果您还没有安装过InterSystems IRIS医疗行业版或社区版,社区里有很多很好的介绍文章。

2. 配置FHIR服务器

2.1 创建一个FHIR 服务器命名空间

在InterSystems IRIS医疗行业版或社区版上,需要创建一个FHIR服务器命名空间。HS.HC.Util.Installer类的方法InstallFoundation可以创建这样的命名空间,例如,我们创建一个名为FHIRSERVER的命名空间:

HSLIB>D ##class(HS.HC.Util.Installer).InstallFoundation("FHIRSERVER")

 

2.2 为这个命名空间配置FHIR访问端点 (FHIR endpoint)

进入管理门户,切换到FHIRSERVER命名空间,然后Health > FHIR Configuration, 然后点击“Server Configuration”。这里会列出已有的FHIR服务器的访问端点,并可以配置新的端点

这里点击+号,在弹出的配置页面中进行设置,其配置项是:

选中支持的FHIR版本 (Select a metadata set): 如果要支持最新的FHIR版本4,选中HL7V40,就是FHIR R4;

选中交换策略 (Select an interaction strategy): 默认情况下只会有一个选项 -  HS.FHIRServer.Storage.Json.InteractionsStrategy,它会将InterSystems IRIS同时配置为FHIR资源仓库。

设置FHIR服务器REST服务端点 (Enter a name(URL)): 例如/csp/healthshare/fhirserver/fhir/r4 

 

然后点击Finish,让它完成后台的配置,这可能会花费1分钟。

 

2.3 修改这个FHIR服务端点

因为我们是想利用它来学习和测试FHIR,所以我们先跳过访问认证部分。在端点列表中选中刚才创建的/csp/healthshare/fhirserver/fhir/r4,滚动到最下方,找到Edit按钮,并选中“Debugging”下的“Allow Unauthenticated Access”,让FHIR服务器接受匿名访问。然后点击Update进行更新。

 

如果您按上述步骤执行完成,并且没有错误,那么FHIR服务器和FHIR资源仓库已经就绪了。看看表,您用了多久完成FHIR服务器的创建。

下面测试一下FHIR服务器是否工作正常。

 

测试FHIR服务器

即便您还没有任何FHIR测试数据,也可以先看看这个FHIR服务器的能力声明。

通过POSTMAN,使用GET方法,进行REST调用:http://localhost:52776/csp/healthshare/fhirserver/fhir/r4/metadata。这里localhost:52776是我的测试InterSystems IRIS的服务器地址和Web服务端口号,您换成自己的就行。如果您不知道,那么用您访问InterSystems IRIS管理门户的地址和端口号。

因为我们在上一步配置时,允许匿名访问REST API,所以POSTMAN无需设置任何登陆账户,非常方便测试。正常情况下,您应该看到和我一样的结果:

 

您的FHIR服务器已经正常工作了,如果还没有测试数据,是时候加载一些FHIR数据进来了。

 

产生FHIR数据

如果您有自己的FHIR测试数据,请跳过此步,查看“加载FHIR数据”。

如果您还没有自己的FHIR数据,试试Synthea,它能方便的产生大量FHIR测试数据。Synthea有清晰的文档,告诉我们如何产生测试数据。(注:如果您是FHIR初学者,建议先少量创建FHIR测试数据文件,例如先创建5个)

通常它会产生3类JSON文件:

医院信息:hospitalInformation******.json, 每批次只会产生一个医院信息文件。

医生信息:practitionerInformation******.json, 每批次只会产生一个医生信息文件。

患者信息:<患者姓名>******.json, 每批次会根据设置产生一个或多个患者信息文件。

 

这些FHIR文件都是Bundle资源,Bundle里面会有很多FHIR资源数据。其中医院信息文件和医生信息文件的Bundle类型为batch,而患者信息的Bundle是transaction。

而Synthea产生的患者信息Bundle中的资源使用literal reference来引用医院/地点和医生信息,但它产生的literal reference信息不完整,例如:

"serviceProvider": {

        "reference": "Organization?identifier=https://github.com/synthetichealth/synthea|731e0f3a-075d-37ab-9ba7-fbf1ab2f45e9",

        "display": "THE GENERAL HOSPITAL CORPORATION"

      }

需要将reference改为完整的地址,例如:

"serviceProvider": {

        "reference": "http://localhost:52776/csp/healthshare/fhirserver/fhir/r4/Organization?identifier=https://github.com/synthetichealth/synthea|731e0f3a-075d-37ab-9ba7-fbf1ab2f45e9",

        "display": "THE GENERAL HOSPITAL CORPORATION"

      }

也就是增加FHIR服务器的端点。

需要替换/补齐的引用分别是:Location、Organization和Practitioner。

您可以通过文本编辑器进行全局替换,将FHIR服务器的端点信息补充到reference里。如果您产生了很多FHIR数据文件,当然可以用您熟悉的语言写几行代码做这个补充替换。

这里我也附上使用IRIS的Object Script做补充替换的代码示例,它会对指定目录下的所有json文件进行扫描和补充替换,供您参考:

Class Demo.FHIRTools Extends %RegisteredObject
{
/// 修正FHIR文件的引用
/// pFilePath为FHIR json文件目录
/// pFHIREndpoint为FHIR REST的服务端点
ClassMethod CorrectSyntheaFiles(
    pFilePath As %String = "C:\Temp\Synthea\output\fhir",
    pFHIREndpoint As %String = "http://localhost:52776/csp/healthshare/fhirserver/fhir/r4") As %Status
{
        Set tSC = $$$OK
        // 遍历目录下的json文件
        Set tSM = ##class(%SQL.Statement).%New()
        Set tSC = tSM.%PrepareClassQuery("%File", "FileSet")
        If $$$ISERR(tSC) 
        { 
            Do $system.OBJ.DisplayError(tSC)
            Return tSC 
        }
        Set tRS = tSM.%Execute(pFilePath, "*.json", "Name")          
        While tRS.%Next() 
        {
            // 创建临时文件
            Set tFileName = tRS.%Get("Name"),tTempFileName=$Replace(tFileName,".json","temp.json")
            Set tFile=##class(%Stream.FileCharacter).%New()
            Set tTempFile = ##class(%Stream.FileCharacter).%New()
            Set tSC=tTempFile.LinkToFile(tTempFileName)
            Set tSC=tFile.LinkToFile(tFileName)
            // 从源文件逐行读取,替换后写入临时文件
            While 'tFile.AtEnd 
            {
                Set tLine=tFile.ReadLine()
                // 执行替换
                For tKeyword="Location?identifier=","Organization?identifier=","Practitioner?identifier="
                {
                    Set tLine = $Replace(tLine,tKeyword,pFHIREndpoint_"/"_tKeyword)
                }                    
                Set tSC = tTempFile.WriteLine(tLine)
            }
            Do tTempFile.%Save()
            Do tFile.%Close(), tTempFile.%Close()
            Kill tFile,tTempFile
            // 删除源文件,并将临时文件改名为源文件名
            Set tSC = ##class(%File).Delete(tFileName,.tRtn)
            Set tSC = ##class(%File).Rename(tTempFileName, tFileName, .tRtn)
        }
        Return tSC
} 
}

 

加载FHIR数据

当然可以通过FHIR REST API来加载数据,不过,InterSystems IRIS提供了后台的API,可以快速加载特定目录下的大量的FHIR数据文件。

这里我们用后台API:HS.FHIRServer.Tools.DataLoaderSubmitResourceFiles方法进行大量FHIR文件加载:

FHIRSERVER>Set sc=##class(HS.FHIRServer.Tools.DataLoader).SubmitResourceFiles("C:\Temp\Synthea\upload","FHIRSERVER","/csp/healthshare/fhirserver/fhir/r4")

其中第一个入参是需要加载的文件目录;第二个参数是加载的FHIR服务器类型,这里用FHIRSERVER;第三个参数是FHIR REST服务端点。

这个方法同样适用于加载NDJSON格式的FHIR数据文件。

如果您是通过Synthea产生的测试FHIR JSON文件,那么应该先加载 医院信息文件(hospitalInformation******.json)和医生信息文件(practitionerInformation******.json),以确保患者数据加载时,Location、Organization和Practitioner的引用能正确关联到FHIR资源仓库中已保存的对应资源上。

注意:2020.* 版本中有一个bug,需要将医院信息文件(hospitalInformation******.json)和医生信息文件(practitionerInformation******.json)里的"type": "batch"改为"type": "transaction"。这个bug在2021.1版本中已经得到修复,我已经验证过,但如果您在使用2020的版本,请记得提前修改。

加载完医院信息文件(hospitalInformation******.json)和医生信息文件(practitionerInformation******.json)后,再执行相同的方法加载所有患者数据json文件。

 

使用FHIR 服务器

有了测试数据,现在您可以使用FHIR服务器进行学习或开发测试了。使用POSTMAN,您可以调用FHIR服务器的REST API,查询、更改、提交FHIR资源数据。

如果您是初学者,对FHIR的REST API不熟悉,建议您从FHIR Cheat Sheet开始,它是一个FHIR标准的汇总单页,里面告诉大家如何使用REST API进行操作。

例如:

1. 查询已经加载到FHIR资源仓库中的患者:

使用GET 方法调用REST:

http://localhost:52776/csp/healthshare/fhirserver/fhir/r4/Patient

2. 使用查询参数,查询名为Pedro316的患者:

使用GET 方法调用REST:

http://localhost:52776/csp/healthshare/fhirserver/fhir/r4/Patient?given=Pedro316

或使用POST 方法调用REST:

http://localhost:52776/csp/healthshare/fhirserver/fhir/r4/Patient/_search?given=Pedro316

3. 更复杂的查询参数用例,查询拥有观察项目编码为8302-2(体重)的患者:

使用GET 方法调用REST:

http://localhost:52776/csp/healthshare/fhirserver/fhir/r4/Patient?_has:Observation:patient:code=8302-2

4. 使用operation: $everything 来获取特定患者的所有相关FHIR资源(示例是id为95的患者):
使用GET 方法调用REST:

http://localhost:52776/csp/healthshare/fhirserver/fhir/r4/Patient/95/$everything

5. 加载FHIR Bundle资源:

使用POST 方法调用REST:

http://localhost:52776/csp/healthshare/fhirserver/fhir/r4/

,并在Body中直接贴入FHIR资源数据到raw,或选择FHIR资源数据文件到binary。

注意:如果您是想让FHIR服务器解析Bundle中的FHIR资源,应该用http://localhost:52776/csp/healthshare/fhirserver/fhir/r4/,而不是http://localhost:52776/csp/healthshare/fhirserver/fhir/r4/Bundle。后者把POST的FHIR数据按Bundle进行处理,并不会解析其中包含的FHIR资源内容并逐一保存!

注意:记得根据FHIR数据的格式设置Content-Type为application/json+fhir 或 application/xml+fhir,然后将数据贴在Body里:

好了,开启您的FHIR之旅吧 :)

 

后续我还会更新InterSystems IRIS医疗版作为FHIR服务器和FHIR资源仓库的更多内容,欢迎关注。

讨论 (0)1
登录或注册以继续
文章
· 三月 28, 2021 阅读大约需 4 分钟

Registering the .Net Data Provider for InterSystems Caché and InterSystems IRIS as DbProviderFactories

This small tutorial described how to „register“ the ADO.NET Database Provider (Driver) for InterSystems IRIS and InterSystems Caché on a Windows machine.

Before we start: Why need the ADO.NET Database Provider to be registered?

ADO.NET provides factory classes standardize the way programmer will create a provider-specific Connection. This simplifies the way programmers create provider specific instances in a generic data access API. Details about that can be found here: https://docs.microsoft.com/en-us/dotnet/framework/data/adonet/obtaining-a-dbproviderfactory
If an Application use this system to obtain a list of available Data Providers, the provider needs to be registered. In my example I want to use the .Net Data Provider for InterSystems IRIS in a MS SQL Server Integration Service Project. This Application (SSIS) use a Connection Dialog that lists all on this machine available\known Data Provider:

As you can see there are no InterSystems Provider available. The following section describes what needs to be done to list the provider on this connection dialog.

machine.config?!

Each .NET Framework data provider that supports a factory-based class registers configuration information in the DbProviderFactories section of the machine.config file on the local computer. The DbProviderFactories class uses the machine.config file(s) to resolve the invariant name to the appropriate provider factory type. The machine.config file is located in …\<windows>\Microsoft.NET\Framework\<version>\config\machine.config.

On my computer e.g:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config
and
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config


Add DbProviderFactories

Open the machine.config file with a text editor and search for “system.data”. You found possibly an empty block like this:

These are the values we have to insert for IRIS:

<add name="InterSystems IRIS Data Provider"
invariant="InterSystems.Data.IRISClient"
description=".Net Data Provider for InterSystems IRIS"
type="InterSystems.Data.IRISClient.IRISFactory,
InterSystems.Data.IRISClient,
Version=4.5.0.0,
Culture=neutral,
PublicKeyToken=ad350a26c4a4447c"/>

… and this for Caché

<add name="InterSystems Cache Data Provider"
invariant="InterSystems.Data.CacheClient"
description=".Net Data Provider for InterSystems Cache"
type="InterSystems.Data.CacheClient.CacheFactory,
Intersystems.Data.CacheClient,
Version=4.5.0.0,
Culture=neutral,
PublicKeyToken=ad350a26c4a4447c"/>

The “system.block” should now look like this:

Pay attention to the <DbProviderFactories></DbProviderFactories> tags!

Now start Visual Studio (Data Tools), create a SSIS Projekt and open the Connection Manager again. The dialog should look like this:


Great! The providers are listed!
... unfortunately that is not enough. The providers are not working if you select one of the new entries you get this message:

That’s happened because the Provider are not known it the GAC (=global assembly cache), so the entries can’t be found*.

*If you have done an IRIS\Caché installation on your computer (or just the client tools) maybe the provider is already registered in the GAC and you don’t this message and all is already working. Congratulations! 😊


Register InterSystems provider in the GAC

To registered the InterSystems provider on a computer you can do it this way:

Find the files first:

Intersystems.Data.CacheClient.dll (for Caché)

InterSystems.Data.IRISClient.dll (for IRIS)

Within an IRIS installation you can find the file e.g. …\dev\dotnet\bin\v4.5

Copy the files on your computer in a folder (InterSystems.Data.IRISClient.dll).

Now you are able to register the Provider in the assembly cache with the gacutil.

Using gacutil
 

If you have a Visual Studio installed you can use the Visual Studio Developer Command Prompt:

That has the advantage that you don’t need to look for the gacutil path, for installation just type:

gacutil -i <full path to your dll>\InterSystems.Data.CacheClient.dll

e.g.: gacutil -i D:\dev\privat_repos\NativeCacheTest\lib\InterSystems.Data.CacheClient.dll

You should see the message: Assembly successfully added to the cache

To remove something from gac, use the option "-u": gacutil -u InterSystems.Data.CacheClient

Install both provider:

gacutil -i <full path to your dll>\InterSystems.Data.IRISClient.dll
gacutil -i <full path to your dll>\InterSystems.Data.CacheClient.dll

If you don’t have the “Visual Studio Developer Command Prompt” you need to search the gacutil executable first. On my computer it is located at: "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\gacutil.exe"


Install:

"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\gacutil.exe" -i D:\dev\privat_repos\NativeCacheTest\lib\InterSystems.Data.IRISClient.dll
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\gacutil.exe" -i D:\dev\privat_repos\NativeCacheTest\lib\InterSystems.Data.CacheClient.dll


Remove:

 

"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\gacutil.exe" -u InterSystems.Data.CacheClient
"C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\gacutil.exe" -u InterSystems.Data.IRISClient

 


It works! :-)

And now… if you open the SSIS Project again, navigate to the Connection Manager it should looks like this:

You can now select the IRIS provider, see and configure all available connections details.

Thanks for reading.

讨论 (0)1
登录或注册以继续
InterSystems 官方
· 三月 26, 2021

Maintenance releases are Generally Available for Caché, Ensemble, and InterSystems IRIS

Three new sets of maintenance releases are now available: 

  • Caché  2018.1.5, Ensemble 2018.1.5, and HSAP 2018.1.5
  • InterSystems IRIS 2019.1.2, IRIS for Health 2019.1.2, and HealthShare Health Connect 2019.1.2
  • InterSystems IRIS 2020.1.1, IRIS for Health 2020.1.1, and HealthShare Health Connect 2020.1.1

Installation kits and containers can be downloaded from the WRC Software Distribution site.

These are maintenance releases with many updates across a wide variety of areas.  For information about the corrections in these releases, refer to the documentation for that version, which includes a Release Notes and Upgrade Checklist, and a Release Changes list, as well as the Class Reference and a full set of guides, references, tutorials, and articles.   All documentation can be reached via docs.intersystems.com.

New platform support has also been added to these releases.  In particular, Ubuntu 20.04 LTS support has been added to all releases, IBM AIX 7.1 and 7.2 for System p-64 support has been added to 2019.1.2 (and was already in 2020.1), and ARM64 support for Linux was added to 2020.1.1.  For details, see the Supported Platforms document for each release. 

Build numbers for these releases are shown in the table below:

Version

Product

Build number

2018.1.5

Caché and Ensemble

2018.1.5.659.0

2018.1.5

Caché Evaluation

2018.1.5.659.0su

2018.1.5

HealthShare Health Connect (HSAP)

2018.1.5HS.9056.0

2019.1.2

InterSystems IRIS

2019.1.2.718.0

2019.1.2

IRIS for Health

2019.1.2.718.0

2019.1.2

HealthShare Health Connect

2019.1.2.718.0

2020.1.1

InterSystems IRIS

2020.1.1.408.0

2020.1.1

IRIS for Health

2020.1.1.408.0

2020.1.1

HealthShare Health Connect

2020.1.1.408.0

2020.1.1

InterSystems IRIS Community

2020.1.1.408.0

2020.1.1

IRIS for Health Community

2020.1.1.408.0

2020.1.1

IRIS Studio

2020.1.1.408.0

1 Comment
讨论 (1)2
登录或注册以继续
公告
· 三月 26, 2021

Jobs on Developer Community

Hi Developers!

As you may know, InterSystems Developer Community can help you to find a job. There are two options for developers: find a job for yourself or hire staff for your company. Just post an ad on the InterSystems Developer Community and find what you are looking for!

How does it work? Check the details below: 

The "Jobs" section available in the top menu here:

  

What can be found in this section?

  • Job opportunities:

Job opportunity announcements on any position which demands any of InterSystems technology skills.

  • Job wanted:

Announcements of specialists in InterSystems Data Platforms who are looking for a job. The list of skills should contain any of InterSystems technologies.

So, if you:

  • want to offer a position that demands any of InterSystems technology skills OR
  • have experience with InterSystems technology and are looking for a new job,

you can both publish a post in the Developer Community. You just have to add related tags to your announcements:

And here's the easiest way to create a job opportunity:

Go to the Jobs section and click on the "New job opportunity" button, an ad will be automatically created with a special "Job opportunity" tag. This tag will make a vacancy out of your announcement and add it to this section.

So!

You will be able to find new employees or a new job in a quick and easy way with InterSystems Developer Community! 😉

If you have any questions or need some help with the post, don't hesitate to contact us!


Precautionary measures:

  • InterSystems does not guarantee the accuracy of recruitment posts or other information posted on this website.
  • InterSystems assumes no responsibility whatsoever for any losses incurred as a result of the information posted on this website. Please confirm the contents and conditions directly with the recruiter or applicant.
  • For more, please refer to the Developer Community Code of Conduct.
讨论 (0)0
登录或注册以继续