CCD validation with xmllint and cda.xsd

316 Views Asked by At

When I run xmllint -schema c:\temp\CDASchemas\cda\Schemas\CDA.xsd testee_test_original.xml --noout it tells me "testee_test_original.xml validates".

Okay, great.

However I then deleted the entire <patient> element and ran it again. "testee_test_original.xml validates"

Why is this? I thought this was the point in the XSD. If not, what else do I need to actually validate that a CCD is not only well formatted, but has all the required data as per the standards?

1

There are 1 best solutions below

0
Marti Pàmies Solà On

I guess you have removed the patient element, but not the PatientRole neither the recordTarget (which are mandatory). At a CDA, patient information is located inside recordTarget (which is a mandatory element), an inside it, at PatientRole.

Although as you suggest, patient name should be mandatory, it is not. I do not why, but may this is, because should be interesting in situations where just the patients identifiers (which are mandatory elements of PatientRole) can be provided, but not full name.

Hope that useful. Martí