面向python的fhir智能客户端
FHIRstorm的Python项目详细描述
#fhirstorm
\fhir上的smart for python
Firestorm是华盛顿的英雄,他基本上是个非常聪明的人。谁着火了。
同时,我也很难找到任何与着火的智能蛇有关的双关语。
《入门入门入门
>
您可以从他如下:
-[fhir smarthealthit sandbox上的smart][smarthealthit]
-[healthcare services platform consortium sandbox][hspc]
-[open epic][epic]
-[cerner millenium][cerner]
-[allscripts][allscripts]
[smarthealthit]:http://docs.smarthealthit.org/
[hspc]:https://sandbox.hspconsortium.org/
[epic]:https用法://open.epic.com/
[cerner]:http://fhir.cerner.com/millennium/dstu2/
[allscripts]:https://developer.allscripts.com/
授权代码
``python
import os
from fhirstorm import connection,auth
fhir终结点将重定向用户>;'
client戋secret='<;您*在注册应用程序时可能会*获得其中一个>;'
internal戋secret='itsaseekrit'\=连接(服务根)
/>scope='profile openid offline\u access launch/patient patient/*.*',
state=auth.jwt\u state(内部机密),
aud=service\u root)
````
r/>但是,在本例中,我将执行不太安全的"验证是否已将一些有效的签名
jwt传递回您。"
用户登录后将被重定向回您的"uri"(每个沙盒的凭据都不同;请参阅他们的文档
以获取登录时使用的正确凭据)
ent_u id,redirect_u uri,
authorization戋u response,
client戋u secret=client戋u secret,
如果有,则将其关闭
state戋u validator=auth.jwt戋u state戋u validator(internal戋secret))
或者如果保存了state:
tok=auth.fetch戋token(
服务、client戋id,redirect戋/>client_secret=client_secret,如果您有一个,否则将其关闭
state=state_value_saved)
`````
>现在您可以使用此令牌访问各种fhir资源。把它保存在安全的地方。
``python
conn=connection(
service\root,
session=oauth2session(
client_id=client_id,token=token))
````
在许多实现中,您将在token中获得患者id。有时,它会出现(以jwt的形式!)在编码的访问令牌中:
``python
import jwt
patient_id=token.get('patient')
如果patient_id为none:
decoded=jwt.decode(token['access_token',verify=false)
patient_id=decoderd.get('local_patient_id')
````
不过,ed可以从"service.r"对象获取资源:
``python
T?
现在您已经开始,可以查看Jupyter笔记本[教程][教程]了解更多详细信息。
[教程]:。/笔记本
\fhir上的smart for python
Firestorm是华盛顿的英雄,他基本上是个非常聪明的人。谁着火了。
同时,我也很难找到任何与着火的智能蛇有关的双关语。
《入门入门入门
>
您可以从他如下:
-[fhir smarthealthit sandbox上的smart][smarthealthit]
-[healthcare services platform consortium sandbox][hspc]
-[open epic][epic]
-[cerner millenium][cerner]
-[allscripts][allscripts]
[smarthealthit]:http://docs.smarthealthit.org/
[hspc]:https://sandbox.hspconsortium.org/
[epic]:https用法://open.epic.com/
[cerner]:http://fhir.cerner.com/millennium/dstu2/
[allscripts]:https://developer.allscripts.com/
授权代码
``python
import os
from fhirstorm import connection,auth
fhir终结点将重定向用户>;'
client戋secret='<;您*在注册应用程序时可能会*获得其中一个>;'
internal戋secret='itsaseekrit'\=连接(服务根)
/>scope='profile openid offline\u access launch/patient patient/*.*',
state=auth.jwt\u state(内部机密),
aud=service\u root)
````
r/>但是,在本例中,我将执行不太安全的"验证是否已将一些有效的签名
jwt传递回您。"
用户登录后将被重定向回您的"uri"(每个沙盒的凭据都不同;请参阅他们的文档
以获取登录时使用的正确凭据)
ent_u id,redirect_u uri,
authorization戋u response,
client戋u secret=client戋u secret,
如果有,则将其关闭
state戋u validator=auth.jwt戋u state戋u validator(internal戋secret))
或者如果保存了state:
tok=auth.fetch戋token(
服务、client戋id,redirect戋/>client_secret=client_secret,如果您有一个,否则将其关闭
state=state_value_saved)
`````
>现在您可以使用此令牌访问各种fhir资源。把它保存在安全的地方。
``python
conn=connection(
service\root,
session=oauth2session(
client_id=client_id,token=token))
在许多实现中,您将在token中获得患者id。有时,它会出现(以jwt的形式!)在编码的访问令牌中:
``python
import jwt
patient_id=token.get('patient')
如果patient_id为none:
decoded=jwt.decode(token['access_token',verify=false)
patient_id=decoderd.get('local_patient_id')
````
不过,ed可以从"service.r"对象获取资源:
``python
T?
现在您已经开始,可以查看Jupyter笔记本[教程][教程]了解更多详细信息。
[教程]:。/笔记本