![](/img/trans.png)
[英]How do I add an icon via Stylesheet using PyInstaller --onefile option with resource_path in PyQt5?
[英]How do I add a resource to a bundle using fhirclient (Smart on FHIR)?
我正在使用fhirclient (FHIR上的智能)python库,已成功创建了捆绑包和单独的资源。 我假设“捆绑”类中有一些辅助方法,可以让我向捆绑中添加资源,但是我似乎还不太清楚如何做到这一点。 例如我有类似(伪代码)的东西:
b = fhirclient.Bundle()
p = fhirclient.Patient()
c = fhirclient.Claim()
# Now I want to add my patient (p) and claim (c) to the bundle (b)
我以为,由于捆绑包包含列表元素“ entry”,所以我要做的就是像这样添加资源:
b.entry.append(p)
b.entry.append(c)
但这是行不通的。 我收到消息:“ AttributeError:'NoneType'对象没有属性'append'。
您将要使用以下过程创建条目:
p_entry = BundleEntry()
p_entry.resource = p
c_entry = BundleEntry()
c_entry.resource = c
b.entry = [p_entry, c_entry]
使用from fhircilent.models.bundle import BundleEntry
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.