Newer Delphi releases that support .NET are able to utilize .NET assemblies to parse and generate CDA documents. But what about older but still popular D6/D7? I've spent some time to experiment with Delphi Data Binding XML wizard. Results are the following (D7):

1.Data Binding Wizard crashes with stack overflow on processing composite CDA XML Schema. The workaround is to merge multiple xsd files into single one and restart the wizard.

2.Automatically generated .pas file contains ~50 errors that are related to poorly designed CDA XSD types. Fortunately, they are easy to correct (or simply comment).

3.Classes generated by Data Binding Wizard use the "lazy intitialization" pattern to avoid null reference problems. That means that new elements will be added to in-memory document on first call even if they are not present in the original XML document. That can accidentally tamper your CDA

4.XML serializer does not respect element order defined in the CDA XML schemas.

I think that Delphi stuff is scarcely useful either to read or to create CDAs in production. Only if there are no alternatives...

Download CDA unit and XML schema for Delphi 7

Last edited Mar 12, 2014 at 8:50 PM by dmitryab, version 4

Comments

No comments yet.