簡體   English   中英

HAPI FHIR患者套裝申請

[英]HAPI FHIR Patient Bundle Request

我正在使用HAPI FHIR服務器,對java客戶端有些新手。 我希望完成的是創建FHIR患者包,其中包括一個完整的捆綁包中的單個識別患者資源和所有其他資源,並將其保存為json文件。

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

我來自python背景,所以如果它更簡單地做為請求或卷曲迭代通過正確的端點為患者也歡迎。 這是一次性過程。 如果它們是更具交易性的替代品,那么它們也會很棒。 任何建議真誠地感謝!

聽起來你想要Patient / $ everything(參見http://hl7.org/fhir/patient-operations.html#everything )(雖然並非所有服務器都支持該操作)

FHIR中的Bundle資源可用於捆綁資源,如條件,遭遇,觀察,患者等。

//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看起來如下所示。 示例:Bundle JSON層次結構:Bundle Entry:Resource-type = Condition Resource-type = Observation Resource-type = Patient

捆綁的Json表示

這在DSTU2和DSTU3都得到支持,但是我在DSTU3的測試服務器中找不到合適的json,這是我粘貼DSTU2測試服務器鏈接的唯一原因。

Bundle構造了這個條目中顯示的條目

關於Bundle的更多細節

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM