Quantcast

json serialize problem.

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

json serialize problem.

lin_xd
hi,all

I have do a json serialize out put test in develop version exide., the script:
xquery version "3.1";

import module namespace console="http://exist-db.org/xquery/console" at "java:org.exist.console.xquery.ConsoleModule";

declare default element namespace "urn:sc-wst:v1";
declare namespace output = "http://www.w3.org/2010/xslt-xquery-serialization";
declare option output:method "json";
declare option output:media-type "application/json";
console:log("starting test2"),
collection('/db/ehr/v2')//DataSet[HDSN00.01.013/@value="a894317f-53da-486f-a1df-cea23200273d"],
console:log("finished test2")

out:
---
"<DataSet xmlns=\"urn:sc-wst:v1\" code=\"HSDA00.01\" displayName=\"个人基本信息数据集\" codeSystem=\"WS365-2011\" codeSystemName=\"城乡居民健康档案基本数据集\">\n    <HDSN00.01.013 dataelementName=\"文档编号\" value=\"a894317f-53da-486f-a1df-cea23200273d\"/>\n    <HDSN00.01.014 dataelementName=\"文档生成日期\" value=\"20131201\"/>\n    <HDSN00.01.015 dataelementName=\"参与人电话\" value=\"13999999999\"/>\n    <HDSN00.01.016 dataelementName=\"参与人姓名\" value=\"周裕凯\"/>\n    <HDSN00.01.001 dataelementName=\"记录日期\" value=\"20111231\"/>\n    <HDSN00.01.002 dataelementName=\"记录者姓名\" value=\"张政\"/>\n    <HDSN00.01.003 dataelementName=\"记录人编号\" value=\"234234234\"/>\n    <HDSN00.01.004 dataelementName=\"记录人联系电话\" value=\"15181010868\"/>\n    <HDSN00.01.005 dataelementName=\"记录人所属机构名称\" value=\"xxx市人民医院\"/>\n    <HDSN00.01.006 dataelementName=\"记录人所属机构代码\" value=\"451134681\"/>\n    <HDSN00.01.007 dataelementName=\"记录人所属机构地址\" value=\"旌阳区泰山北路一段173\"/>\n    <HDSN00.01.008 dataelementName=\"文档保管机构名称\" value=\"卫生局健康档案管理中心\"/>\n    <HDSN00.01.009 dataelementName=\"文档保管机构代码\" value=\"008380431\"/>\n    <HDSN00.01.010 dataelementName=\"文档保管机构地址\" value=\"庐山南路二段299号\"/>\n    <HDSN00.01.011 dataelementName=\"文档保管机构联系电话 \" value=\"08382202999\"/>\n    <HDSN00.01.032 dataelementName=\"源ID\" value=\"451134681\"/>\n    <HDSN00.01.017 dataelementName=\"新农合号\" value=\"51062310120201001001\"/>\n    <HDSN00.01.018 dataelementName=\"社保号\" value=\"101010190001010006\"/>\n    <HDSD00.01.001 dataelementName=\"城乡居民健康档案编号\" value=\"0085008509175450\"/>\n    <HDSD00.01.002 dataelementName=\"本人姓名\" value=\"洗衣机\"/>\n    <HDSD00.01.003 dataelementName=\"性别代码\" code=\"2\" displayName=\"女性\" codeSystem=\"2.16.156.10011.2.3.3.4\" codeSystemName=\"生理性别代码表(GB/T 2261.1)\"/>\n    <HDSD00.01.004 dataelementName=\"出生日期\" value=\"19000101\"/>\n    <HDSD00.01.005 dataelementName=\"身份证件类别代码\" code=\"01\" displayName=\"居民身份证\" codeSystem=\"2.16.156.10011.2.3.1.1\" codeSystemName=\"身份证件类别代码表\"/>\n    <HDSD00.01.006 dataelementName=\"身份证件号码\" value=\"101010190001010006\"/>\n    <HDSD00.01.376 dataelementName=\"户籍地址-省(自治区、直辖市)\" value=\"四川省\"/>\n    <HDSD00.01.377 dataelementName=\"户籍地址-市(地区、州)\" value=\"德阳市\"/>\n    <HDSD00.01.378 dataelementName=\"户籍地址-县(区)\" value=\"旌阳区\"/>\n    <HDSD00.01.379 dataelementName=\"户籍地址-乡(镇、街道办事处)\" value=\"\"/>\n    <HDSD00.01.380 dataelementName=\"户籍地址-村(街、路、弄等)\" value=\"西外街\"/>\n    <HDSD00.01.381 dataelementName=\"户籍地址-门牌号码\" value=\"居福苑3栋2单元\"/>\n    <HDSD00.01.424 dataelementName=\"邮政编码\" value=\"618000\"/>\n    <HDSD00.01.007 dataelementName=\"工作单位名称\" value=\"德阳市明达汽贸有限公司\"/>\n    <HDSD00.01.008 dataelementName=\"本人电话号码\" value=\"15123458765\"/>\n    <HDSD00.01.009 dataelementName=\"联系人姓名\" value=\"洗衣机\"/>\n    <HDSD00.01.010 dataelementName=\"联系人电话号码\" value=\"13787655645\"/>\n    <HDSD00.01.011 dataelementName=\"常住地址户籍标志\" value=\"true\"/>\n    <HDSD00.01.012 dataelementName=\"民族\" code=\"01\" displayName=\"汉族\" codeSystem=\"2.16.156.10011.2.3.3.3\" codeSystemName=\"民族代码表(GB 3304)\"/>\n    <HDSD00.01.013 dataelementName=\"ABO血型代码\" code=\"1\" displayName=\"A型\" codeSystem=\"2.16.156.10011.2.3.1.85\" codeSystemName=\"ABO血型代码表\"/>\n    <HDSD00.01.014 dataelementName=\"Rh血型代码\" code=\"1\" displayName=\"Rh阴性\"/>\n    <HDSD00.01.015 dataelementName=\"学历代码\" code=\"61\" displayName=\"普通高中毕业\" codeSystem=\"2.16.156.10011.2.3.3.6\" codeSystemName=\"学历代码表(GB/T 4568)\"/>\n    <HDSD00.01.016 dataelementName=\"职业类别代码\" code=\"4\" displayName=\"商业、服务业人员\" codeSystem=\"2.16.156.10011.2.3.3.7\" codeSystemName=\"职业类别代码表\"/>\n    <HDSD00.01.017 dataelementName=\"婚姻状况代码\" code=\"20\" displayName=\"已婚\" codeSystem=\"2.16.156.10011.2.3.3.5\" codeSystemName=\"婚姻状况代码表\"/>\n    <HDSD00.01.018 dataelementName=\"医疗费用支付方式代码\" code=\"01\" displayName=\"城镇职工基本医疗保险\" codeSystem=\"2.16.156.10011.2.3.1.197\" codeSystemName=\"医疗费用来源类别代码表\"/>\n    <HDSD00.01.019 dataelementName=\"药物过敏史标志\" value=\"true\"/>\n    <HDSD00.01.01>\n      <row>\n        <HDSD00.01.020 dataelementName=\"药物过敏源\" code=\"1\" displayName=\"镇静麻醉剂过敏\" codeSystem=\"2.16.156.10011.2.3.1.137\" codeSystemName=\"过敏源代码表\"/>\n      </row>\n    </HDSD00.01.01>    \n    <HDSD00.01.02>\n      <row>\n        <HDSD00.01.021 dataelementName=\"环境危险因素暴露类别代码\" code=\"2\" displayName=\"化学品\" codeSystem=\"2.16.156.10011.2.3.1.33\" codeSystemName=\"环境危险因素暴露类别代码表\"/>\n      </row>\n    </HDSD00.01.02>\n    <HDSD00.01.03>\n      <row>\n        <HDSD00.01.022 dataelementName=\"既往患病种类代码\" code=\"02\" displayName=\"高血压\" codeSystem=\"2.16.156.10011.2.3.1.12\" codeSystemName=\"既往常见疾病种类代码表\"/>\n        <HDSD00.01.023 dataelementName=\"既往患病确诊日期\" value=\"20110123\"/>\n      </row>    \n  </HDSD00.01.03>\n    <HDSD00.01.024 dataelementName=\"手术史标志\" value=\"true\"/>\n    <HDSD00.01.04>\n      <row>\n        <HDSD00.01.025 dataelementName=\"手术史\" value=\"阑尾手术\"/>\n        <HDSD00.01.026 dataelementName=\"手术(操作)日期时间\" value=\"20110123\"/>\n      </row>\n    </HDSD00.01.04>\n    <HDSD00.01.027 dataelementName=\"外伤史标志\" value=\"false\"/>\n    <HDSD00.01.05>\n      <row>\n      </row>\n    </HDSD00.01.05>\n    <HDSD00.01.030 dataelementName=\"输血史标志\" value=\"fasle\"/>\n    <HDSD00.01.06>\n      <row>\n      </row>\n    </HDSD00.01.06>\n    <HDSD00.01.07>\n      <row>\n        <HDSD00.01.033 dataelementName=\"家族性疾病名称代码\" code=\"02\" displayName=\"高血压\" codeSystem=\"2.16.156.10011.2.3.1.12\" codeSystemName=\"既往常见疾病种类代码表\"/>\n        <HDSD00.01.034 dataelementName=\"家族成员与本人关系代码\" code=\"20\" displayName=\"子\" codeSystem=\"2.16.156.10011.2.3.3.8\" codeSystemName=\"家庭关系代码\"/>\n      </row>\n    </HDSD00.01.07>\n    <HDSD00.01.08>\n      <row>\n      </row>\n    </HDSD00.01.08>    \n    <HDSD00.01.09>\n      <row>\n      </row>\n    </HDSD00.01.09>\n    <HDSD00.01.037 dataelementName=\"家庭厨房排风设施标志\" value=\"true\"/>\n    <HDSD00.01.038 dataelementName=\"家庭厨房排风设施类别代码\" code=\"1\" displayName=\"油烟机\" codeSystem=\"2.16.156.10011.2.3.1.34\" codeSystemName=\"厨房排风设施类别代码表\"/>\n    <HDSD00.01.039 dataelementName=\"家庭燃料类型类别代码\" code=\"1\" displayName=\"液化气\" codeSystem=\"2.16.156.10011.2.3.1.27\" codeSystemName=\"燃料类型类别代码表\"/>\n    <HDSD00.01.040 dataelementName=\"家庭饮水类别代码\" code=\"1\" displayName=\"自来水\" codeSystem=\"2.16.156.10011.2.3.1.34\" codeSystemName=\"饮水类别代码表\"/>\n    <HDSD00.01.041 dataelementName=\"家庭厕所类别代码\" code=\"1\" displayName=\"卫生厕所\" codeSystem=\"2.16.156.10011.2.3.1.36\" codeSystemName=\"厕所类别代码表\"/>\n    <HDSD00.01.042 dataelementName=\"家庭禽畜类别\" code=\"1\" displayName=\"单设\"/>\n  </DataSet>"

