@d4l/collect-lib 1.59.2 → 1.61.0
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/LICENSE.md +18 -5
- package/README.md +11 -0
- package/THIRD_PARTY_NOTICES +48 -0
- package/dist/chunk-3XMHVH6M.mjs +154 -0
- package/dist/chunk-3XMHVH6M.mjs.map +1 -0
- package/dist/chunk-HL7CNZCJ.js +154 -0
- package/dist/chunk-HL7CNZCJ.js.map +1 -0
- package/dist/fhir-to-questions.d.mts +43 -0
- package/dist/fhir-to-questions.d.ts +43 -0
- package/dist/fhir-to-questions.js +509 -0
- package/dist/fhir-to-questions.js.map +1 -0
- package/dist/fhir-to-questions.mjs +509 -0
- package/dist/fhir-to-questions.mjs.map +1 -0
- package/dist/index.d.mts +6 -1
- package/dist/index.d.ts +6 -1
- package/dist/index.js +91 -116
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +65 -90
- package/dist/index.mjs.map +1 -1
- package/package.json +11 -4
package/LICENSE.md
CHANGED
|
@@ -1,8 +1,21 @@
|
|
|
1
|
-
|
|
1
|
+
MIT License
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Copyright (c) 2025 D4L data4life gGmbH
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
7
11
|
|
|
8
|
-
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -21,6 +21,17 @@ pnpm add file:../collect-lib
|
|
|
21
21
|
|
|
22
22
|
After every change in the library a `pnpm install` has to be triggered for the changes to take effect in RS.
|
|
23
23
|
|
|
24
|
+
## Go module
|
|
25
|
+
|
|
26
|
+
collect-lib is also a Go module, `github.com/d4l-data4life/collect-lib`, so Go services can use selected functions without a Go port.
|
|
27
|
+
The TypeScript is bundled and run in-process with [goja](https://github.com/dop251/goja), a pure-Go JavaScript interpreter,
|
|
28
|
+
and the module is versioned with the same release tags as the npm package.
|
|
29
|
+
|
|
30
|
+
If you change TS code that a Go package wraps, commit the regenerated `pkg/*/bundle/` from
|
|
31
|
+
`yarn build` with it. If you bump `@d4l/grpc-modules`, bump its Go module to the same version.
|
|
32
|
+
|
|
33
|
+
See **[README_GO.md](README_GO.md)** for usage, how it works, and how to export another function.
|
|
34
|
+
|
|
24
35
|
## Types
|
|
25
36
|
|
|
26
37
|
The type documentation is generated automatically from the `src/types` files.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
Third-party notices
|
|
2
|
+
|
|
3
|
+
collect-lib is MIT licensed (see LICENSE.md). Parts of the following third-party packages
|
|
4
|
+
are bundled into its build output and are redistributed under their own licenses:
|
|
5
|
+
|
|
6
|
+
- luxon: bundled into pkg/guard/bundle/bundle.js (Go module)
|
|
7
|
+
- @noble/hashes: bundled into dist/ (npm package)
|
|
8
|
+
|
|
9
|
+
All other dependencies are installed separately by consumers and carry their own licenses.
|
|
10
|
+
|
|
11
|
+
================================================================================
|
|
12
|
+
luxon (https://github.com/moment/luxon)
|
|
13
|
+
================================================================================
|
|
14
|
+
|
|
15
|
+
Copyright 2019 JS Foundation and other contributors
|
|
16
|
+
|
|
17
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
18
|
+
|
|
19
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
20
|
+
|
|
21
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
================================================================================
|
|
25
|
+
@noble/hashes (https://github.com/paulmillr/noble-hashes)
|
|
26
|
+
================================================================================
|
|
27
|
+
|
|
28
|
+
The MIT License (MIT)
|
|
29
|
+
|
|
30
|
+
Copyright (c) 2022 Paul Miller (https://paulmillr.com)
|
|
31
|
+
|
|
32
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
33
|
+
of this software and associated documentation files (the “Software”), to deal
|
|
34
|
+
in the Software without restriction, including without limitation the rights
|
|
35
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
36
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
37
|
+
furnished to do so, subject to the following conditions:
|
|
38
|
+
|
|
39
|
+
The above copyright notice and this permission notice shall be included in
|
|
40
|
+
all copies or substantial portions of the Software.
|
|
41
|
+
|
|
42
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
43
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
44
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
45
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
46
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
47
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
48
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
// src/fhir/constants.ts
|
|
2
|
+
var SliderMinLabelExtension = "http://fhir.data4life.care/StructureDefinition/slider-label-min";
|
|
3
|
+
var SliderMaxLabelExtension = "http://fhir.data4life.care/StructureDefinition/slider-label-max";
|
|
4
|
+
var SliderStepSizeExtension = "http://fhir.data4life.care/StructureDefinition/slider-step-size";
|
|
5
|
+
var SliderOrientationExtension = "http://fhir.data4life.care/StructureDefinition/slider-orientation";
|
|
6
|
+
var SliderInputLabel = "http://fhir.data4life.care/StructureDefinition/slider-input-label";
|
|
7
|
+
var RelativeMinValueExtension = "http://fhir.data4life.care/StructureDefinition/relative-min-value";
|
|
8
|
+
var RelativeMaxValueExtension = "http://fhir.data4life.care/StructureDefinition/relative-max-value";
|
|
9
|
+
var CustomExtensionStudyName = "http://fhir.data4life.care/StructureDefinition/study-name";
|
|
10
|
+
var CustomExtensionContextValue = "http://fhir.data4life.care/StructureDefinition/context-value";
|
|
11
|
+
var CustomExtensionDate = "http://fhir.data4life.care/StructureDefinition/effective-date";
|
|
12
|
+
var MaxValueExtension = "http://hl7.org/fhir/StructureDefinition/maxValue";
|
|
13
|
+
var MinValueExtension = "http://hl7.org/fhir/StructureDefinition/minValue";
|
|
14
|
+
var MinLengthExtension = "http://hl7.org/fhir/StructureDefinition/minLength";
|
|
15
|
+
var QItemControlDefinition = "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl";
|
|
16
|
+
var RoutineIsPassiveExtension = "http://fhir.data4life.care/StructureDefinition/is-passive-recording";
|
|
17
|
+
var PrepopulateExtension = "http://fhir.data4life.care/StructureDefinition/prepopulate";
|
|
18
|
+
var ImageExtension = "http://hl7.org/fhir/StructureDefinition/questionnaire-itemMedia";
|
|
19
|
+
var QuestionnaireItemOutputExtension = "http://fhir.data4life.care/StructureDefinition/questionnaire-item-output";
|
|
20
|
+
var QuestionnaireItemInputExtension = "http://fhir.data4life.care/StructureDefinition/questionnaire-item-input";
|
|
21
|
+
var TopicInputTopicUrl = "topic";
|
|
22
|
+
var TopicInputScopeUrl = "scope";
|
|
23
|
+
var TopicSystem = "http://fhir.data4life.care/topic";
|
|
24
|
+
var QuestionnaireItemVariableExtension = "http://fhir.data4life.care/StructureDefinition/questionnaire-item-variable";
|
|
25
|
+
var ItemVariableNameUrl = "name";
|
|
26
|
+
var ItemVariableTopicUrl = "topic";
|
|
27
|
+
var ItemVariableQuestionUrl = "question";
|
|
28
|
+
var ItemVariableScopeUrl = "scope";
|
|
29
|
+
var EnableWhenExpressionExtension = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression";
|
|
30
|
+
var FhirPathLanguage = "text/fhirpath";
|
|
31
|
+
var SignalIDSystem = "http://fhir.data4life.care/r5/NamingSystem/app-signal-ids";
|
|
32
|
+
var AppIDNamingSystem = "http://fhir.data4life.care/r5/NamingSystem/app-db-ids";
|
|
33
|
+
var SensorTypeSystem = "http://fhir.data4life.care/r5/NamingSystem/sensor-device-type";
|
|
34
|
+
var SensorIdentifierSystem = "http://fhir.data4life.care/r5/NamingSystem/sensor-peripheral-id";
|
|
35
|
+
var TokenNamingSystem = "http://fhir.data4life.care/r5/NamingSystem/participation-token";
|
|
36
|
+
var ConsentNameSystem = "http://fhir.data4life.care/r5/NamingSystem/consent-name";
|
|
37
|
+
var ConsentVersionSystem = "http://fhir.data4life.care/r5/NamingSystem/consent-version";
|
|
38
|
+
var ObservationTypeSystem = "http://fhir.data4life.care/r5/CodeSystem/observation-types";
|
|
39
|
+
var MeasurementTypeSystem = "http://fhir.data4life.care/r5/CodeSystem/sensor-measurement-types";
|
|
40
|
+
var StudyNameSystem = "http://fhir.data4life.care/r5/CodeSystem/study-name";
|
|
41
|
+
var SensorSettingsSystem = "http://fhir.data4life.care/r5/CodeSystem/sensor-settings";
|
|
42
|
+
var CustomQuestionSystem = "http://fhir.data4life.care/r5/CodeSystem/custom-question-class";
|
|
43
|
+
var CommunicationTypeSystem = "http://fhir.data4life.care/r5/CodeSystem/communication-types";
|
|
44
|
+
var CountryValueSet = "http://hl7.org/fhir/ValueSet/iso3166-1-2";
|
|
45
|
+
var Iso3166CodeSystem = "urn:iso:std:iso:3166";
|
|
46
|
+
var PostalCodeCountrySourceExtension = "http://fhir.data4life.care/fhir/StructureDefinition/postalcode-country-source";
|
|
47
|
+
var PostalCodeFromItemUrl = "fromItem";
|
|
48
|
+
var PostalCodeFixedCountryUrl = "fixedCountry";
|
|
49
|
+
var PlaceholderExtension = "http://fhir.data4life.care/StructureDefinition/placeholder_reference";
|
|
50
|
+
var ValuesetSortingExtension = "http://fhir.data4life.care/StructureDefinition/sorting";
|
|
51
|
+
var DEVICE_LABEL_CODING = {
|
|
52
|
+
system: SensorSettingsSystem,
|
|
53
|
+
code: "device_label",
|
|
54
|
+
display: "Device label"
|
|
55
|
+
};
|
|
56
|
+
var DEVICE_DISPLAY_LABEL_CODING = {
|
|
57
|
+
system: SensorSettingsSystem,
|
|
58
|
+
code: "display_label",
|
|
59
|
+
display: "Display Label"
|
|
60
|
+
};
|
|
61
|
+
var DEVICE_OUTPUT_RATE_CODING = {
|
|
62
|
+
system: "urn:iso:std:iso:11073:10101",
|
|
63
|
+
code: "68320",
|
|
64
|
+
display: "MDC_ATTR_SAMPLE_RATE"
|
|
65
|
+
};
|
|
66
|
+
var DEVICE_SENSOR_DELAY_CODING = {
|
|
67
|
+
system: SensorSettingsSystem,
|
|
68
|
+
code: "sensor_delay",
|
|
69
|
+
display: "Sensor delay"
|
|
70
|
+
};
|
|
71
|
+
var SIGNAL_DURATION_CODING = {
|
|
72
|
+
system: "http://loinc.org",
|
|
73
|
+
code: "8838-5",
|
|
74
|
+
display: "Observation duration"
|
|
75
|
+
};
|
|
76
|
+
var ANDROID_SENSORS_CONSTANT_NAMES = [
|
|
77
|
+
"SENSOR_DELAY_FASTEST",
|
|
78
|
+
"SENSOR_DELAY_GAME",
|
|
79
|
+
"SENSOR_DELAY_UI",
|
|
80
|
+
"SENSOR_DELAY_NORMAL"
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
// src/fhir/topic-id.ts
|
|
84
|
+
var TOPIC_ID_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
85
|
+
var isValidTopicId = (id) => TOPIC_ID_PATTERN.test(id);
|
|
86
|
+
var topicIdFromCanonical = (canonical) => canonical.substring(canonical.lastIndexOf("/") + 1);
|
|
87
|
+
var isValidTopicCanonical = (canonical) => isValidTopicId(topicIdFromCanonical(canonical));
|
|
88
|
+
var TOPIC_SCOPE_CODES = ["session", "latest", "all"];
|
|
89
|
+
var isValidTopicScope = (code) => TOPIC_SCOPE_CODES.includes(code);
|
|
90
|
+
|
|
91
|
+
export {
|
|
92
|
+
SliderMinLabelExtension,
|
|
93
|
+
SliderMaxLabelExtension,
|
|
94
|
+
SliderStepSizeExtension,
|
|
95
|
+
SliderOrientationExtension,
|
|
96
|
+
SliderInputLabel,
|
|
97
|
+
RelativeMinValueExtension,
|
|
98
|
+
RelativeMaxValueExtension,
|
|
99
|
+
CustomExtensionStudyName,
|
|
100
|
+
CustomExtensionContextValue,
|
|
101
|
+
CustomExtensionDate,
|
|
102
|
+
MaxValueExtension,
|
|
103
|
+
MinValueExtension,
|
|
104
|
+
MinLengthExtension,
|
|
105
|
+
QItemControlDefinition,
|
|
106
|
+
RoutineIsPassiveExtension,
|
|
107
|
+
PrepopulateExtension,
|
|
108
|
+
ImageExtension,
|
|
109
|
+
QuestionnaireItemOutputExtension,
|
|
110
|
+
QuestionnaireItemInputExtension,
|
|
111
|
+
TopicInputTopicUrl,
|
|
112
|
+
TopicInputScopeUrl,
|
|
113
|
+
TopicSystem,
|
|
114
|
+
QuestionnaireItemVariableExtension,
|
|
115
|
+
ItemVariableNameUrl,
|
|
116
|
+
ItemVariableTopicUrl,
|
|
117
|
+
ItemVariableQuestionUrl,
|
|
118
|
+
ItemVariableScopeUrl,
|
|
119
|
+
EnableWhenExpressionExtension,
|
|
120
|
+
FhirPathLanguage,
|
|
121
|
+
SignalIDSystem,
|
|
122
|
+
AppIDNamingSystem,
|
|
123
|
+
SensorTypeSystem,
|
|
124
|
+
SensorIdentifierSystem,
|
|
125
|
+
TokenNamingSystem,
|
|
126
|
+
ConsentNameSystem,
|
|
127
|
+
ConsentVersionSystem,
|
|
128
|
+
ObservationTypeSystem,
|
|
129
|
+
MeasurementTypeSystem,
|
|
130
|
+
StudyNameSystem,
|
|
131
|
+
SensorSettingsSystem,
|
|
132
|
+
CustomQuestionSystem,
|
|
133
|
+
CommunicationTypeSystem,
|
|
134
|
+
CountryValueSet,
|
|
135
|
+
Iso3166CodeSystem,
|
|
136
|
+
PostalCodeCountrySourceExtension,
|
|
137
|
+
PostalCodeFromItemUrl,
|
|
138
|
+
PostalCodeFixedCountryUrl,
|
|
139
|
+
PlaceholderExtension,
|
|
140
|
+
ValuesetSortingExtension,
|
|
141
|
+
DEVICE_LABEL_CODING,
|
|
142
|
+
DEVICE_DISPLAY_LABEL_CODING,
|
|
143
|
+
DEVICE_OUTPUT_RATE_CODING,
|
|
144
|
+
DEVICE_SENSOR_DELAY_CODING,
|
|
145
|
+
SIGNAL_DURATION_CODING,
|
|
146
|
+
ANDROID_SENSORS_CONSTANT_NAMES,
|
|
147
|
+
TOPIC_ID_PATTERN,
|
|
148
|
+
isValidTopicId,
|
|
149
|
+
topicIdFromCanonical,
|
|
150
|
+
isValidTopicCanonical,
|
|
151
|
+
TOPIC_SCOPE_CODES,
|
|
152
|
+
isValidTopicScope
|
|
153
|
+
};
|
|
154
|
+
//# sourceMappingURL=chunk-3XMHVH6M.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/fhir/constants.ts","../src/fhir/topic-id.ts"],"sourcesContent":["// Structure Definitions\nexport const SliderMinLabelExtension =\n 'http://fhir.data4life.care/StructureDefinition/slider-label-min';\nexport const SliderMaxLabelExtension =\n 'http://fhir.data4life.care/StructureDefinition/slider-label-max';\nexport const SliderStepSizeExtension =\n 'http://fhir.data4life.care/StructureDefinition/slider-step-size';\nexport const SliderOrientationExtension =\n 'http://fhir.data4life.care/StructureDefinition/slider-orientation';\nexport const SliderInputLabel = 'http://fhir.data4life.care/StructureDefinition/slider-input-label';\nexport const RelativeMinValueExtension =\n 'http://fhir.data4life.care/StructureDefinition/relative-min-value';\nexport const RelativeMaxValueExtension =\n 'http://fhir.data4life.care/StructureDefinition/relative-max-value';\nexport const CustomExtensionStudyName = 'http://fhir.data4life.care/StructureDefinition/study-name';\nexport const CustomExtensionContextValue =\n 'http://fhir.data4life.care/StructureDefinition/context-value';\nexport const CustomExtensionDate = 'http://fhir.data4life.care/StructureDefinition/effective-date';\nexport const MaxValueExtension = 'http://hl7.org/fhir/StructureDefinition/maxValue';\nexport const MinValueExtension = 'http://hl7.org/fhir/StructureDefinition/minValue';\nexport const MinLengthExtension = 'http://hl7.org/fhir/StructureDefinition/minLength';\nexport const QItemControlDefinition =\n 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl';\nexport const RoutineIsPassiveExtension =\n 'http://fhir.data4life.care/StructureDefinition/is-passive-recording';\n// LEGACY(prepopulate) [HUB-6797]: remove when prepopulate is retired (replaced by input/output).\nexport const PrepopulateExtension = 'http://fhir.data4life.care/StructureDefinition/prepopulate';\nexport const ImageExtension = 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemMedia';\n// Topic-based question linking (input/output). Producer marker carries `valueCanonical` = the\n// topic; the consumer marker is a complex extension with `topic` (valueCanonical) + `scope`\n// (valueCode) sub-extensions. `TopicSystem` is the coding system for topic launchContexts.\nexport const QuestionnaireItemOutputExtension =\n 'http://fhir.data4life.care/StructureDefinition/questionnaire-item-output';\nexport const QuestionnaireItemInputExtension =\n 'http://fhir.data4life.care/StructureDefinition/questionnaire-item-input';\nexport const TopicInputTopicUrl = 'topic';\nexport const TopicInputScopeUrl = 'scope';\nexport const TopicSystem = 'http://fhir.data4life.care/topic';\n// Cross-questionnaire enableWhen. The condition is a standard SDC\n// `enableWhenExpression` (text/fhirpath); the variables it references are bound by the custom\n// `questionnaire-item-variable` extension, which mirrors the shape of a FHIR `variable` but\n// sources the value from a topic (with scope) or a local question (linkId) rather than from a\n// FHIRPath expression over the resource. The name/topic/question/scope sub-extension URLs are a\n// wire contract shared with research-pillars and the phoenix/studio parsers.\nexport const QuestionnaireItemVariableExtension =\n 'http://fhir.data4life.care/StructureDefinition/questionnaire-item-variable';\nexport const ItemVariableNameUrl = 'name';\nexport const ItemVariableTopicUrl = 'topic';\nexport const ItemVariableQuestionUrl = 'question';\nexport const ItemVariableScopeUrl = 'scope';\nexport const EnableWhenExpressionExtension =\n 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression';\nexport const FhirPathLanguage = 'text/fhirpath';\n// Naming Systems\nexport const SignalIDSystem = 'http://fhir.data4life.care/r5/NamingSystem/app-signal-ids';\nexport const AppIDNamingSystem = 'http://fhir.data4life.care/r5/NamingSystem/app-db-ids';\nexport const SensorTypeSystem = 'http://fhir.data4life.care/r5/NamingSystem/sensor-device-type';\nexport const SensorIdentifierSystem =\n 'http://fhir.data4life.care/r5/NamingSystem/sensor-peripheral-id';\nexport const TokenNamingSystem = 'http://fhir.data4life.care/r5/NamingSystem/participation-token';\nexport const ConsentNameSystem = 'http://fhir.data4life.care/r5/NamingSystem/consent-name';\nexport const ConsentVersionSystem = 'http://fhir.data4life.care/r5/NamingSystem/consent-version';\n// Code Systems\nexport const ObservationTypeSystem = 'http://fhir.data4life.care/r5/CodeSystem/observation-types';\nexport const MeasurementTypeSystem =\n 'http://fhir.data4life.care/r5/CodeSystem/sensor-measurement-types';\nexport const StudyNameSystem = 'http://fhir.data4life.care/r5/CodeSystem/study-name';\nexport const SensorSettingsSystem = 'http://fhir.data4life.care/r5/CodeSystem/sensor-settings';\nexport const CustomQuestionSystem =\n 'http://fhir.data4life.care/r5/CodeSystem/custom-question-class';\nexport const CommunicationTypeSystem =\n 'http://fhir.data4life.care/r5/CodeSystem/communication-types';\n// Canonical FHIR ValueSet URL for ISO 3166-1 alpha-2 country codes. Referenced\n// by the `country` input type; consumers render a dedicated country picker and\n// submit answers as a valueCoding with the ISO 3166 system below.\nexport const CountryValueSet = 'http://hl7.org/fhir/ValueSet/iso3166-1-2';\nexport const Iso3166CodeSystem = 'urn:iso:std:iso:3166';\n\n// Complex extension carrying the country source for a `postal-code` input. Sub-\n// extensions: `fromItem` (valueString = another item's linkId) XOR\n// `fixedCountry` (valueCoding with system Iso3166CodeSystem).\nexport const PostalCodeCountrySourceExtension =\n 'http://fhir.data4life.care/fhir/StructureDefinition/postalcode-country-source';\nexport const PostalCodeFromItemUrl = 'fromItem';\nexport const PostalCodeFixedCountryUrl = 'fixedCountry';\n\n// Free-text placeholder tokens (e.g. `%firstName`) a question's text may contain, filled in at\n// render time from participant/context data.\nexport const PlaceholderExtension = 'http://fhir.data4life.care/StructureDefinition/placeholder_reference';\n// Explicit display order for a contained ValueSet's answer options (e.g. 'alphabetical'); absent\n// means the authoring UI's own default order.\nexport const ValuesetSortingExtension = 'http://fhir.data4life.care/StructureDefinition/sorting';\n\nexport const DEVICE_LABEL_CODING = {\n system: SensorSettingsSystem,\n code: 'device_label',\n display: 'Device label',\n};\n\nexport const DEVICE_DISPLAY_LABEL_CODING = {\n system: SensorSettingsSystem,\n code: 'display_label',\n display: 'Display Label',\n};\n\nexport const DEVICE_OUTPUT_RATE_CODING = {\n system: 'urn:iso:std:iso:11073:10101',\n code: '68320',\n display: 'MDC_ATTR_SAMPLE_RATE',\n};\n\nexport const DEVICE_SENSOR_DELAY_CODING = {\n system: SensorSettingsSystem,\n code: 'sensor_delay',\n display: 'Sensor delay',\n};\n\nexport const SIGNAL_DURATION_CODING = {\n system: 'http://loinc.org',\n code: '8838-5',\n display: 'Observation duration',\n};\n\nexport const ANDROID_SENSORS_CONSTANT_NAMES = [\n 'SENSOR_DELAY_FASTEST',\n 'SENSOR_DELAY_GAME',\n 'SENSOR_DELAY_UI',\n 'SENSOR_DELAY_NORMAL',\n];\n","/**\n * Topic-id helpers shared by next-research-studio (authoring) and phoenix\n * (runtime). A topic's canonical URL ends in an identifier-safe id\n * (^[A-Za-z_][A-Za-z0-9_]*$): constrained from the start so ids stay stable,\n * are safe as index/map keys, and never need renaming or migration.\n *\n * NOTE: research-pillars (Go, pkg/fhir) mirrors `topicIdFromCanonical`; it\n * cannot import this module, so keep the two in sync by hand.\n */\nexport const TOPIC_ID_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\n/** True if the id is identifier-safe (see {@link TOPIC_ID_PATTERN}). */\nexport const isValidTopicId = (id: string): boolean => TOPIC_ID_PATTERN.test(id);\n\n/** The topic id — the last path segment of a topic canonical URL. */\nexport const topicIdFromCanonical = (canonical: string): string =>\n canonical.substring(canonical.lastIndexOf('/') + 1);\n\n/** True if the canonical's id segment is identifier-safe. */\nexport const isValidTopicCanonical = (canonical: string): boolean =>\n isValidTopicId(topicIdFromCanonical(canonical));\n\n/**\n * The FHIR `valueCode` strings for a topic input's scope, in proto-enum order\n * (session=0, latest=1, all=2). These are the wire contract: they must equal\n * the grpc-modules `TopicScope` enum's JSON names\n */\nexport const TOPIC_SCOPE_CODES = ['session', 'latest', 'all'] as const;\n\nexport type TopicScopeCode = (typeof TOPIC_SCOPE_CODES)[number];\n\n/** True if `code` is a recognized topic scope valueCode. */\nexport const isValidTopicScope = (code: string): code is TopicScopeCode =>\n (TOPIC_SCOPE_CODES as readonly string[]).includes(code);\n"],"mappings":";AACO,IAAM,0BACX;AACK,IAAM,0BACX;AACK,IAAM,0BACX;AACK,IAAM,6BACX;AACK,IAAM,mBAAmB;AACzB,IAAM,4BACX;AACK,IAAM,4BACX;AACK,IAAM,2BAA2B;AACjC,IAAM,8BACX;AACK,IAAM,sBAAsB;AAC5B,IAAM,oBAAoB;AAC1B,IAAM,oBAAoB;AAC1B,IAAM,qBAAqB;AAC3B,IAAM,yBACX;AACK,IAAM,4BACX;AAEK,IAAM,uBAAuB;AAC7B,IAAM,iBAAiB;AAIvB,IAAM,mCACX;AACK,IAAM,kCACX;AACK,IAAM,qBAAqB;AAC3B,IAAM,qBAAqB;AAC3B,IAAM,cAAc;AAOpB,IAAM,qCACX;AACK,IAAM,sBAAsB;AAC5B,IAAM,uBAAuB;AAC7B,IAAM,0BAA0B;AAChC,IAAM,uBAAuB;AAC7B,IAAM,gCACX;AACK,IAAM,mBAAmB;AAEzB,IAAM,iBAAiB;AACvB,IAAM,oBAAoB;AAC1B,IAAM,mBAAmB;AACzB,IAAM,yBACX;AACK,IAAM,oBAAoB;AAC1B,IAAM,oBAAoB;AAC1B,IAAM,uBAAuB;AAE7B,IAAM,wBAAwB;AAC9B,IAAM,wBACX;AACK,IAAM,kBAAkB;AACxB,IAAM,uBAAuB;AAC7B,IAAM,uBACX;AACK,IAAM,0BACX;AAIK,IAAM,kBAAkB;AACxB,IAAM,oBAAoB;AAK1B,IAAM,mCACX;AACK,IAAM,wBAAwB;AAC9B,IAAM,4BAA4B;AAIlC,IAAM,uBAAuB;AAG7B,IAAM,2BAA2B;AAEjC,IAAM,sBAAsB;AAAA,EACjC,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AACX;AAEO,IAAM,8BAA8B;AAAA,EACzC,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AACX;AAEO,IAAM,4BAA4B;AAAA,EACvC,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AACX;AAEO,IAAM,6BAA6B;AAAA,EACxC,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AACX;AAEO,IAAM,yBAAyB;AAAA,EACpC,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,SAAS;AACX;AAEO,IAAM,iCAAiC;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;;;ACvHO,IAAM,mBAAmB;AAGzB,IAAM,iBAAiB,CAAC,OAAwB,iBAAiB,KAAK,EAAE;AAGxE,IAAM,uBAAuB,CAAC,cACnC,UAAU,UAAU,UAAU,YAAY,GAAG,IAAI,CAAC;AAG7C,IAAM,wBAAwB,CAAC,cACpC,eAAe,qBAAqB,SAAS,CAAC;AAOzC,IAAM,oBAAoB,CAAC,WAAW,UAAU,KAAK;AAKrD,IAAM,oBAAoB,CAAC,SAC/B,kBAAwC,SAAS,IAAI;","names":[]}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/fhir/constants.ts
|
|
2
|
+
var SliderMinLabelExtension = "http://fhir.data4life.care/StructureDefinition/slider-label-min";
|
|
3
|
+
var SliderMaxLabelExtension = "http://fhir.data4life.care/StructureDefinition/slider-label-max";
|
|
4
|
+
var SliderStepSizeExtension = "http://fhir.data4life.care/StructureDefinition/slider-step-size";
|
|
5
|
+
var SliderOrientationExtension = "http://fhir.data4life.care/StructureDefinition/slider-orientation";
|
|
6
|
+
var SliderInputLabel = "http://fhir.data4life.care/StructureDefinition/slider-input-label";
|
|
7
|
+
var RelativeMinValueExtension = "http://fhir.data4life.care/StructureDefinition/relative-min-value";
|
|
8
|
+
var RelativeMaxValueExtension = "http://fhir.data4life.care/StructureDefinition/relative-max-value";
|
|
9
|
+
var CustomExtensionStudyName = "http://fhir.data4life.care/StructureDefinition/study-name";
|
|
10
|
+
var CustomExtensionContextValue = "http://fhir.data4life.care/StructureDefinition/context-value";
|
|
11
|
+
var CustomExtensionDate = "http://fhir.data4life.care/StructureDefinition/effective-date";
|
|
12
|
+
var MaxValueExtension = "http://hl7.org/fhir/StructureDefinition/maxValue";
|
|
13
|
+
var MinValueExtension = "http://hl7.org/fhir/StructureDefinition/minValue";
|
|
14
|
+
var MinLengthExtension = "http://hl7.org/fhir/StructureDefinition/minLength";
|
|
15
|
+
var QItemControlDefinition = "http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl";
|
|
16
|
+
var RoutineIsPassiveExtension = "http://fhir.data4life.care/StructureDefinition/is-passive-recording";
|
|
17
|
+
var PrepopulateExtension = "http://fhir.data4life.care/StructureDefinition/prepopulate";
|
|
18
|
+
var ImageExtension = "http://hl7.org/fhir/StructureDefinition/questionnaire-itemMedia";
|
|
19
|
+
var QuestionnaireItemOutputExtension = "http://fhir.data4life.care/StructureDefinition/questionnaire-item-output";
|
|
20
|
+
var QuestionnaireItemInputExtension = "http://fhir.data4life.care/StructureDefinition/questionnaire-item-input";
|
|
21
|
+
var TopicInputTopicUrl = "topic";
|
|
22
|
+
var TopicInputScopeUrl = "scope";
|
|
23
|
+
var TopicSystem = "http://fhir.data4life.care/topic";
|
|
24
|
+
var QuestionnaireItemVariableExtension = "http://fhir.data4life.care/StructureDefinition/questionnaire-item-variable";
|
|
25
|
+
var ItemVariableNameUrl = "name";
|
|
26
|
+
var ItemVariableTopicUrl = "topic";
|
|
27
|
+
var ItemVariableQuestionUrl = "question";
|
|
28
|
+
var ItemVariableScopeUrl = "scope";
|
|
29
|
+
var EnableWhenExpressionExtension = "http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression";
|
|
30
|
+
var FhirPathLanguage = "text/fhirpath";
|
|
31
|
+
var SignalIDSystem = "http://fhir.data4life.care/r5/NamingSystem/app-signal-ids";
|
|
32
|
+
var AppIDNamingSystem = "http://fhir.data4life.care/r5/NamingSystem/app-db-ids";
|
|
33
|
+
var SensorTypeSystem = "http://fhir.data4life.care/r5/NamingSystem/sensor-device-type";
|
|
34
|
+
var SensorIdentifierSystem = "http://fhir.data4life.care/r5/NamingSystem/sensor-peripheral-id";
|
|
35
|
+
var TokenNamingSystem = "http://fhir.data4life.care/r5/NamingSystem/participation-token";
|
|
36
|
+
var ConsentNameSystem = "http://fhir.data4life.care/r5/NamingSystem/consent-name";
|
|
37
|
+
var ConsentVersionSystem = "http://fhir.data4life.care/r5/NamingSystem/consent-version";
|
|
38
|
+
var ObservationTypeSystem = "http://fhir.data4life.care/r5/CodeSystem/observation-types";
|
|
39
|
+
var MeasurementTypeSystem = "http://fhir.data4life.care/r5/CodeSystem/sensor-measurement-types";
|
|
40
|
+
var StudyNameSystem = "http://fhir.data4life.care/r5/CodeSystem/study-name";
|
|
41
|
+
var SensorSettingsSystem = "http://fhir.data4life.care/r5/CodeSystem/sensor-settings";
|
|
42
|
+
var CustomQuestionSystem = "http://fhir.data4life.care/r5/CodeSystem/custom-question-class";
|
|
43
|
+
var CommunicationTypeSystem = "http://fhir.data4life.care/r5/CodeSystem/communication-types";
|
|
44
|
+
var CountryValueSet = "http://hl7.org/fhir/ValueSet/iso3166-1-2";
|
|
45
|
+
var Iso3166CodeSystem = "urn:iso:std:iso:3166";
|
|
46
|
+
var PostalCodeCountrySourceExtension = "http://fhir.data4life.care/fhir/StructureDefinition/postalcode-country-source";
|
|
47
|
+
var PostalCodeFromItemUrl = "fromItem";
|
|
48
|
+
var PostalCodeFixedCountryUrl = "fixedCountry";
|
|
49
|
+
var PlaceholderExtension = "http://fhir.data4life.care/StructureDefinition/placeholder_reference";
|
|
50
|
+
var ValuesetSortingExtension = "http://fhir.data4life.care/StructureDefinition/sorting";
|
|
51
|
+
var DEVICE_LABEL_CODING = {
|
|
52
|
+
system: SensorSettingsSystem,
|
|
53
|
+
code: "device_label",
|
|
54
|
+
display: "Device label"
|
|
55
|
+
};
|
|
56
|
+
var DEVICE_DISPLAY_LABEL_CODING = {
|
|
57
|
+
system: SensorSettingsSystem,
|
|
58
|
+
code: "display_label",
|
|
59
|
+
display: "Display Label"
|
|
60
|
+
};
|
|
61
|
+
var DEVICE_OUTPUT_RATE_CODING = {
|
|
62
|
+
system: "urn:iso:std:iso:11073:10101",
|
|
63
|
+
code: "68320",
|
|
64
|
+
display: "MDC_ATTR_SAMPLE_RATE"
|
|
65
|
+
};
|
|
66
|
+
var DEVICE_SENSOR_DELAY_CODING = {
|
|
67
|
+
system: SensorSettingsSystem,
|
|
68
|
+
code: "sensor_delay",
|
|
69
|
+
display: "Sensor delay"
|
|
70
|
+
};
|
|
71
|
+
var SIGNAL_DURATION_CODING = {
|
|
72
|
+
system: "http://loinc.org",
|
|
73
|
+
code: "8838-5",
|
|
74
|
+
display: "Observation duration"
|
|
75
|
+
};
|
|
76
|
+
var ANDROID_SENSORS_CONSTANT_NAMES = [
|
|
77
|
+
"SENSOR_DELAY_FASTEST",
|
|
78
|
+
"SENSOR_DELAY_GAME",
|
|
79
|
+
"SENSOR_DELAY_UI",
|
|
80
|
+
"SENSOR_DELAY_NORMAL"
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
// src/fhir/topic-id.ts
|
|
84
|
+
var TOPIC_ID_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;
|
|
85
|
+
var isValidTopicId = (id) => TOPIC_ID_PATTERN.test(id);
|
|
86
|
+
var topicIdFromCanonical = (canonical) => canonical.substring(canonical.lastIndexOf("/") + 1);
|
|
87
|
+
var isValidTopicCanonical = (canonical) => isValidTopicId(topicIdFromCanonical(canonical));
|
|
88
|
+
var TOPIC_SCOPE_CODES = ["session", "latest", "all"];
|
|
89
|
+
var isValidTopicScope = (code) => TOPIC_SCOPE_CODES.includes(code);
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
exports.SliderMinLabelExtension = SliderMinLabelExtension; exports.SliderMaxLabelExtension = SliderMaxLabelExtension; exports.SliderStepSizeExtension = SliderStepSizeExtension; exports.SliderOrientationExtension = SliderOrientationExtension; exports.SliderInputLabel = SliderInputLabel; exports.RelativeMinValueExtension = RelativeMinValueExtension; exports.RelativeMaxValueExtension = RelativeMaxValueExtension; exports.CustomExtensionStudyName = CustomExtensionStudyName; exports.CustomExtensionContextValue = CustomExtensionContextValue; exports.CustomExtensionDate = CustomExtensionDate; exports.MaxValueExtension = MaxValueExtension; exports.MinValueExtension = MinValueExtension; exports.MinLengthExtension = MinLengthExtension; exports.QItemControlDefinition = QItemControlDefinition; exports.RoutineIsPassiveExtension = RoutineIsPassiveExtension; exports.PrepopulateExtension = PrepopulateExtension; exports.ImageExtension = ImageExtension; exports.QuestionnaireItemOutputExtension = QuestionnaireItemOutputExtension; exports.QuestionnaireItemInputExtension = QuestionnaireItemInputExtension; exports.TopicInputTopicUrl = TopicInputTopicUrl; exports.TopicInputScopeUrl = TopicInputScopeUrl; exports.TopicSystem = TopicSystem; exports.QuestionnaireItemVariableExtension = QuestionnaireItemVariableExtension; exports.ItemVariableNameUrl = ItemVariableNameUrl; exports.ItemVariableTopicUrl = ItemVariableTopicUrl; exports.ItemVariableQuestionUrl = ItemVariableQuestionUrl; exports.ItemVariableScopeUrl = ItemVariableScopeUrl; exports.EnableWhenExpressionExtension = EnableWhenExpressionExtension; exports.FhirPathLanguage = FhirPathLanguage; exports.SignalIDSystem = SignalIDSystem; exports.AppIDNamingSystem = AppIDNamingSystem; exports.SensorTypeSystem = SensorTypeSystem; exports.SensorIdentifierSystem = SensorIdentifierSystem; exports.TokenNamingSystem = TokenNamingSystem; exports.ConsentNameSystem = ConsentNameSystem; exports.ConsentVersionSystem = ConsentVersionSystem; exports.ObservationTypeSystem = ObservationTypeSystem; exports.MeasurementTypeSystem = MeasurementTypeSystem; exports.StudyNameSystem = StudyNameSystem; exports.SensorSettingsSystem = SensorSettingsSystem; exports.CustomQuestionSystem = CustomQuestionSystem; exports.CommunicationTypeSystem = CommunicationTypeSystem; exports.CountryValueSet = CountryValueSet; exports.Iso3166CodeSystem = Iso3166CodeSystem; exports.PostalCodeCountrySourceExtension = PostalCodeCountrySourceExtension; exports.PostalCodeFromItemUrl = PostalCodeFromItemUrl; exports.PostalCodeFixedCountryUrl = PostalCodeFixedCountryUrl; exports.PlaceholderExtension = PlaceholderExtension; exports.ValuesetSortingExtension = ValuesetSortingExtension; exports.DEVICE_LABEL_CODING = DEVICE_LABEL_CODING; exports.DEVICE_DISPLAY_LABEL_CODING = DEVICE_DISPLAY_LABEL_CODING; exports.DEVICE_OUTPUT_RATE_CODING = DEVICE_OUTPUT_RATE_CODING; exports.DEVICE_SENSOR_DELAY_CODING = DEVICE_SENSOR_DELAY_CODING; exports.SIGNAL_DURATION_CODING = SIGNAL_DURATION_CODING; exports.ANDROID_SENSORS_CONSTANT_NAMES = ANDROID_SENSORS_CONSTANT_NAMES; exports.TOPIC_ID_PATTERN = TOPIC_ID_PATTERN; exports.isValidTopicId = isValidTopicId; exports.topicIdFromCanonical = topicIdFromCanonical; exports.isValidTopicCanonical = isValidTopicCanonical; exports.TOPIC_SCOPE_CODES = TOPIC_SCOPE_CODES; exports.isValidTopicScope = isValidTopicScope;
|
|
154
|
+
//# sourceMappingURL=chunk-HL7CNZCJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/collect-lib/collect-lib/dist/chunk-HL7CNZCJ.js","../src/fhir/constants.ts","../src/fhir/topic-id.ts"],"names":[],"mappings":"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","file":"/home/runner/work/collect-lib/collect-lib/dist/chunk-HL7CNZCJ.js","sourcesContent":[null,"// Structure Definitions\nexport const SliderMinLabelExtension =\n 'http://fhir.data4life.care/StructureDefinition/slider-label-min';\nexport const SliderMaxLabelExtension =\n 'http://fhir.data4life.care/StructureDefinition/slider-label-max';\nexport const SliderStepSizeExtension =\n 'http://fhir.data4life.care/StructureDefinition/slider-step-size';\nexport const SliderOrientationExtension =\n 'http://fhir.data4life.care/StructureDefinition/slider-orientation';\nexport const SliderInputLabel = 'http://fhir.data4life.care/StructureDefinition/slider-input-label';\nexport const RelativeMinValueExtension =\n 'http://fhir.data4life.care/StructureDefinition/relative-min-value';\nexport const RelativeMaxValueExtension =\n 'http://fhir.data4life.care/StructureDefinition/relative-max-value';\nexport const CustomExtensionStudyName = 'http://fhir.data4life.care/StructureDefinition/study-name';\nexport const CustomExtensionContextValue =\n 'http://fhir.data4life.care/StructureDefinition/context-value';\nexport const CustomExtensionDate = 'http://fhir.data4life.care/StructureDefinition/effective-date';\nexport const MaxValueExtension = 'http://hl7.org/fhir/StructureDefinition/maxValue';\nexport const MinValueExtension = 'http://hl7.org/fhir/StructureDefinition/minValue';\nexport const MinLengthExtension = 'http://hl7.org/fhir/StructureDefinition/minLength';\nexport const QItemControlDefinition =\n 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl';\nexport const RoutineIsPassiveExtension =\n 'http://fhir.data4life.care/StructureDefinition/is-passive-recording';\n// LEGACY(prepopulate) [HUB-6797]: remove when prepopulate is retired (replaced by input/output).\nexport const PrepopulateExtension = 'http://fhir.data4life.care/StructureDefinition/prepopulate';\nexport const ImageExtension = 'http://hl7.org/fhir/StructureDefinition/questionnaire-itemMedia';\n// Topic-based question linking (input/output). Producer marker carries `valueCanonical` = the\n// topic; the consumer marker is a complex extension with `topic` (valueCanonical) + `scope`\n// (valueCode) sub-extensions. `TopicSystem` is the coding system for topic launchContexts.\nexport const QuestionnaireItemOutputExtension =\n 'http://fhir.data4life.care/StructureDefinition/questionnaire-item-output';\nexport const QuestionnaireItemInputExtension =\n 'http://fhir.data4life.care/StructureDefinition/questionnaire-item-input';\nexport const TopicInputTopicUrl = 'topic';\nexport const TopicInputScopeUrl = 'scope';\nexport const TopicSystem = 'http://fhir.data4life.care/topic';\n// Cross-questionnaire enableWhen. The condition is a standard SDC\n// `enableWhenExpression` (text/fhirpath); the variables it references are bound by the custom\n// `questionnaire-item-variable` extension, which mirrors the shape of a FHIR `variable` but\n// sources the value from a topic (with scope) or a local question (linkId) rather than from a\n// FHIRPath expression over the resource. The name/topic/question/scope sub-extension URLs are a\n// wire contract shared with research-pillars and the phoenix/studio parsers.\nexport const QuestionnaireItemVariableExtension =\n 'http://fhir.data4life.care/StructureDefinition/questionnaire-item-variable';\nexport const ItemVariableNameUrl = 'name';\nexport const ItemVariableTopicUrl = 'topic';\nexport const ItemVariableQuestionUrl = 'question';\nexport const ItemVariableScopeUrl = 'scope';\nexport const EnableWhenExpressionExtension =\n 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression';\nexport const FhirPathLanguage = 'text/fhirpath';\n// Naming Systems\nexport const SignalIDSystem = 'http://fhir.data4life.care/r5/NamingSystem/app-signal-ids';\nexport const AppIDNamingSystem = 'http://fhir.data4life.care/r5/NamingSystem/app-db-ids';\nexport const SensorTypeSystem = 'http://fhir.data4life.care/r5/NamingSystem/sensor-device-type';\nexport const SensorIdentifierSystem =\n 'http://fhir.data4life.care/r5/NamingSystem/sensor-peripheral-id';\nexport const TokenNamingSystem = 'http://fhir.data4life.care/r5/NamingSystem/participation-token';\nexport const ConsentNameSystem = 'http://fhir.data4life.care/r5/NamingSystem/consent-name';\nexport const ConsentVersionSystem = 'http://fhir.data4life.care/r5/NamingSystem/consent-version';\n// Code Systems\nexport const ObservationTypeSystem = 'http://fhir.data4life.care/r5/CodeSystem/observation-types';\nexport const MeasurementTypeSystem =\n 'http://fhir.data4life.care/r5/CodeSystem/sensor-measurement-types';\nexport const StudyNameSystem = 'http://fhir.data4life.care/r5/CodeSystem/study-name';\nexport const SensorSettingsSystem = 'http://fhir.data4life.care/r5/CodeSystem/sensor-settings';\nexport const CustomQuestionSystem =\n 'http://fhir.data4life.care/r5/CodeSystem/custom-question-class';\nexport const CommunicationTypeSystem =\n 'http://fhir.data4life.care/r5/CodeSystem/communication-types';\n// Canonical FHIR ValueSet URL for ISO 3166-1 alpha-2 country codes. Referenced\n// by the `country` input type; consumers render a dedicated country picker and\n// submit answers as a valueCoding with the ISO 3166 system below.\nexport const CountryValueSet = 'http://hl7.org/fhir/ValueSet/iso3166-1-2';\nexport const Iso3166CodeSystem = 'urn:iso:std:iso:3166';\n\n// Complex extension carrying the country source for a `postal-code` input. Sub-\n// extensions: `fromItem` (valueString = another item's linkId) XOR\n// `fixedCountry` (valueCoding with system Iso3166CodeSystem).\nexport const PostalCodeCountrySourceExtension =\n 'http://fhir.data4life.care/fhir/StructureDefinition/postalcode-country-source';\nexport const PostalCodeFromItemUrl = 'fromItem';\nexport const PostalCodeFixedCountryUrl = 'fixedCountry';\n\n// Free-text placeholder tokens (e.g. `%firstName`) a question's text may contain, filled in at\n// render time from participant/context data.\nexport const PlaceholderExtension = 'http://fhir.data4life.care/StructureDefinition/placeholder_reference';\n// Explicit display order for a contained ValueSet's answer options (e.g. 'alphabetical'); absent\n// means the authoring UI's own default order.\nexport const ValuesetSortingExtension = 'http://fhir.data4life.care/StructureDefinition/sorting';\n\nexport const DEVICE_LABEL_CODING = {\n system: SensorSettingsSystem,\n code: 'device_label',\n display: 'Device label',\n};\n\nexport const DEVICE_DISPLAY_LABEL_CODING = {\n system: SensorSettingsSystem,\n code: 'display_label',\n display: 'Display Label',\n};\n\nexport const DEVICE_OUTPUT_RATE_CODING = {\n system: 'urn:iso:std:iso:11073:10101',\n code: '68320',\n display: 'MDC_ATTR_SAMPLE_RATE',\n};\n\nexport const DEVICE_SENSOR_DELAY_CODING = {\n system: SensorSettingsSystem,\n code: 'sensor_delay',\n display: 'Sensor delay',\n};\n\nexport const SIGNAL_DURATION_CODING = {\n system: 'http://loinc.org',\n code: '8838-5',\n display: 'Observation duration',\n};\n\nexport const ANDROID_SENSORS_CONSTANT_NAMES = [\n 'SENSOR_DELAY_FASTEST',\n 'SENSOR_DELAY_GAME',\n 'SENSOR_DELAY_UI',\n 'SENSOR_DELAY_NORMAL',\n];\n","/**\n * Topic-id helpers shared by next-research-studio (authoring) and phoenix\n * (runtime). A topic's canonical URL ends in an identifier-safe id\n * (^[A-Za-z_][A-Za-z0-9_]*$): constrained from the start so ids stay stable,\n * are safe as index/map keys, and never need renaming or migration.\n *\n * NOTE: research-pillars (Go, pkg/fhir) mirrors `topicIdFromCanonical`; it\n * cannot import this module, so keep the two in sync by hand.\n */\nexport const TOPIC_ID_PATTERN = /^[A-Za-z_][A-Za-z0-9_]*$/;\n\n/** True if the id is identifier-safe (see {@link TOPIC_ID_PATTERN}). */\nexport const isValidTopicId = (id: string): boolean => TOPIC_ID_PATTERN.test(id);\n\n/** The topic id — the last path segment of a topic canonical URL. */\nexport const topicIdFromCanonical = (canonical: string): string =>\n canonical.substring(canonical.lastIndexOf('/') + 1);\n\n/** True if the canonical's id segment is identifier-safe. */\nexport const isValidTopicCanonical = (canonical: string): boolean =>\n isValidTopicId(topicIdFromCanonical(canonical));\n\n/**\n * The FHIR `valueCode` strings for a topic input's scope, in proto-enum order\n * (session=0, latest=1, all=2). These are the wire contract: they must equal\n * the grpc-modules `TopicScope` enum's JSON names\n */\nexport const TOPIC_SCOPE_CODES = ['session', 'latest', 'all'] as const;\n\nexport type TopicScopeCode = (typeof TOPIC_SCOPE_CODES)[number];\n\n/** True if `code` is a recognized topic scope valueCode. */\nexport const isValidTopicScope = (code: string): code is TopicScopeCode =>\n (TOPIC_SCOPE_CODES as readonly string[]).includes(code);\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Questionnaire, InputType, TopicInput, ItemVariable, QuestionImage } from '@d4l/grpc-modules/research-pillars';
|
|
2
|
+
|
|
3
|
+
type QuestionnaireMap = {
|
|
4
|
+
[language: string]: fhir5.Questionnaire;
|
|
5
|
+
};
|
|
6
|
+
declare const parseFHIRQuestionnaire: (fhirQuestionnaires: QuestionnaireMap) => Questionnaire;
|
|
7
|
+
|
|
8
|
+
type PostalCodeCountrySource = {
|
|
9
|
+
fromItem: string;
|
|
10
|
+
fixedCountry?: never;
|
|
11
|
+
} | {
|
|
12
|
+
fromItem?: never;
|
|
13
|
+
fixedCountry: {
|
|
14
|
+
system: string;
|
|
15
|
+
code: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type QuestionConfig = {
|
|
19
|
+
max?: number | string;
|
|
20
|
+
min?: number | string;
|
|
21
|
+
minLabel?: Record<string, string>;
|
|
22
|
+
maxLabel?: Record<string, string>;
|
|
23
|
+
step?: number;
|
|
24
|
+
orientation?: 'horizontal' | 'vertical';
|
|
25
|
+
inputLabel?: Record<string, string>;
|
|
26
|
+
minLength?: number;
|
|
27
|
+
maxLength?: number;
|
|
28
|
+
countrySource?: PostalCodeCountrySource;
|
|
29
|
+
placeholders?: string[];
|
|
30
|
+
};
|
|
31
|
+
declare const parseExtensions: (languages: string[], questionItems: {
|
|
32
|
+
[language: string]: fhir5.QuestionnaireItem;
|
|
33
|
+
}) => {
|
|
34
|
+
config: QuestionConfig;
|
|
35
|
+
inputType: InputType | undefined;
|
|
36
|
+
prepopulate: string[] | undefined;
|
|
37
|
+
input: TopicInput[];
|
|
38
|
+
output: string[];
|
|
39
|
+
itemVariables: ItemVariable[];
|
|
40
|
+
image: QuestionImage | undefined;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { type QuestionnaireMap, parseExtensions, parseFHIRQuestionnaire };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Questionnaire, InputType, TopicInput, ItemVariable, QuestionImage } from '@d4l/grpc-modules/research-pillars';
|
|
2
|
+
|
|
3
|
+
type QuestionnaireMap = {
|
|
4
|
+
[language: string]: fhir5.Questionnaire;
|
|
5
|
+
};
|
|
6
|
+
declare const parseFHIRQuestionnaire: (fhirQuestionnaires: QuestionnaireMap) => Questionnaire;
|
|
7
|
+
|
|
8
|
+
type PostalCodeCountrySource = {
|
|
9
|
+
fromItem: string;
|
|
10
|
+
fixedCountry?: never;
|
|
11
|
+
} | {
|
|
12
|
+
fromItem?: never;
|
|
13
|
+
fixedCountry: {
|
|
14
|
+
system: string;
|
|
15
|
+
code: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
type QuestionConfig = {
|
|
19
|
+
max?: number | string;
|
|
20
|
+
min?: number | string;
|
|
21
|
+
minLabel?: Record<string, string>;
|
|
22
|
+
maxLabel?: Record<string, string>;
|
|
23
|
+
step?: number;
|
|
24
|
+
orientation?: 'horizontal' | 'vertical';
|
|
25
|
+
inputLabel?: Record<string, string>;
|
|
26
|
+
minLength?: number;
|
|
27
|
+
maxLength?: number;
|
|
28
|
+
countrySource?: PostalCodeCountrySource;
|
|
29
|
+
placeholders?: string[];
|
|
30
|
+
};
|
|
31
|
+
declare const parseExtensions: (languages: string[], questionItems: {
|
|
32
|
+
[language: string]: fhir5.QuestionnaireItem;
|
|
33
|
+
}) => {
|
|
34
|
+
config: QuestionConfig;
|
|
35
|
+
inputType: InputType | undefined;
|
|
36
|
+
prepopulate: string[] | undefined;
|
|
37
|
+
input: TopicInput[];
|
|
38
|
+
output: string[];
|
|
39
|
+
itemVariables: ItemVariable[];
|
|
40
|
+
image: QuestionImage | undefined;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { type QuestionnaireMap, parseExtensions, parseFHIRQuestionnaire };
|