You can import this library to validate your CCDA files. To get started, import this CDAVALIDATOR library into your component:
require "CDAVALIDATOR.CDAVALIDATORinit"
After that, initialize the validation object outside the main function:
local CV = CDAVALIDATORinit{ CCDAversion = "R2_1", reload = false -- optionally set to true to refresh the CDA resources }
This loads the specified CCDA version's resources into a CCDA folder that is automatically created in the working directory. These resources will be used by the library to validate the CCDA. Currently the library supports validating versions R1.1, R2, and R2.1. If a different version is desired, the reload
parameter should be set to true to initiate the resource reload process.
Once the CDAVALIDATOR object has been created, the target CCDA can be validated by calling these functions:
validateCCDA
- validates the CCDA at a given filepath and writes the results to two files in the CCDA directory: cda_err.svrl and xsd_errparseValidationResults
- parses the generated validation files and returnstrue
if the file passed validation