fhirsmith 0.8.2 → 0.8.4
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/CHANGELOG.md +41 -0
- package/README.md +4 -4
- package/package.json +1 -1
- package/packages/package-crawler.js +1 -1
- package/publisher/publisher.js +257 -218
- package/root-bare-template.html +0 -3
- package/server.js +27 -22
- package/shl/readme.md +27 -0
- package/shl/shl.js +2 -8
- package/tx/cs/cs-api.js +19 -4
- package/tx/cs/cs-base.js +13 -0
- package/tx/cs/cs-snomed.js +64 -3
- package/tx/library/codesystem.js +20 -0
- package/tx/library/designations.js +37 -1
- package/tx/provider.js +30 -0
- package/tx/workers/expand.js +19 -12
- package/tx/workers/lookup.js +19 -3
- package/tx/workers/worker.js +8 -2
- package/tx/xversion/xv-codesystem.js +3 -3
- package/tx/xversion/xv-parameters.js +2 -2
- package/tx/xversion/xv-valueset.js +1 -2
package/tx/workers/worker.js
CHANGED
|
@@ -252,6 +252,7 @@ class TerminologyWorker {
|
|
|
252
252
|
loadSupplements(url, version = '', statedSupplements) {
|
|
253
253
|
const supplements = [];
|
|
254
254
|
|
|
255
|
+
supplements.push(...this.provider.loadSupplements(url, version, statedSupplements));
|
|
255
256
|
// todo: look in provider for supplements
|
|
256
257
|
|
|
257
258
|
if (!this.additionalResources) {
|
|
@@ -306,7 +307,7 @@ class TerminologyWorker {
|
|
|
306
307
|
* @param {CodeSystemProvider} cs - Code system provider
|
|
307
308
|
* @param {Object} src - Source element (for extensions)
|
|
308
309
|
*/
|
|
309
|
-
checkSupplements(cs, src, requiredSupplements, usedSupplements = null) {
|
|
310
|
+
checkSupplements(cs, src, requiredSupplements, usedSupplements = null, reportedSupplements = null) {
|
|
310
311
|
// Check for required supplements in extensions
|
|
311
312
|
if (src && src.extension) {
|
|
312
313
|
const supplementExtensions = src.extension.filter(x => x.url == 'http://hl7.org/fhir/StructureDefinition/valueset-supplement');
|
|
@@ -318,7 +319,12 @@ class TerminologyWorker {
|
|
|
318
319
|
}
|
|
319
320
|
}
|
|
320
321
|
|
|
321
|
-
|
|
322
|
+
if (reportedSupplements) {
|
|
323
|
+
for (let s of cs.listSupplements(true)) {
|
|
324
|
+
reportedSupplements.add(s);
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
// Note required supplements that are satisfied - and might be version independent
|
|
322
328
|
if (usedSupplements) {
|
|
323
329
|
for (const s of requiredSupplements) {
|
|
324
330
|
if (cs.hasSupplement(s)) {
|
|
@@ -9,11 +9,11 @@ const {VersionUtilities} = require("../../library/version-utilities");
|
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
function codeSystemToR5(jsonObj, version) {
|
|
12
|
-
if (version
|
|
12
|
+
if (VersionUtilities.isR5Ver(version)) {
|
|
13
13
|
return jsonObj; // Already R5, no conversion needed
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
if (version
|
|
16
|
+
if (VersionUtilities.isR3Ver(version)) {
|
|
17
17
|
// R3 to R5: Convert identifier from single object to array
|
|
18
18
|
if (jsonObj.identifier && !Array.isArray(jsonObj.identifier)) {
|
|
19
19
|
jsonObj.identifier = [jsonObj.identifier];
|
|
@@ -21,7 +21,7 @@ function codeSystemToR5(jsonObj, version) {
|
|
|
21
21
|
return jsonObj;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
if (version
|
|
24
|
+
if (VersionUtilities.isR4Ver(version)) {
|
|
25
25
|
// R4 to R5: identifier is already an array, no conversion needed
|
|
26
26
|
return jsonObj;
|
|
27
27
|
}
|
|
@@ -17,10 +17,10 @@ function parametersToR5(jsonObj, sourceVersion) {
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
const {
|
|
20
|
+
const {convertResourceToR5} = require("./xv-resource");
|
|
21
21
|
for (let p of jsonObj.parameter) {
|
|
22
22
|
if (p.resource) {
|
|
23
|
-
p.resource =
|
|
23
|
+
p.resource = convertResourceToR5(p.resource, sourceVersion);
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
26
|
return jsonObj;
|
|
@@ -203,8 +203,7 @@ function convertContainsPropertyR5ToR4(containsList) {
|
|
|
203
203
|
*/
|
|
204
204
|
function isR5OnlyFilterOperator(operator) {
|
|
205
205
|
const r5OnlyOperators = [
|
|
206
|
-
'
|
|
207
|
-
// Add other R5-only operators as they're identified
|
|
206
|
+
'child-of', ' descendent-leaf' // Added in R5
|
|
208
207
|
];
|
|
209
208
|
return r5OnlyOperators.includes(operator);
|
|
210
209
|
}
|