CDA Validation
The CDA Validation component is used as an example component for validating CCDA documents and parsing the validation results (via the CDAVALIDATOR Library) This is useful for ensuring documents you've created are compliant with HL7 CCDA specifications, whether during the development process or as part of your integration workflow. It identifies all the CCDA Schema errors, Shall errors, and Should errors present in the validated CCDA.
Running the Component
The CDAVALIDATOR library uses third party utilities (xsltproc and xmllint) to validate the CCDA document. These are included in the library for Windows. For MacOS and Linux, the component will indicate on start up if they are missing and require manual installation.
STEP 1: Import the CDA Validator component
Using +COMPONENT, import the CDA Validation
STEP 2: Optionally, create a CDA document to validate using the CDA Creator component
If you don't have an existing CCDA document that needs validating, you can create a sample document using the CDA Creator .
STEP 3: Specify the CCDA file to validate and the version it should be validated against
Set a target CCDA via the CCDAFilepath custom field to specify where the CCDA that will be validated is stored. Specify the CCDAversion that the component should use for validation.
STEP 4: Start the component and view the generated CDA
On starting, if successful, the component will display a validation success message:
If unsuccessful, the component will error out and log the details of the failed validation:
By default, the component outputs all Schema and Shall errors. You can also edit the script to adjust the mode to include Should errors by going to the parseValidationResults function and changing the mode to 2 as shown below: