支持smart-on-fhir协议的fhir服务器灵活客户端

fhirclient的Python项目详细描述


智能FHIR客户端
====


这是一个灵活的Python客户端,用于支持[smart on FHIR][smart]协议的[FHIR][]服务器。
客户端与Python2.7.10和Python3兼容。

对于如下所示的客户端,可能在其错误修复版本上。
"开发"分支应在最近的冻结上,并且"功能/最新CI"分支定期更新为最新的FHIR连续集成版本。

` | (STU-3)
**x.x** | `1.8.0` | (STU-3 Ballot, Jan 2017)
**x.x** | `1.6.0` | (STU-3 Ballot, Sep 2016)
**1.0.3** | `1.0.2` | (DSTU 2)
**1.0** | `1.0.1` | (DSTU 2)
**0.5** | `0.5.0.5149` | (DSTU 2 Ballot, May 2015)
**0.0.4** | `0.0.82.2943` | (DSTU 1)
**0.0.3** | `0.0.82.2943` | (DS
**0.0.2**`0.0.82.2943`(dstu 1)






>










































连接到Smart on FHIR服务器(或任何打开的fhir服务器),您可以使用"fhir client"类。
它将初始化并处理"fhir server"实例,即您要访问的fhir服务器的实际句柄。



r/>'app-u id':'我的web应用',
'api-base':'https://fhir-open-api-dstu2.smarthealthealthit.org'






smart=client.fhr客户端(设置=设置)



'app-id''app'app-u id':'我的web应用程序',


‘app'app-id'app.patient.read('hca-pat-pat-1','smart.server)

patient.birthddate.isostring

_name(病人姓名[0])
#"christy ebert"
```

如果这是受保护的服务器,则首先必须将用户发送到授权终结点才能登录。
只需调用"smart.authorize\u url"即可获得正确的url。
可以使用"smart.prepare()",如果服务器受保护且需要授权,则返回"false"。
"smart.ready"属性Y有相同的目的,但是它不会检索服务器的"功能声明"资源,因此它只在快速检查服务器实例是否准备就绪时有用。

``python
smart=client.fhirclient(settings=settings)
smart.ready
`prints`false`
smart.prepare()
Smart.ready打印"true`
smart.prepare()

>将fhirclient.models.patient导入p
patient=p.patient.read('hca-pat-1',smart)
patient.name[0].给定
=client.fhirclient(设置=设置)
将fhirclient.models.procedure导入为p
search=p.procedure.where(struct={'subject':'hca-pat-1','status':'completed'})
procedures=search.perform悻resources(smart.server)
对于过程中的过程:
procedure.as悻json()
{'status':u'completed','code':{'text':u'lumpection w/sn,…

w bundle,而不是资源,您可以使用:
bundle=search.perform(smart.server)
````

ontains数据模型类,使用[fhir parser][]构建,它处理(反)序列化并允许以pythonic方式处理fhir数据。
从1.0.5版开始,数据模型的有效性在一定程度上得到加强。


ent.models.patient as p
导入fhirclient.models.humanname as hn
patient=p.patient({'id':'patient-1'})
patient.id
打印"patient-1"

name=hn.humanname()
name.given=['peter']
name.family='parker'
patient.name=[name]
patient.as嫒json()
打印患者的json表示,现在具有id和name


name.given='peter'
patient.as悻json()
<;class'str'>;
`````


``从json文件初始化

``python
S公司第一个"name"属性中的给定名称数组
``

进入我们的沙盒服务器并选择一名患者。
然后检索所选患者的人口统计和医疗处方,并将其列在一个简单的HTML页面中。

Flask演示应用程序有单独的要求。
克隆"客户端-副本"存储库,然后最好创建一个虚拟环境。环境和安装所需的软件包如下:

git clone https://github.com/smart on fhir/client py.git
cd client py
virtualenv-p python3 env
。env/bin/activate
pip install-r requirements廑flask廑app.txt
python flask廑app.py





building distribution
----

python setup.python sdist
python setup.py bdist廑u wheel


lib版本

bumpversion补丁
bumpversion minor
bumpversion major


----


docs是用[doxygen][]和[doxypypy][]生成的。
您可以通过pip安装doxypypypy:`pip install doxypypy`.
然后您就可以运行doxygen,配置存储在"doxyfile"中。

e HTML文件,使用:

rsync-a docs/html/。/client py web/


--------


使用设置工具(*注意*:或者,可以使用tween https://pypi.python.org/pypi/tween/):


<<




copy server.smarthealthit.org/home/fhir/.pypirc to/.pypirc to/.pypirc

<<





<
<
<






/>
cop copserver server.smhttp.smalthealthi
python setup.py sdist upload-r pypi
python setup.py bdist庠wheel upload-r pypi


[fhir]:http://www.hl7.org/implement/standards/fhir/
[smart]:http://docs.smarthealthit.org
[fhir parser]:https://github.com/smart on fhir/fhir parser
[docs]:https://smart on fhir.github.io/client py
[烧瓶应用程序]:https://github.com/smart on fhir/client py/blob/master/烧瓶应用程序.py
[doxygen]:http://www.stack.nl/~dimitri/doxygen
[doxypypy]:https://github.com/feneric/doxypypy


cr编辑
=


"fHirclient"由智能平台团队/波士顿儿童医院编写和维护。



//github.com/erikwiffin>;
-josh mandel<;https://github.com/jmandel>;
-nikolai schwertner<;https://github.com/nschwertner>;
-pascal pfiffner<;https://github.com/p2>;
-trinadh baranika<;https://github.com/bktrinadh>;

当你提交你的第一次请求的时候。

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
ByteArrayOutputStream的java解码属性   java S3 SDK在上载时更新单个对象,而不是创建新文件   java hibernate:无法从eclipse连接到DB   java如何在强制转换JComboBox之前检查其类型?   http从Java中的GETPOST请求方法捕获URI、资源名称,如开发人员工具中所示   java在Spring@Bean方法中返回接口的局限性   Java中的Web服务和客户端(使用Eclipse Apache Axis 2自底向上服务)某些代码会引发异常   java spring安全+rest不起作用   java将LinkedList添加到包含LinkedList的LinkedList并更改添加的LinkedList   java是否临时删除对象的属性?   java使用AnimatedGifEncoder类创建的gif图像的部分帧是不透明的   java如何高效地处理maven3时间戳快照?   java向集合对象添加另一项   java如何将动态参数传递给jquery函数   java使用libGdx桌面端口作为Android GLES20的仿真器