eXistDB查询测试01病案首页EMR

(:查询文档标题:)
xquery version "3.0";
collection('/db/ZS_FrontPageBA/病案首页01')/ClinicalDocument/title
(:查询患者ID:)
xquery version "3.0";
collection('/db/ZS_FrontPageBA')/ClinicalDocument/recordTarget/patientRole/id[@assigningAuthorityName='XDS.Patientid' and @root='2.16.840.1.113883.4.487.2.1.4']
xquery version "3.0";
(:查询患者的id,并修改返回结构:)
for $anid in collection('/db/ZS_FrontPageBA')/ClinicalDocument/recordTarget/patientRole/id[@assigningAuthorityName='XDS.Patientid' and @root='2.16.840.1.113883.4.487.2.1.4']
return
    <patient patientId='{$anid/@extension}' patientDomain='{$anid/@root}'> </patient>
(:查询患者入院诊断:)
xquery version "3.0";
for $diagnose in collection('/db/ZS_FrontPageBA')/ClinicalDocument/component/structuredBody/component/section[title="入院诊断"]/text
return
    <indiagnose value='{$diagnose}'></indiagnose>

(:查询并给出患者的基本信息:)
xquery version "3.0";

for $apatient in collection('/db/ZS_FrontPageBA')/ClinicalDocument/recordTarget/patientRole
return
    <patient>
        <name value='{$apatient/patient/name}'></name>
        <sex value='{$apatient/patient/administrativeGenderCode/@displayName}'></sex>
        <birthTime value='{$apatient/patient/birthTime}'></birthTime>
        <address value='{$apatient/addr[@use='H']/streetAddressLine}'></address>
        <ethnic value='{$apatient/patient/ethnicGroupCode/@displayName}'></ethnic>
        <patientId value='{$apatient/id[@assigningAuthorityName='XDS.Patientid' and @root='2.16.840.1.113883.4.487.2.1.4']/@extension}'> </patientId>
        <flowId value='{$apatient/id[@assigningAuthorityName='XDS.Patientid' and @root='2.16.840.1.113883.4.487.2.1.4.4']/@extension}'> </flowId>
    </patient>
xquery version "3.0";
(:查询并给出患者的住院信息:)
for $ClinicalDocument in collection('/db/ZS_FrontPageBA')/ClinicalDocument
return
    <patient>
        <name value='{$ClinicalDocument/recordTarget/patientRole/patient/name}'></name>
        <sex value='{$ClinicalDocument/recordTarget/patientRole/patient/administrativeGenderCode/@displayName}'></sex>
        <birthTime value='{$ClinicalDocument/recordTarget/patientRole/patient/birthTime}'></birthTime>
        <age value='{$ClinicalDocument/recordTarget/patientRole/id[@assigningAuthorityName='XDS.Patientage']/@extension}'></age>
        <nationality value='{$ClinicalDocument/recordTarget/patientRole/id[@assigningAuthorityName='DICT.Nationality']/@extension}'></nationality>
        <address value='{$ClinicalDocument/recordTarget/patientRole/addr[@use='H']/streetAddressLine}'></address>
        <ethnic value='{$ClinicalDocument/recordTarget/patientRole/patient/ethnicGroupCode/@displayName}'></ethnic>
        <phone value='{$ClinicalDocument/recordTarget/patientRole/telecom[@use='HP']/@value}'></phone>
        
        <patientId value='{$ClinicalDocument/recordTarget/patientRole/id[@assigningAuthorityName='XDS.Patientid' and @root='2.16.840.1.113883.4.487.2.1.4']/@extension}'> </patientId>
        <flowId value='{$ClinicalDocument/recordTarget/patientRole/id[@assigningAuthorityName='XDS.Patientid' and @root='2.16.840.1.113883.4.487.2.1.4.4']/@extension}'> </flowId>
        <attendingDoc value='{$ClinicalDocument/legalAuthenticator/assignedEntity/assignedPerson/name}'> </attendingDoc>
        <nurse  value='{$ClinicalDocument/participant/associatedEntity[id/@extension="责任护士"]/associatedPerson/name}'> </nurse>
        <hospital value='{$ClinicalDocument/custodian/assignedCustodian/representedCustodianOrganization/name}'></hospital>
        <department value=''></department>
        <ward value='{$ClinicalDocument/documentationOf/serviceEvent/performer/assignedEntity/representedOrganization/asOrganizationPartOf/wholeOrganization/name}'></ward>
        <bedno value=''></bedno>
        <indiagnose value='{$ClinicalDocument/component/structuredBody/component/section[title="入院诊断"]/text}'></indiagnose>
        <outdiagnose value='{$ClinicalDocument/component/structuredBody/component/section[title="出院诊断"]/text/table/tbody/tr/td[1]}'></outdiagnose>
        <sergury value='{$ClinicalDocument/component/structuredBody/component/section[title="手术/操作史"]/text/table/tbody/tr/td[2]}'></sergury>
    </patient>

Leave a Reply

Your email address will not be published. Required fields are marked *

*