【发布时间】:2023-03-05 18:45:02
【问题描述】:
关于为癌症登记处生成 CCD 消息,我有两个问题。我已经有一个 CCD 类,由 CCD XML 模式 (XSD) 生成。
首先,这是一个较旧的架构。它似乎完全兼容,但我希望能够基于最新的 CDA 模式生成一个新类。每当我使用从新架构生成的类并替换原始类时,都会引发异常
serializer.Serialize(textWriterObj, cdaObj);
我正在使用 MS 的 XSD.exe 来生成课程。我正在运行 VS 2012,XSD.exe 版本似乎特定于 .Net Framework 4.0,但我正在处理的项目卡在 2.0 中。生成的类基本相同,除了一个标签说明它是在 FW 4.0 版本的 XSD.exe 中生成的。
另一个问题是我在生成消息并使用官方 muCrValidation 工具对其进行验证后遇到的一组错误。
ERROR: In IHE PCC Cancer Diagnosis Section (1.3.6.1.4.1.19376.1.7.3.1.3.14.1), a Cancer Diagnosis must contain a Problem Concern Entry (1.3.6.1.4.1.19376.1.5.3.1.4.5.2) that contains a Cancer Diagnosis Entry (1.3.6.1.4.1.19376.1.7.3.1.4.14.1). See Section 2.5.3.2.
LOCATION: /ClinicalDocument[1]/component[1]/structuredBody[1]/component[1]/section[1]
TEST : cda:entry/cda:act[cda:templateId[@root = "1.3.6.1.4.1.19376.1.5.3.1.4.5.2"]]//cda:entryRelationship[@typeCode="SUBJ" and @inversionInd="false"]//cda:templateId[@root = "1.3.6.1.4.1.19376.1.7.3.1.4.14.1"]
这是一个奇怪的错误,因为我已经对此进行了补偿,并且正确的字段会出现在消息输出中。请注意,它需要 Act 的特定模板 ID,Act 下的 EntryRelationship,它具有特定的 TypeCode 和 InversionInd 值,以及 EntryRelationship 下的另一个模板 ID。
我在消息构建类中对此进行了补偿。
act.templateId = new II[3];
for (int i = 0; i < act.templateId.Length; i++)
act.templateId[i] = new II();
act.templateId[0].root = "1.3.6.1.4.1.19376.1.5.3.1.4.5.2";
act.templateId[1].root = "1.3.6.1.4.1.19376.1.5.3.1.4.5.1";
act.templateId[2].root = "2.16.840.1.113883.10.20.1.27";
...
act.entryRelationship[0].typeCode = x_ActRelationshipEntryRelationship.SUBJ;
act.entryRelationship[0].inversionInd = false;
act.entryRelationship[0].templateId = new II[1];
act.entryRelationship[0].templateId[0] = new II();
act.entryRelationship[0].templateId[0].root = @"1.3.6.1.4.1.19376.1.7.3.1.4.14.1";
我已经能够消除大部分错误(和部分错误),但这种错误仍然存在。我会列出其余的,但我没有字符。我想如果我能解决这个问题,我可以很容易地解决剩下的问题。
【问题讨论】:
-
你看过 NHAPI 吗? nhapi.sourceforge.net/home.php
-
@John Hartsock NHAPI 只为 HL7 v 2.x (ASCII) 生成消息。 CDA (XML) 和 HL7 v 3.x 是同义词。
标签: c# xml-serialization hl7 hl7-cda hl7-v3