๐ฎ Validation of MS files
Why ?โ
- Check if XML files are valid KMEHR files ?
- Check if XML files are valid Medication scheme ?
info
This project does it on each git change :
( Source code )
Prerequisitesโ
- Vitalink Schematron
- Local XSDs of the KMEHR version you would like to use (e.g
1.40.2
) - xslt3, a Node.JS command-line tool you can install
- XMLLint, which is an Open Source tool you can download on your platform :
- Debian based Linux
- RHEL based Linux (such as CentOS)
- MacOS
- Windows
sudo apt-get update -qq
sudo apt-get install -y libxml2-utils
sudo yum update -qq
sudo yum install -y xmlstarlet
# Should be built in to MacOS, but in case of :
brew install libxml2
# Use "Chocolatey" package manager (https://community.chocolatey.org/)
choco install xsltproc
Stepsโ
- Unzip your KMEHR XSD file
- Check if XML file is valid KMEHR file, by running a command similar to this one :
xmllint --catalogs --noout --schema ./xsd-kmehr/ehealth-kmehr/XSD/kmehr_elements-1_40.xsd ./path/to/your/file/test-MS.xml
- If it is valid, you will receive a status 0 of this command. Otherwise, you have an error somewhere ...
- Check if XML file is valid Medication scheme, by running a command similar to this one :
npx xslt3 "-s:path/to/your/file/test-MS.xml" "-xsl:medicationscheme-validation-v2.xslt"
info
This project had automated the validation and parsing of errors within a script