FHIR资源json字符串的反序列化问题

时间:2014-07-31 16:33:18

标签: json deserialization hl7-fhir

我创建了一个Patient资源,并使用Java Jackson JSON序列化为一个字符串,字符串如下:

{" xmlId":空,"扩展":[]," modifierExtensions":[],"文本":空, "语言":空,"含有":[],"标识符":[{" xmlId":空,"扩展& #34;:[],"使用":空,"标签" {" xmlId":空,"扩展":[] "值":" MRN"}"系统" {" xmlId":空,"扩展&#34 ;: [],"值":"瓮:OID:1.2.3.4.5.1000"}"值" {" xmlId&#34 ;:空,"扩展":[],"值":" 50000160"}"周期":空,"分配器&# 34;:空," useSimple":空," systemSimple":"瓮:OID:1.2.3.4.5.1000"" valueSimple&#34 ;:" 50000160"" labelSimple":" MRN"},{" xmlId":空,"扩展" :[],"使用":空,"标签" {" xmlId":空,"扩展":[],&# 34;值":" MRN"}"系统" {" xmlId":空,"扩展":[], "值":"瓮:OID:1.3.6。 1.4.1.21367.2010.1.2.600"}"值" {" xmlId":空,"扩展":[],"值":" 1000000002"}"周期":空,"分配器":空," useSimple":空,&# 34; systemSimple":"瓮:OID:1.3.6.1.4.1.21367.2010.1.2.600"" valueSimple":" 1000000002"&# 34; labelSimple":" MRN"}],"名称":[{" xmlId":空,"扩展":[ ]"使用":空,"文本":空,"家庭":[{" xmlId":空,"扩展":[],"值":"生病"}],"给定":[{" xmlId":空, "扩展":[],"值":"非常"}],"前缀":[{" xmlId&#34 ;:空,"扩展":[],"值":空}],"后缀":[],"周期&#34 ;:空," useSimple":空," textSimple":空}],"电信":[],"两性" {&# 34; xmlId":空,"扩展":[],"编码":[{" xmlId":空,"扩展&#34 ;:[],"系统" {&#34 ; xmlId":空,"扩展":[],"值":" http://hl7.org/fhir/v3/MaritalStatus"}"版本&# 34;:空,"代码" {" xmlId":空,"扩展":[],"值":空}, "显示":空,"主":空," valueSet":空," versionSimple":空," primarySimple&# 34;:假," codeSimple":空," displaySimple":空," systemSimple":" http://hl7.org/fhir/v3/MaritalStatus"} ,{" xmlId":空,"扩展":[],"系统":空,"版本":空,&#34 ;代码":空,"显示":空,"主":空," valueSet":空," versionSimple&#34 ;:空," primarySimple":假," codeSimple":空," displaySimple":空," systemSimple":空}],&# 34;文本":空," textSimple":空}"生日" {" xmlId":空,"扩展" :[],"值" {"一年":1980,"一个月":1,"天":1,&#34 ;时间":假,"小时":0,"分钟":0,"秒":假," S的Econd":0,"级分":0,"级分":0,"时区":空," tzHour":0 " tzMin":0}},"死者":空,"地址":[]," maritalStatus" {&#34 ; xmlId":空,"扩展":[],"编码":[],"文本":空," textSimple&#34 ;日期null}," multipleBirth":空,"相片":[],"接触":[],"动物":空"通信":[]," careProvider":[]," managingOrganization":空,"连结":[],&# 34;有源":空," resourceType为":"患者#34;" activeSimple":假," birthDateSimple" {&# 34;一年":1980年,"当月" 1"天" 1"时间":假,"小时" :0,"分钟":0,"秒":假,"第二":0,"级分":0,&#34 ;分数":0,"时区":空," tzHour":0," tzMin":0}," languageSimple"日期null}

当我使用.Net客户端将其反序列化为Patient对象时,它会因以下错误而失败:

{"读取字符串时出错。意外的令牌:StartObject。路径'标识符[0] .label',第1行,第161位。"

你能帮忙解决这里的确切问题吗?

谢谢, 特里维迪

1 个答案:

答案 0 :(得分:0)

此示例中存在各种错误 - 您应该与此处的示例进行比较:http://hl7.org/implement/standards/fhir/patient-example.json.html,或在此处查看基本规范:http://hl7.org/implement/standards/fhir/json.html