fhirsmith 0.6.0 → 0.7.1
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 +36 -0
- package/README.md +15 -4
- package/configurations/projector.json +21 -0
- package/configurations/readme.md +6 -0
- package/library/package-manager.js +0 -2
- package/library/version-utilities.js +85 -0
- package/package.json +1 -1
- package/packages/package-crawler.js +44 -9
- package/packages/packages.js +1 -0
- package/registry/crawler.js +35 -14
- package/registry/registry.js +3 -0
- package/server.js +4 -0
- package/tx/README.md +4 -4
- package/tx/cs/cs-loinc.js +5 -2
- package/tx/cs/cs-provider-api.js +25 -1
- package/tx/cs/cs-provider-list.js +2 -2
- package/tx/html/conceptmap-operations.liquid +19 -0
- package/tx/library/canonical-resource.js +6 -1
- package/tx/library/renderer.js +571 -2
- package/tx/library.js +127 -10
- package/tx/ocl/README.md +236 -0
- package/tx/ocl/cache/cache-paths.cjs +32 -0
- package/tx/ocl/cache/cache-paths.js +2 -0
- package/tx/ocl/cache/cache-utils.cjs +43 -0
- package/tx/ocl/cache/cache-utils.js +2 -0
- package/tx/ocl/cm-ocl.cjs +531 -0
- package/tx/ocl/cm-ocl.js +1 -105
- package/tx/ocl/cs-ocl.cjs +1779 -0
- package/tx/ocl/cs-ocl.js +1 -38
- package/tx/ocl/fingerprint/fingerprint.cjs +67 -0
- package/tx/ocl/fingerprint/fingerprint.js +2 -0
- package/tx/ocl/http/client.cjs +31 -0
- package/tx/ocl/http/client.js +2 -0
- package/tx/ocl/http/pagination.cjs +98 -0
- package/tx/ocl/http/pagination.js +2 -0
- package/tx/ocl/jobs/background-queue.cjs +200 -0
- package/tx/ocl/jobs/background-queue.js +2 -0
- package/tx/ocl/mappers/concept-mapper.cjs +66 -0
- package/tx/ocl/mappers/concept-mapper.js +2 -0
- package/tx/ocl/model/concept-filter-context.cjs +51 -0
- package/tx/ocl/model/concept-filter-context.js +2 -0
- package/tx/ocl/shared/constants.cjs +15 -0
- package/tx/ocl/shared/constants.js +2 -0
- package/tx/ocl/shared/patches.cjs +224 -0
- package/tx/ocl/shared/patches.js +2 -0
- package/tx/ocl/vs-ocl.cjs +1848 -0
- package/tx/ocl/vs-ocl.js +1 -104
- package/tx/operation-context.js +8 -1
- package/tx/params.js +24 -3
- package/tx/provider.js +47 -0
- package/tx/tx-html.js +49 -4
- package/tx/tx.js +8 -0
- package/tx/vs/vs-vsac.js +4 -3
- package/tx/workers/batch-validate.js +3 -2
- package/tx/workers/batch.js +3 -2
- package/tx/workers/expand.js +64 -9
- package/tx/workers/lookup.js +5 -4
- package/tx/workers/read.js +25 -9
- package/tx/workers/related.js +3 -2
- package/tx/workers/search.js +40 -10
- package/tx/workers/subsumes.js +3 -2
- package/tx/workers/translate.js +4 -3
- package/tx/workers/validate.js +143 -46
- package/tx/workers/worker.js +1 -7
package/tx/README.md
CHANGED
|
@@ -33,22 +33,22 @@ Add the `tx` section to your `config.json`:
|
|
|
33
33
|
"endpoints": [
|
|
34
34
|
{
|
|
35
35
|
"path": "/tx/r5",
|
|
36
|
-
"fhirVersion": 5,
|
|
36
|
+
"fhirVersion": "5.0",
|
|
37
37
|
"context": null
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
"path": "/tx/r4",
|
|
41
|
-
"fhirVersion": 4,
|
|
41
|
+
"fhirVersion": "4.0",
|
|
42
42
|
"context": null
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
"path": "/tx/r3",
|
|
46
|
-
"fhirVersion": 3,
|
|
46
|
+
"fhirVersion": "3.0",
|
|
47
47
|
"context": null
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
"path": "/tx/r4/demo",
|
|
51
|
-
"fhirVersion": 4,
|
|
51
|
+
"fhirVersion": "4.0",
|
|
52
52
|
"context": "demo"
|
|
53
53
|
}
|
|
54
54
|
]
|
package/tx/cs/cs-loinc.js
CHANGED
|
@@ -203,9 +203,12 @@ class LoincServices extends BaseCSServices {
|
|
|
203
203
|
// Use language-aware display logic
|
|
204
204
|
if (this.opContext.langs && !this.opContext.langs.isEnglishOrNothing()) {
|
|
205
205
|
const displays = await this.#getDisplaysForContext(ctxt, this.opContext.langs);
|
|
206
|
+
const requestedLanguages = Array.isArray(this.opContext.langs.languages)
|
|
207
|
+
? this.opContext.langs.languages
|
|
208
|
+
: (Array.isArray(this.opContext.langs.langs) ? this.opContext.langs.langs : []);
|
|
206
209
|
|
|
207
210
|
// Try to find exact language match
|
|
208
|
-
for (const lang of
|
|
211
|
+
for (const lang of requestedLanguages) {
|
|
209
212
|
for (const display of displays) {
|
|
210
213
|
if (lang.matches(display.language, true)) {
|
|
211
214
|
return display.value;
|
|
@@ -214,7 +217,7 @@ class LoincServices extends BaseCSServices {
|
|
|
214
217
|
}
|
|
215
218
|
|
|
216
219
|
// Try partial language match
|
|
217
|
-
for (const lang of
|
|
220
|
+
for (const lang of requestedLanguages) {
|
|
218
221
|
for (const display of displays) {
|
|
219
222
|
if (lang.matches(display.language, false)) {
|
|
220
223
|
return display.value;
|
package/tx/cs/cs-provider-api.js
CHANGED
|
@@ -20,7 +20,13 @@ class AbstractCodeSystemProvider {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
|
|
23
|
+
* Returns the list of CodeSystems this provider provides. This is called once at start up.
|
|
24
|
+
* The code systems should be fully loaded; lazy loading code systems is not considered good
|
|
25
|
+
* for engineering.
|
|
26
|
+
*
|
|
27
|
+
*
|
|
28
|
+
* Note that unlike value sets, which are accessed from the provider on the fly, code systems
|
|
29
|
+
* are all preloaded into the kernel (e.g. provider) at start up
|
|
24
30
|
*
|
|
25
31
|
* @param {string} fhirVersion - The FHIRVersion in scope - if relevant (there's always a stated version, though R5 is always used)
|
|
26
32
|
* @param {string} context - The client's stated context - if provided.
|
|
@@ -32,6 +38,24 @@ class AbstractCodeSystemProvider {
|
|
|
32
38
|
throw new Error('listCodeSystems must be implemented by AbstractCodeSystemProvider subclass');
|
|
33
39
|
}
|
|
34
40
|
|
|
41
|
+
/**
|
|
42
|
+
* This is called once a minute to update the code system list that the provider maintains.
|
|
43
|
+
*
|
|
44
|
+
* return an object that has three Map<String, CodeSystem>: {added, changed, deleted}
|
|
45
|
+
*
|
|
46
|
+
* these use the same key as the
|
|
47
|
+
*
|
|
48
|
+
* code systems are identified by url and version
|
|
49
|
+
*
|
|
50
|
+
* @param fhirVersion
|
|
51
|
+
* @param context
|
|
52
|
+
* @returns {Promise<null>}
|
|
53
|
+
*/
|
|
54
|
+
// eslint-disable-next-line no-unused-vars
|
|
55
|
+
async getCodeSystemChanges(fhirVersion, context){
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
|
|
35
59
|
async close() {
|
|
36
60
|
|
|
37
61
|
}
|
|
@@ -7,7 +7,7 @@ class ListCodeSystemProvider extends AbstractCodeSystemProvider {
|
|
|
7
7
|
/**
|
|
8
8
|
* {Map<String, CodeSystem>} A list of code system factories that contains all the preloaded native code systems
|
|
9
9
|
*/
|
|
10
|
-
codeSystems =
|
|
10
|
+
codeSystems = [];
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* ensure that the ids on the code systems are unique, if they are
|
|
@@ -17,7 +17,7 @@ class ListCodeSystemProvider extends AbstractCodeSystemProvider {
|
|
|
17
17
|
*/
|
|
18
18
|
// eslint-disable-next-line no-unused-vars
|
|
19
19
|
assignIds(ids) {
|
|
20
|
-
for (const cs of this.codeSystems
|
|
20
|
+
for (const cs of this.codeSystems) {
|
|
21
21
|
if (!cs.id || ids.has("CodeSystem/"+cs.id)) {
|
|
22
22
|
cs.id = ""+ids.size;
|
|
23
23
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
<div class="operation-form" style="margin-bottom: 15px;">
|
|
3
|
+
<strong>Translate</strong>
|
|
4
|
+
<form method="get" action="$translate" style="margin-left: 10px; margin-top: 5px;">
|
|
5
|
+
<input type="hidden" name="url" value="{{ url }}"/>
|
|
6
|
+
<table class="grid" cellpadding="0" cellspacing="0">
|
|
7
|
+
<tr>
|
|
8
|
+
<td>System:</td><td><select name="sourceSystem">{{ sources }}</select></td>
|
|
9
|
+
</tr>
|
|
10
|
+
<tr>
|
|
11
|
+
<td>Code:</td><td><select name="sourceCode">{{ codes }}</select></td>
|
|
12
|
+
</tr>
|
|
13
|
+
<tr>
|
|
14
|
+
<td>Target:</td><td><select name="targetSystem">{{ targets }}</select></td>
|
|
15
|
+
</tr>
|
|
16
|
+
</table>
|
|
17
|
+
<button type="submit" class="btn btn-sm btn-primary">Translate</button>
|
|
18
|
+
</form>
|
|
19
|
+
</div>
|
|
@@ -111,7 +111,12 @@ class CanonicalResource {
|
|
|
111
111
|
const fmt = this.versionAlgorithm() || other.versionAlgorithm() || this.guessVersionAlgorithmFromVersion(this.version);
|
|
112
112
|
switch (fmt) {
|
|
113
113
|
case 'semver':
|
|
114
|
-
|
|
114
|
+
try {
|
|
115
|
+
return VersionUtilities.isThisOrLater(other.version, this.version, VersionPrecision.PATCH);
|
|
116
|
+
} catch (error) {
|
|
117
|
+
// other is not semver. Not much we can do
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
115
120
|
case 'date':
|
|
116
121
|
return this.dateIsMoreRecent(this.version, other.version);
|
|
117
122
|
case 'integer':
|