Reputation: 472
I have two issues regarding the generation of CCD messages for cancer registries. I already have a CCD class, generated from a CCD XML schema (XSD).
First, this is an older schema. It seems to be completely compatible, but I'd like to be able to generate a new class based on the most current CDA schema. Whenever I use the class generated from the new schema and replace the original class, an exception is thrown at
serializer.Serialize(textWriterObj, cdaObj);
I'm using MS's XSD.exe to produce the class. I'm running VS 2012, and the XSD.exe version seems to be specific to .Net Framework 4.0, but the project I'm working on is stuck in 2.0. The generated classes are basically identical, besides a tag stating it was produced in a FW 4.0 version of XSD.exe.
The other issue is the set of errors I get after producing the message and validating it with the official muCrValidation tool.
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"]
This is a strange error, because I've compensated for this, and the correct fields appear the message output. Notice it wants a specific template ID for the Act, an EntryRelationship under the Act, which has a specific TypeCode and InversionInd value, along with another template ID under the EntryRelationship.
I compensate for this in message building class.
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";
I've been able to knock off a majority of the errors (and sections of errors), but this sort remains. I'd list the rest, but I'm out of characters. I assume if I can fix this one, I can fix the rest fairly easily.
Upvotes: 0
Views: 1439
Reputation: 196
Have you looked at Everest (http://everest.marc-hi.ca)? It is a more generic HL7v3 framework but it is capable of constructing CDA instances. It also has some nicer features like treating the CDA data types like native .NET data types:
ClinicalDocument doc = new ClinicalDocument();
doc.Title = "My CDA";
doc.EffectiveTime = DateTime.Now;
There's also a comprehensive eBook which covers lots of topics related to using the framework (mostly applicable to v3 messages but it does apply to CDA as well). http://www.lulu.com/shop/justin-fyfe/advanced-everest-developers-handbook-ebook/ebook/product-21278619.html
Upvotes: 2
Reputation: 371
Have you set default namespace for XmlSerializer?
XmlSerializer ser = new XmlSerializer(typeof(POCD_MT000040ClinicalDocument), "urn:hl7-org:v3");
Upvotes: 0