1

我正在使用 HAPI FHIR 服务器,对 java 客户端有点陌生。我希望完成的是创建 FHIR 患者捆绑包,其中包括单个识别患者资源及其所有其他资源在一个完整的捆绑包中,并将其保存为 json 文件。

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

我来自 python 背景,所以如果请求或 curl 更简单地为患者迭代正确的端点,那也会受到欢迎。这是一个一次性的过程。如果它们是更具交易性的替代品,那也很棒。真诚感谢任何建议!

4

2 回答 2

2

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

于 2016-08-12T21:17:30.723 回答
1

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 层次结构:捆绑条目:资源类型 = 条件资源类型 = 观察资源类型 = 患者

Bundle的Json表示

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

Bundle 构建条目,如本快照所示。

有关捆绑包的更多详细信息

于 2016-11-22T06:46:03.993 回答