【发布时间】:2020-12-23 11:32:56
【问题描述】:
我有患者的 JSON 数据,我尝试用新数据更新它。 当我尝试更新此患者时,条目将重复并且不会像这样更新:
{
"telecom": [
{
"system": "phone",
"value": "2222215",
"use": "home"
},
{
"system": "phone",
"value": "2222215",
"use": "home"
}
],
"gender": "male",
"birthDate": "2020-12-24",
"address": [
{
"use": "home",
"line": [
"28MCT"
],
"city": "Hưng Yên",
"district": "Huyện Kim Động",
"state": "Thị Trấn Lương Bằng",
"country": "VNM"
},
{
"use": "home",
"city": "Hưng Yên",
"district": "Huyện Kim Động",
"state": "Thị Trấn Lương Bằng",
"country": "VNM"
}
]}
确切的更新方式是什么?这是我的代码:
private static void UpdatePatient(string patientId)
{
var client = new FhirClient("http://hapi.fhir.org/baseR4");
Patient pat = client.Read<Patient>("Patient/1723313");
pat.Address.Add(new Address(){
Line = new string[1] {"28 MCT"},
District = "Bến Cát",
State = "An Thới",
City = "Bình Dương",
Country = "VNM"
});
client.Update<Patient>(pat);
}
感谢您的帮助。
【问题讨论】:
-
您是否通过 HTTP 调试器运行客户端网络流量?