--
此致

   林晓东

莫愁前路无知己,天下谁人不识君。


 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: json serialize problem.

Dannes Wessels-3
Hi,

On 22 Apr 2017, at 22:20 , 林晓东 <[hidden email]> wrote:

I have do a json serialize out put test in develop version exide., the script:

- what existdb version? — please always tell us!
- is there something in exist.log ? — please only small relevant log fragments!
- what happens if you store the xq file and access it directly via the HTTP url?

cheers

D.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: json serialize problem.

Dannes Wessels-3
And please make whenever possible we can run without downloading additional resources :-) 


On 23 Apr 2017, at 14:02 , Dannes Wessels <[hidden email]> wrote:

On 22 Apr 2017, at 22:20 , 林晓东 <[hidden email]> wrote:

I have do a json serialize out put test in develop version exide., the script:

- what existdb version? — please always tell us!
- is there something in exist.log ? — please only small relevant log fragments!
- what happens if you store the xq file and access it directly via the HTTP url?


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: json serialize problem.

Dannes Wessels-3
the following code works in my eXide, JSON output:

console:log("starting test2"),
<a><b>b</b></a>,
console:log("finished test2”)

so you’d need to share with us
- the existdb version
- the eXide version
- a *small* and *simplified* dataset with us so we can reproduce. I will not login to your server to verify.

cheers

Dannes


On 23 Apr 2017, at 14:05 , Dannes Wessels <[hidden email]> wrote:

And please make whenever possible we can run without downloading additional resources :-) 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Exist-open mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/exist-open
Loading...