虽然预定义的 DICOM PS3.15 隐私档案涵盖了许多使用案例,医疗保健机构往往具有独特的个人信息要求. 在此指南中,您将学习如何设计自定義的DICO 匿名化档文件** 与您的组织的具体政策相匹配。
内容表
為什麼需要自定義檔案
预先定义的隐私档案提供了一个坚实的基础,但它们可能不满足所有机构要求. 您可能需要定制的个人资料,当您的组织需要保留特定的机构识别,以便内部可追踪,同时仍然匿名化患者数据。 一些研究合作可能会需要某些人口记录保存,而同时删除直接认证。
自定义的个人资料为您提供了对哪些DICOM标签进行更改的准确控制,以及如何,使您能够遵守具体的数据管理政策。
了解标签模式和行动
DICOM 标签以格式(GGGG、EEEE)的组和元素号码识别。 例如,患者名称为(0010,0010)和患者身份证是(010.0020)。 个性化配置表格指定符合这些标志和行动的模式。
可用的操作包括 **D(删除)**将标签完全从数据集中移除, **Z(零)****将值取代为空或零长度值; **X(取消)***将现有类似于削除的标记移除了, *K(保持)*将原始值保持不变; C(清洁),通过背景识别信息的提取清除该值,以及 **U(用 UID 替代),以新创建的独特标识器替换。
选择正确的行动取决于您的使用情况. 使用 D 或 X 标签永远不会出现在匿名输出中. 有 Z 时必须存在,但应该是空的。
创建自定义个人资料
可定义的个人资料可分为三种格式,选择最适合您的工作流的。
CSV 格式
CSV 是最简单的格式,理想的简单配置:
TagPattern;Action
(0010,0010);Z
(0010,0020);Z
(0010,0030);X
(0010,0040);K
(0020,000D);U
(0020,000E);U
(0008,0018);U
(0008,0080);D
(0008,0081);D
(0008,1030);C
(0008,103E);C
(0010,1010);K
(0010,1030);K
该个人资料清除病人名称和身份证,删除出生日期,保留病人的性别和人口,取代所有 UID 信息,移除机构信息并清理描述。
JSON 格式
JSON 提供更好的结构,以便复杂的代数据配置:
{
"profileName": "Hospital Research Profile",
"version": "1.0",
"description": "Custom profile for research data sharing",
"actions": [
{ "TagPattern": "(0010,0010)", "Action": "Z", "Comment": "Patient Name" },
{ "TagPattern": "(0010,0020)", "Action": "Z", "Comment": "Patient ID" },
{ "TagPattern": "(0010,0030)", "Action": "X", "Comment": "Birth Date" },
{ "TagPattern": "(0010,0040)", "Action": "K", "Comment": "Patient Sex" },
{ "TagPattern": "(0020,000D)", "Action": "U", "Comment": "Study Instance UID" },
{ "TagPattern": "(0020,000E)", "Action": "U", "Comment": "Series Instance UID" },
{ "TagPattern": "(0008,0018)", "Action": "U", "Comment": "SOP Instance UID" },
{ "TagPattern": "(0008,0080)", "Action": "D", "Comment": "Institution Name" },
{ "TagPattern": "(0008,0081)", "Action": "D", "Comment": "Institution Address" },
{ "TagPattern": "(0008,1030)", "Action": "C", "Comment": "Study Description" }
]
}
XML 格式
XML 优先用于现有 XML 工具的环境:
<?xml version="1.0" encoding="utf-8"?>
<ConfidentialityProfile name="Hospital Research Profile" version="1.0">
<Description>Custom profile for research data sharing</Description>
<TagActions>
<TagAction TagPattern="(0010,0010)" Action="Z">Patient Name</TagAction>
<TagAction TagPattern="(0010,0020)" Action="Z">Patient ID</TagAction>
<TagAction TagPattern="(0010,0030)" Action="X">Birth Date</TagAction>
<TagAction TagPattern="(0010,0040)" Action="K">Patient Sex</TagAction>
<TagAction TagPattern="(0020,000D)" Action="U">Study Instance UID</TagAction>
<TagAction TagPattern="(0020,000E)" Action="U">Series Instance UID</TagAction>
<TagAction TagPattern="(0008,0018)" Action="U">SOP Instance UID</TagAction>
<TagAction TagPattern="(0008,0080)" Action="D">Institution Name</TagAction>
<TagAction TagPattern="(0008,0081)" Action="D">Institution Address</TagAction>
<TagAction TagPattern="(0008,1030)" Action="C">Study Description</TagAction>
</TagActions>
</ConfidentialityProfile>
在代码中加载自定义个人资料
在您的 .NET 应用程序中加载自定义的个人资料是简单的:
using Aspose.Medical.Dicom;
using Aspose.Medical.Dicom.Anonymization;
// Load from CSV
ConfidentialityProfile csvProfile = ConfidentialityProfile.LoadFromCsvFile(
"profiles/hospital_research.csv",
ConfidentialityProfileOptions.All
);
// Load from JSON
ConfidentialityProfile jsonProfile = ConfidentialityProfile.LoadFromJsonFile(
"profiles/hospital_research.json",
ConfidentialityProfileOptions.All
);
// Load from XML
ConfidentialityProfile xmlProfile = ConfidentialityProfile.LoadFromXmlFile(
"profiles/hospital_research.xml",
ConfidentialityProfileOptions.All
);
// Create anonymizer with custom profile
Anonymizer anonymizer = new(csvProfile);
// Anonymize files
DicomFile dcm = DicomFile.Open("patient_study.dcm");
DicomFile anonymizedDcm = anonymizer.Anonymize(dcm);
anonymizedDcm.Save("anonymized_study.dcm");
Console.WriteLine("Anonymization completed with custom profile!");
现实世界剧本的例子(#real world-scenario-examples)
步骤1:内部质量保证
保留机构和设备信息进行内部跟踪,同时匿名化患者数据:
TagPattern;Action
(0010,0010);Z
(0010,0020);Z
(0010,0030);X
(0008,0080);K
(0008,0081);K
(0008,1010);K
(0008,1090);K
(0018,1000);K
场景2:外部研究合作
人口研究的最大匿名化与维持人口统计:
TagPattern;Action
(0010,0010);X
(0010,0020);X
(0010,0030);X
(0010,0040);K
(0010,1010);K
(0010,1020);K
(0010,1030);K
(0020,000D);U
(0020,000E);U
(0008,0018);U
(0008,0080);X
(0008,0081);X
(0008,1030);X
(0008,103E);X
场景3:多网站研究协调
取代 UID 同时保持数据链接的研究关系:
TagPattern;Action
(0010,0010);Z
(0010,0020);Z
(0020,000D);U
(0020,000E);U
(0008,0018);U
(0008,0016);K
(0020,0010);K
(0020,0011);K
(0020,0013);K
验证和测试
在生产部署之前,始终验证自定义的个人资料:
using Aspose.Medical.Dicom;
using Aspose.Medical.Dicom.Anonymization;
string profilePath = "profiles/custom_profile.csv";
string testDataFolder = "test_samples";
string outputFolder = "validation_output";
// Load custom profile
ConfidentialityProfile profile = ConfidentialityProfile.LoadFromCsvFile(
profilePath,
ConfidentialityProfileOptions.All
);
Anonymizer anonymizer = new(profile);
Directory.CreateDirectory(outputFolder);
// Process test files
string[] testFiles = Directory.GetFiles(testDataFolder, "*.dcm");
int successCount = 0;
int failCount = 0;
foreach (string filePath in testFiles)
{
try
{
DicomFile dcm = DicomFile.Open(filePath);
DicomFile anonymized = anonymizer.Anonymize(dcm);
string outputPath = Path.Combine(outputFolder, Path.GetFileName(filePath));
anonymized.Save(outputPath);
Console.WriteLine($"✓ {Path.GetFileName(filePath)}");
successCount++;
}
catch (Exception ex)
{
Console.WriteLine($"✗ {Path.GetFileName(filePath)}: {ex.Message}");
failCount++;
}
}
Console.WriteLine($"\nValidation Summary:");
Console.WriteLine($" Succeeded: {successCount}");
Console.WriteLine($" Failed: {failCount}");
Console.WriteLine($"\nReview output files in: {outputFolder}");
经过验证后,在 DICOM 浏览器中打开匿名文件并确认预期的标签被正确修改,保存的标记被保存, UID 被适当更换,并且没有敏感数据留在清洁的字段。
《结论》
自定义的隐私资料为您提供灵活性,以实施与您的机构的个人信息政策准确相匹配的DICOM匿名化,无论您需要保留内部使用的具体识别资料,保存人口资料进行研究,或者适用于外部共享的最大匿名的资料。
关键建议包括文档您的个人资料选项用于审计目的,版本控制文件来跟踪变更,在生产使用前仔细测试资料,并定期审查资料的需求不断发展。
有关 DICOM 匿名化和 Aspose.Medical API 的更多信息,请访问 人们在说什么. 常见的个人资料场景模板可在示例部分中找到。