++++++++++classscheme 常用uuid备注++++++++++
urn:uuid:75df8f67-9973-4fbe-a900-df66cefecc5a XDSFolder.uniqueId 目录的uid
urn:uuid:f64ffdf0-4b97-4e06-b79f-a52b38ec2f8a XDSFolder.patientId 目录的病人id
urn:uuid:2e82c1f6-a085-4c72-9da3-8640a32e42ab XDSDocumentEntry.uniqueId 文档条目uid
urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427 XDSDocumentEntry.patientId 文档条目病人id
urn:uuid:96fdda7c-d067-4183-912e-bf5ee74998a8 XDSSubmissionSet.uniqueId 提交集uid
urn:uuid:6b5aea1a-874d-4603-a4bc-96a0a7b38446 XDSSubmissionSet.patientId 提交集病人id
urn:uuid:554ac39e-e3fe-47fe-b233-965d2a147832 XDSSubmissionSet.sourceId 提交集sourceid
++++++++++classscheme 常用uuid备注++++++++++
++++++++++classscheme uuid全集++++++++++
SQ_FindDocuments = "urn:uuid:14d4debf-8f97-4251-9a74-a90016b0af0d";
SQ_FindSubmissionSets = "urn:uuid:f26abbcb-ac74-4422-8a30-edb644bbc1a9";
SQ_FindFolders = "urn:uuid:958f3006-baad-4929-a4de-ff1114824431";
SQ_GetAll = "urn:uuid:10b545ea-725c-446d-9b95-8aeb444eddf3";
SQ_GetDocuments = "urn:uuid:5c4f972b-d56b-40ac-a5fc-c8ca9b40b9d4";
SQ_GetFolders = "urn:uuid:5737b14c-8a1a-4539-b659-e03a34a5e1e4";
SQ_GetAssociations = "urn:uuid:a7ae438b-4bc2-4642-93e9-be891f7bb155";
SQ_GetDocumentsAndAssociations = "urn:uuid:bab9529a-4a10-40b3-a01f-f68a615d247a";
SQ_GetSubmissionSets = "urn:uuid:51224314-5390-4169-9b91-b1980040715a";
SQ_GetSubmissionSetAndContents = "urn:uuid:e8e3cb2c-e39c-46b9-99e4-c12f57260b83";
SQ_GetFolderAndContents = "urn:uuid:b909a503-523d-4517-8acf-8e5834dfc4c7";
SQ_GetFoldersForDocument = "urn:uuid:10cae35a-c7f9-4cf5-b61e-fc3278ffb578";
SQ_GetRelatedDocuments = "urn:uuid:d90e5407-b356-4d91-a89f-873917b4b0e6";
SQ_FindDocumentsForMultiplePatients = "urn:uuid:3d1bdb10-39a2-11de-89c2-2f44d94eaa9f";
SQ_FindFoldersForMultiplePatients = "urn:uuid:50d3f5ac-39a2-11de-a1ca-b366239e58df";
XDSSubmissionSet_patientid_uuid = "urn:uuid:6b5aea1a-874d-4603-a4bc-96a0a7b38446";
XDSDocumentEntry_patientid_uuid = "urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427";
XDSFolder_patientid_uuid = "urn:uuid:f64ffdf0-4b97-4e06-b79f-a52b38ec2f8a";
XDSSubmissionSet_uniqueid_uuid = "urn:uuid:96fdda7c-d067-4183-912e-bf5ee74998a8";
XDSDocumentEntry_uniqueid_uuid = "urn:uuid:2e82c1f6-a085-4c72-9da3-8640a32e42ab";
XDSFolder_uniqueid_uuid = "urn:uuid:75df8f67-9973-4fbe-a900-df66cefecc5a";
XDSSubmissionSet_author_uuid = "urn:uuid:a7058bb9-b4e4-4307-ba5b-e3f0ab85e12d";
XDSDocumentEntry_author_uuid = "urn:uuid:93606bcf-9494-43ec-9b4e-a7748d1a838d";
XDSSubmissionSet_sourceid_uuid="urn:uuid:554ac39e-e3fe-47fe-b233-965d2a147832";
XDSDocumentEntry_objectType_uuid="urn:uuid:7edca82f-054d-47f2-a032-9b2a5b5186c1";
XDSSubmissionSet_classification_uuid = "urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd";
XDSFolder_classification_uuid = "urn:uuid:d9d542f3-6cc4-48b6-8870-ea235fbc94c2";
XDSDocumentEntry_formatCode_uuid="urn:uuid:a09d5840-386c-46f2-b5ad-9c3699a4309d";
XDSDocumentEntry_classCode_uuid="urn:uuid:41a5887f-8865-4c09-adf7-e362475b143a";
XDSDocumentEntry_psCode_uuid="urn:uuid:cccf5598-8b07-4b77-a05e-ae952c785ead";
XDSDocumentEntry_hcftCode_uuid="urn:uuid:f33fb8ac-18af-42cc-ae0e-ed0b0bdb91e1";
XDSDocumentEntry_eventCode_uuid="urn:uuid:2c6b8cb7-8b2a-4051-b291-b1ae6a575ef4";
XDSDocumentEntry_confCode_uuid="urn:uuid:f4f85eac-e6cb-4883-b524-f2705394840f";
XDSDocumentEntry_typeCode_uuid="urn:uuid:f0306f51-975f-434e-a61c-c59651d33983";
XDSSubmissionSet_contentTypeCode_uuid = "urn:uuid:aa543740-bdda-424e-8c96-df4873be8500";
XDSFolder_codeList_uuid="urn:uuid:1ba97051-7806-41a8-a48b-8fce7af683c5";
XDSAssociationDocumentation_uuid = "urn:uuid:abd807a3-4432-4053-87b4-fd82c643d1f3";
++++++++++classscheme uuid全集++++++++++
+++++SQL 查询+++++
`repository`存储文档基本信息
`extrinsicobject`注册库中文档的信息(uuid)
`registrypackage`注册库中描述提交集和文件夹的表(例如:提交一个文件夹在此张表中会产生两条信息)
`externalidentifier`可以区分`registrypackage`中提交集和文件夹信息
--1.根据病人ID 查询提交集
SELECT patId.registryObject
FROM RegistryPackage doc, ExternalIdentifier patId
WHERE
(doc.id = patId.registryobject AND
patId.identificationScheme='urn:uuid:6b5aea1a-874d-4603-a4bc-96a0a7b38446' AND
patId.value = '502^^^&1.3.6.1.4.1.21367.2005.13.20.1000&ISO' )
AND doc.status IN ('urn:oasis:names:tc:ebxml-regrep:StatusType:Approved');
--2.根据病人ID 查询目录
SELECT patId.registryObject
FROM RegistryPackage doc, ExternalIdentifier patId
WHERE
(doc.id = patId.registryobject AND
patId.identificationScheme='urn:uuid:f64ffdf0-4b97-4e06-b79f-a52b38ec2f8a' AND
patId.value = '502^^^&1.3.6.1.4.1.21367.2005.13.20.1000&ISO' )
AND doc.status IN ('urn:oasis:names:tc:ebxml-regrep:StatusType:Approved');
--3.根据病人ID 查询病人文档
SELECT ei.registryObject FROM ExtrinsicObject eo, ExternalIdentifier ei
WHERE
ei.registryObject=eo.id AND
ei.identificationScheme='urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427' AND--XDSDocumentEntry_patientid_uuid = "urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427";
ei.value IN ('502^^^&1.3.6.1.4.1.21367.2005.13.20.1000&ISO');
-- 4.查询关系表(文档/目录/提交集之间的关系)
SELECT * FROM Association a
WHERE
(a.sourceObject IN ('urn:uuid:9ec6f4bb-b7f7-4675-85d6-c5eee74fb240') OR
a.targetObject IN ('urn:uuid:9ec6f4bb-b7f7-4675-85d6-c5eee74fb240') )
AND a.associationType IN ('urn:ihe:iti:2007:AssociationType:RPLC')
--5根据病人id查找 文档id列表 XDSDocumentEntry_patientid_uuid = "urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427";
SELECT eo.id FROM ExtrinsicObject eo, ExternalIdentifier ei
WHERE
ei.registryObject=eo.id AND
ei.identificationScheme='urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427' AND
ei.value IN ('P1^^^&1.3.6.1.4.1.21367.2005.13.20.1000&ISO')
--6根据文档ID 查询关联关系 追加 转换 替换 target=文档id
SELECT * FROM Association a
WHERE
(a.sourceObject IN ('文档id') OR
a.targetObject IN ('文档id') );
--7根据病人id查找 文件夹 id列表 XDSFolder_patientid_uuid = "urn:uuid:f64ffdf0-4b97-4e06-b79f-a52b38ec2f8a";
SELECT fol.id
FROM RegistryPackage fol, ExternalIdentifier patId
WHERE
(fol.id = patId.registryobject AND
patId.identificationScheme='urn:uuid:f64ffdf0-4b97-4e06-b79f-a52b38ec2f8a' AND
patId.value = 'P20180129095244.18^^^&1.3.6.1.4.1.21367.2005.13.20.1000&ISO' ) AND
fol.status IN ('urn:oasis:names:tc:ebxml-regrep:StatusType:Approved');
--8根据文件夹id 查文档id列表
SELECT a.targetObject FROM Association a
WHERE a.sourceObject IN ('文件夹id') and a.associationType = 'urn:oasis:names:tc:ebxml-regrep:AssociationType:HasMember';
--9根据文件夹id 查关联关系 文件夹两种关联关系:s=ssid t=folderid 或 s=folder t=docid
SELECT a.targetObject FROM Association a
WHERE (a.sourceObject IN ('文件夹id') OR
a.targetObject IN ('文件夹id') )
and a.associationType = 'urn:oasis:names:tc:ebxml-regrep:AssociationType:HasMember';
--10根据文档id获取这个文档属于哪个文件夹 XDSFolder_uniqueid_uuid = "urn:uuid:75df8f67-9973-4fbe-a900-df66cefecc5a";
SELECT * FROM RegistryPackage fol, Association a
WHERE
a.associationType = 'urn:oasis:names:tc:ebxml-regrep:AssociationType:HasMember' AND
a.targetObject = '文档id' AND
a.sourceObject = fol.id ;
-- 11.根据病人ID查找文档集
select ss.id
from registrypackage ss
,externalidentifier patId
,classification c
where ss.id=patId.registryObject
and ss.id=c.classificationNode
-- 仅选择 XDSSubmissionSet 对象,见表 classificationnode
and c.classificationNode='urn:uuid:a54d6aa5-d40d-43f9-88c5-b4633d873bdd'
-- 仅关联 XDSSubmissionSet.patientId 类型,identificationScheme 见表 classscheme
and patId.identificationScheme='urn:uuid:6b5aea1a-874d-4603-a4bc-96a0a7b38446'
and patId.`value`='502^^^&1.3.6.1.4.1.21367.2005.13.20.1000&ISO'
-- 12根据病人ID查找目录
select fol.id from registrypackage fol
,externalidentifier patId
,classification c
where fol.id=patId.registryObject
and fol.id=c.classifiedObject
-- 仅选择 XDSFolder 对象,见表 classificationnode
and c.classificationNode='urn:uuid:d9d542f3-6cc4-48b6-8870-ea235fbc94c2'
-- 仅关联 XDSFolder.patientId 类型,identificationScheme 见表 classscheme
and patId.identificationScheme='urn:uuid:f64ffdf0-4b97-4e06-b79f-a52b38ec2f8a'
and patId.`value`='502^^^&1.3.6.1.4.1.21367.2005.13.20.1000&ISO'
-- 13根据目录查找文档
select patId.`value` patientId, doc.id uuid, docId.`value` oid,doc.`status`,doc.mimeType
from extrinsicobject doc
,externalidentifier patId
,externalidentifier docId
,association asso
-- 仅选择 XDSDocumentEntry 对象,objectType见表 classificationnode
where doc.objectType='urn:uuid:7edca82f-054d-47f2-a032-9b2a5b5186c1'
-- 仅关联 XDSDocumentEntry.patientId 类型,identificationScheme 见表 classscheme
and patId.identificationScheme='urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427'
-- 仅关联 XDSDocumentEntry.uniqueId 类型,identificationScheme 见表 classscheme
and docId.identificationScheme='urn:uuid:2e82c1f6-a085-4c72-9da3-8640a32e42ab'
and doc.id=patId.registryObject and doc.id=docId.registryObject
and asso.targetObject=doc.id
and asso.sourceObject='urn:uuid:46f303ae-7eaa-426d-8e5a-ceecc757d6b4'
-- 14根据病人ID查找文档
select doc.id uuid,doc.`status`,doc.mimeType
from extrinsicobject doc
,externalidentifier ext
-- 仅选择 XDSDocumentEntry 对象,objectType见表 classificationnode
where doc.objectType='urn:uuid:7edca82f-054d-47f2-a032-9b2a5b5186c1'
-- 仅关联 XDSDocumentEntry.patientId 类型,identificationScheme 见表 classscheme
and ext.identificationScheme='urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427'
-- 表关联取文档的OID
and doc.id=ext.registryObject
and ext.`value`='502^^^&1.3.6.1.4.1.21367.2005.13.20.1000&ISO'
-- 15根据病人ID查找文档(包括文档的 oid)
select doc.id uuid, docId.`value` oid,doc.`status`,doc.mimeType
from extrinsicobject doc
,externalidentifier patId
,externalidentifier docId
-- 仅选择 XDSDocumentEntry 对象,objectType见表 classificationnode
where doc.objectType='urn:uuid:7edca82f-054d-47f2-a032-9b2a5b5186c1'
-- 仅关联 XDSDocumentEntry.patientId 类型,identificationScheme 见表 classscheme
and patId.identificationScheme='urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427'
-- 仅关联 XDSDocumentEntry.uniqueId 类型,identificationScheme 见表 classscheme
and docId.identificationScheme='urn:uuid:2e82c1f6-a085-4c72-9da3-8640a32e42ab'
and doc.id=patId.registryObject and doc.id=docId.registryObject
and patId.`value`='502^^^&1.3.6.1.4.1.21367.2005.13.20.1000&ISO'
-- 16统计病人文档数量
select
patId.`value` patientId, count(1) doc_qty
from extrinsicobject doc
,externalidentifier patId
-- 仅选择XDSDocumentEntry 对象,objectType见表 classificationnode
where doc.objectType='urn:uuid:7edca82f-054d-47f2-a032-9b2a5b5186c1'
-- 表关联
and doc.id=patId.registryObject
-- 仅关联PatientId 类型,identificationScheme 见表 classscheme
and patId.identificationScheme='urn:uuid:58a6f841-87b3-4a3e-92fd-a8ffeff98427'
group by patId.`value`
+++++SQL 查询+++++
+++++难点分析说明(关联存储部分)+++++
ebxml与xdsObject对应关系
xdsObject包含四种冠新:文件夹和文档,提交集和文档,提交集和文件夹,提交集和(文件夹和文档)的关系
用来描述一个文档在一个文件夹下
registerPackage 表:
780 submitset
d43 folder
extrinsicobject 表:
0b8 XDSDocumentEntry Object
association 表:
786 用来将文档与文件夹之间的关系与 submitset 关联起来的记录
urn:uuid:bdab09a6-327b-4d21-9a8d-d56e3c6ee786
Association①表达的信息是文件对象属于该文件夹,Association①的sourceObject和targetObject分别是XDSFolder object和XDSDocumentEntry object;
第二个Association②将第一个Association与提交集对象联系在一起。Association②的targetObject是Association①的id,sourceObject是XDSSubmissionSet object的id。这两个Association的关联类型都是上面的第一种:urn:oasis:names:tc:ebxml-regrep:AssociationType:HasMember
文件夹和xdsdocumententry的关系,红色框中一样
+++++难点分析说明(关联存储部分)+++++
+++++xds.b预测试相关SQL+++++
链接: https://pan.baidu.com/s/10idm4PnuRCWYLJbKtVLW7Q 密码: btab
+++++xds.b预测试相关SQL+++++
注:难点分析说明(关联存储部分)部分由山西智杰王计帅提供,非常感谢,原文地址:
https://note.youdao.com/share/index.html?id=4c2ed3ac300d845d7d033c9cb5b294e0&type=note#/