我有一个约会 json,我需要将其转换为 DSTU2 HAPI FHIR json 对象。任何可用于相同的标准库?谷歌 gson 库可以工作,但没有为字段中的对象赋予价值
{
"resourceType": "Appointment",
"id": "",
"status": "proposed",
"reason": {
"text": "Regular checkup"
},
"description": "",
"slot": [
{
"reference": "bfgf5dfdf4e45g"
}
],
"comment": "Regular yearly visit",
"participant": [
{
"actor": {
"reference": "9sdfsndjkfnksdfu3yyugbhjasbd"
},
"required": "required"
},
{
"actor": {
"reference": "78hjkdfgdfg223vg"
},
"required": "required"
},
{
"actor": {
"reference": "sdfs3df5sdfdfgdf"
},
"required": "required"
}
]
}
需要将上面的 json 转换为我使用的 ca.uhn.fhir.model.dstu2.resource.Appointment 类
Appointment appointment = new Gson().fromJson(map.get("appointment"), Appointment.class);
但它给出了带有空字段的约会对象