HAPI-FHIR病人包需求

2024-06-14 09:49:48 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在使用一个hapifhir服务器,对java客户机有些陌生。我希望完成的是创建FHIR患者捆绑包,该捆绑包包含单个标识患者资源和所有其他资源,并将其保存为json文件。在

Patient Resource 1
Observation Resource 1
Condition Resource 1
Lab Resource 1
Observation Resource 2
...

我来自python背景,所以如果将它作为请求或curl来执行更简单的操作,那么也可以为患者迭代右端点。这是一个一次性的过程。如果他们是更具交易性的替代品,那也太好了。如有任何建议,我们将不胜感激!在


Tags: 文件服务器患者json客户机资源javacondition
2条回答

FHIR中的捆绑资源可以用来捆绑条件、遭遇、观察、病人等资源

//Example scala pseudo code
//For each of your FHIR resources, add them to a new Entry in your Bundle
// Create a new Patient
val patient = new Patient()
// Add the patient name
patient.addName()
 .addGiven("Bender Bending")
 .addFamily("Rodriguez")
//similarly you can create observation and condition object. 

//Every Bundle *must* contain a Patient resource
bundle.addEntry().setResource(patient)
bundle.addEntry().setResource(observation)
bundle.addEntry().setResource(condition)
bundle.setType(BundleTypeEnum.COLLECTION)
FhirContext ourCtx = FhirContext.forDstu3();
String output =ourCtx.newJsonParser().setPrettyPrint(true).encodeResourceToString(bundle);

// output will contain the JSON created from the bundle. more details on how 

JSON如下所示。 例子: 捆绑JSON层次结构: 捆绑 条目: 资源类型=条件 资源类型=观察 资源类型=患者

Json representation of Bundle

这在DSTU2和DSTU3中都支持,但是我在DSTU3的测试服务器中找不到合适的json,这是我粘贴DSTU2测试服务器链接的唯一原因。在

Bundle将条目结构为shown in this snap.

More details on Bundle

听起来您需要Patient/$everything(请参见http://hl7.org/fhir/patient-operations.html#everything)(尽管并非所有服务器都支持该操作)

相关问题 更多 >