cda-schematron-validator 1.0.9 → 1.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/package.json +1 -1
- package/validator.js +15 -3
- package/debug.log +0 -1
package/README.md
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
# [cda-schematron-validator](https://github.com/priyaranjan-tokachichu/cda-schematron-validator)
|
|
2
2
|
## Release History
|
|
3
3
|
Starting release history with 1.0.7
|
|
4
|
+
### 1.0.10
|
|
5
|
+
- Fix null context issue associated with assertions within assertions
|
|
6
|
+
- Skip abstract rules associated with assertions within assertions
|
|
4
7
|
### 1.0.9
|
|
5
8
|
- Fixed the bug introduced in 1.0.8 trying to adjust to different data types of the return value
|
|
6
9
|
- Changed variable names to improve understanding of the process
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cda-schematron-validator",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "Fork of Eric Wadkins' javascript implementation of schematron testing for C-CDA XML documents. This includes bug fixes and some house keeping.",
|
|
5
5
|
"main": "validator.js",
|
|
6
6
|
"scripts": {
|
package/validator.js
CHANGED
|
@@ -101,7 +101,7 @@ function validate(xml, schematron, options = {}) {
|
|
|
101
101
|
const ruleObject = ruleAssertionMap[ruleId];
|
|
102
102
|
if (_get(ruleObject, 'abstract')) {
|
|
103
103
|
continue;
|
|
104
|
-
}
|
|
104
|
+
}
|
|
105
105
|
const context = _get(ruleObject, 'context');
|
|
106
106
|
const assertionsAndExtensions = _get(ruleObject, 'assertionsAndExtensions') || [];
|
|
107
107
|
let failedAssertions = checkRule(xmlDoc, context, assertionsAndExtensions, options);
|
|
@@ -232,8 +232,14 @@ function checkRule(xmlDoc, originalContext, assertionsAndExtensions, options) {
|
|
|
232
232
|
if (!subAssertionsAndExtensions) {
|
|
233
233
|
continue;
|
|
234
234
|
}
|
|
235
|
-
const newRuleObject = ruleAssertionMap[extensionRule];
|
|
235
|
+
const newRuleObject = ruleAssertionMap[extensionRule];
|
|
236
|
+
if (_get(newRuleObject, 'abstract')) {
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
236
239
|
const newContext = newRuleObject.context;
|
|
240
|
+
if (!newContext) {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
237
243
|
const failedSubAssertions = checkRule(xmlDoc, newContext, subAssertionsAndExtensions, options);
|
|
238
244
|
failedAssertions.push(...failedSubAssertions);
|
|
239
245
|
}
|
|
@@ -455,8 +461,14 @@ function checkRulePromise(xmlDoc, originalContext, assertionsAndExtensions, opti
|
|
|
455
461
|
if (!subAssertionsAndExtensions) {
|
|
456
462
|
continue;
|
|
457
463
|
}
|
|
458
|
-
const newRuleObject = ruleAssertionMap[extensionRule];
|
|
464
|
+
const newRuleObject = ruleAssertionMap[extensionRule];
|
|
465
|
+
if (_get(newRuleObject, 'abstract')) {
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
459
468
|
const newContext = newRuleObject.context;
|
|
469
|
+
if (!newContext) {
|
|
470
|
+
continue;
|
|
471
|
+
}
|
|
460
472
|
const failedSubAssertions = checkRule(xmlDoc, newContext, subAssertionsAndExtensions, options);
|
|
461
473
|
failedAssertions.push(...failedSubAssertions);
|
|
462
474
|
}
|
package/debug.log
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
[0404/083636.694:ERROR:registration_protocol_win.cc(102)] CreateFile: The system cannot find the file specified. (0x2)
|