formbuilder-lhcforms 12.9.0 → 12.10.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/README.md +50 -0
- package/dist/formbuilder-lhcforms/assets/fl-fields-layout.json5 +38 -0
- package/dist/formbuilder-lhcforms/assets/lforms-config.json5 +18 -0
- package/dist/formbuilder-lhcforms/assets/version.json +1 -1
- package/dist/formbuilder-lhcforms/index.html +1 -1
- package/dist/formbuilder-lhcforms/{main.dd0ec5f4ab3ef14c.js → main.82ff277b674bb593.js} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -87,6 +87,56 @@ cp .env .env.local
|
|
|
87
87
|
|
|
88
88
|
The npm scripts automatically load `.env` plus `.env.local` (when present), with `.env.local` taking precedence.
|
|
89
89
|
|
|
90
|
+
### Choosing the LHC-Forms version and server
|
|
91
|
+
|
|
92
|
+
By default, the form builder loads the latest version of LHC-Forms from
|
|
93
|
+
https://lhcforms-static.nlm.nih.gov/lforms-versions/ at run time. To change that, set `source` and/or
|
|
94
|
+
`version` in `assets/lforms-config.json5`. Edit `src/assets/lforms-config.json5` before building, or the copy
|
|
95
|
+
in the `assets` folder of the built application. The file is in [JSON5](https://json5.org/) format, and its
|
|
96
|
+
comments describe both values.
|
|
97
|
+
|
|
98
|
+
To load a specific version from the NLM server, set only `version`:
|
|
99
|
+
|
|
100
|
+
```json5
|
|
101
|
+
{
|
|
102
|
+
source: "",
|
|
103
|
+
version: "44.1.0"
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
To use a fixed copy served by your own server instead (for example a version that matches the forms renderer
|
|
108
|
+
of your application), set both values:
|
|
109
|
+
|
|
110
|
+
```json5
|
|
111
|
+
{
|
|
112
|
+
// Base URL of the LHC-Forms files.
|
|
113
|
+
source: "/path/to/lforms-44.1.0",
|
|
114
|
+
// X.Y.Z version of the LHC-Forms files at source.
|
|
115
|
+
version: "44.1.0"
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
`source` is the base URL of the extracted
|
|
120
|
+
[LHC-Forms release](https://lhcforms-static.nlm.nih.gov/lforms-versions/) (or of `dist/lforms` of the
|
|
121
|
+
`lforms` npm package). A relative URL is resolved against the form builder's base URL (`<base href>`), and
|
|
122
|
+
`/` is the root of the server. The base URL must contain `webcomponent/styles.css`,
|
|
123
|
+
`webcomponent/assets/lib/zone.min.js`, `webcomponent/lhc-forms.js` and `fhir/lformsFHIRAll.min.js`. `version`
|
|
124
|
+
must be the `X.Y.Z` version, 37.0.0 or later, of that copy, or of the release on the NLM server if `source` is
|
|
125
|
+
not set; older versions lack features the form builder requires, such as FHIR R5 support. The form builder
|
|
126
|
+
logs a warning in the browser console if the version of the loaded copy differs from `version`. Use a recent
|
|
127
|
+
LHC-Forms version; the form builder is developed and tested with the latest one.
|
|
128
|
+
|
|
129
|
+
The default behavior applies if the file is missing or empty, or if both values are empty or omitted. It also
|
|
130
|
+
applies if the file cannot be read: on an HTTP error other than 404, the form builder logs a warning in the
|
|
131
|
+
browser console and loads the latest version from the NLM server, even if the file sets `source`. A response
|
|
132
|
+
with the content type `text/html` is treated as a missing file, without a warning, because single-page
|
|
133
|
+
application servers return their HTML page for missing files. Make sure the file is served as-is (for
|
|
134
|
+
example, not behind a login page) if your deployment must not load LHC-Forms from the NLM server. If the
|
|
135
|
+
file is not valid JSON5, has `source` without `version`, or has an invalid `version`, the form builder reports
|
|
136
|
+
an error instead of loading LHC-Forms. It also reports an error, without falling back to another version, if
|
|
137
|
+
the configured version cannot be loaded. Browsers may cache the file, so configure your server to revalidate
|
|
138
|
+
it if you change it after deployment.
|
|
139
|
+
|
|
90
140
|
## **Contributing**
|
|
91
141
|
- If you plan to contribute new functionality, it is important to coordinate with the maintainers to ensure proper integration and to avoid duplicating efforts. Reach out to the maintainers for guidance on contributing.
|
|
92
142
|
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
{ field: "identifier", col: 12},
|
|
24
24
|
{ field: "meta", col: 12},
|
|
25
25
|
{ field: "useContext", col: 12},
|
|
26
|
+
{ field: "jurisdiction", col: 12},
|
|
26
27
|
{ field: "subjectType", "col": 12},
|
|
27
28
|
{ field: "date", col: 12},
|
|
28
29
|
{ field: "publisher", col: 12},
|
|
@@ -49,6 +50,11 @@
|
|
|
49
50
|
'$.properties.meta': 'Meta',
|
|
50
51
|
'$.properties.useContext': 'Usage Context',
|
|
51
52
|
'$.properties.useContext.items.properties.__$valueSummary': 'Value',
|
|
53
|
+
'$.properties.jurisdiction.items.properties.text': 'Text',
|
|
54
|
+
'$.properties.jurisdiction.items.properties.coding': 'Coding',
|
|
55
|
+
'$.properties.jurisdiction.items.properties.coding.items.properties.display': 'Display',
|
|
56
|
+
'$.properties.jurisdiction.items.properties.coding.items.properties.code': 'Code',
|
|
57
|
+
'$.properties.jurisdiction.items.properties.coding.items.properties.system': 'System',
|
|
52
58
|
'$.definitions.Meta.properties.versionId': 'Version ID (Read-only)',
|
|
53
59
|
'$.definitions.Meta.properties.lastUpdated': 'Last updated (Read-only)',
|
|
54
60
|
'$.definitions.Meta.properties.source': 'Source',
|
|
@@ -64,6 +70,7 @@
|
|
|
64
70
|
inputBox: 'formStringField',
|
|
65
71
|
textArea: 'formTextareaField',
|
|
66
72
|
inlineTextArea: 'formInlineTextareaField',
|
|
73
|
+
jurisdictionCoding: 'dialogCodingTable',
|
|
67
74
|
instant: 'formInstantField',
|
|
68
75
|
'positive-integer': 'formPositiveIntegerField',
|
|
69
76
|
'unsigned-integer': 'formUnsignedIntegerField'
|
|
@@ -185,6 +192,24 @@
|
|
|
185
192
|
{"field": "__$valueSummary", "title": "Value", "col": 4, "nolabel": true}
|
|
186
193
|
]
|
|
187
194
|
},
|
|
195
|
+
jurisdiction: {
|
|
196
|
+
"id": "array",
|
|
197
|
+
"addDefaultItemIfEmpty": false,
|
|
198
|
+
"labelPosition": "left",
|
|
199
|
+
"labelClasses": "col-sm-2 ps-0 pe-1",
|
|
200
|
+
"controlClasses": "col-sm-10",
|
|
201
|
+
"addButtonLabel": "Add jurisdiction",
|
|
202
|
+
"noCollapseButton": true
|
|
203
|
+
},
|
|
204
|
+
jurisdictionConcept: {
|
|
205
|
+
"id": "lfb-object",
|
|
206
|
+
"nolabel": true,
|
|
207
|
+
"childOffsetClass": "ms-0",
|
|
208
|
+
"showFields": [
|
|
209
|
+
{"field": "text", "col": 12},
|
|
210
|
+
{"field": "coding", "col": 12}
|
|
211
|
+
]
|
|
212
|
+
},
|
|
188
213
|
contained: {
|
|
189
214
|
"id": "contained",
|
|
190
215
|
"addEditAction": true,
|
|
@@ -289,9 +314,13 @@
|
|
|
289
314
|
'$.properties.publisher',
|
|
290
315
|
'$.definitions.Meta.properties.versionId',
|
|
291
316
|
'$.definitions.Meta.properties.lastUpdated',
|
|
317
|
+
'$.properties.jurisdiction.items.properties.text',
|
|
318
|
+
'$.properties.jurisdiction.items.properties.coding.items.properties.display',
|
|
319
|
+
'$.properties.jurisdiction.items.properties.coding.items.properties.code',
|
|
292
320
|
],
|
|
293
321
|
url: [
|
|
294
322
|
'$.definitions.Meta.properties.source',
|
|
323
|
+
'$.properties.jurisdiction.items.properties.coding.items.properties.system',
|
|
295
324
|
],
|
|
296
325
|
inlineTextArea: [
|
|
297
326
|
'$.properties.description',
|
|
@@ -328,6 +357,15 @@
|
|
|
328
357
|
usageContext: [
|
|
329
358
|
'$.properties.useContext'
|
|
330
359
|
],
|
|
360
|
+
jurisdiction: [
|
|
361
|
+
'$.properties.jurisdiction'
|
|
362
|
+
],
|
|
363
|
+
jurisdictionConcept: [
|
|
364
|
+
'$.properties.jurisdiction.items'
|
|
365
|
+
],
|
|
366
|
+
jurisdictionCoding: [
|
|
367
|
+
'$.properties.jurisdiction.items.properties.coding'
|
|
368
|
+
],
|
|
331
369
|
extension: [
|
|
332
370
|
'$.properties.extension'
|
|
333
371
|
],
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
// Optional: choose the LHC-Forms version and the server it is loaded from.
|
|
3
|
+
// - Both values empty (default): the latest version from
|
|
4
|
+
// https://lhcforms-static.nlm.nih.gov/lforms-versions/.
|
|
5
|
+
// - Only version set: that version from the same NLM server.
|
|
6
|
+
// - Both values set: your own copy of LHC-Forms at source. source requires version.
|
|
7
|
+
// See "Choosing the LHC-Forms version and server" in README.md.
|
|
8
|
+
|
|
9
|
+
// Base URL of the LHC-Forms files, e.g. "/lforms/44.1.0" or "https://example.org/lforms/44.1.0".
|
|
10
|
+
// A relative URL is resolved against the form builder's base URL (<base href>); "/" is the server
|
|
11
|
+
// root. It must contain webcomponent/styles.css, webcomponent/assets/lib/zone.min.js,
|
|
12
|
+
// webcomponent/lhc-forms.js and fhir/lformsFHIRAll.min.js.
|
|
13
|
+
source: "",
|
|
14
|
+
|
|
15
|
+
// X.Y.Z version of LHC-Forms, 37.0.0 or later, e.g. "44.1.0": the version of the files at source,
|
|
16
|
+
// or, without source, the version to load from the NLM server.
|
|
17
|
+
version: ""
|
|
18
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version": "12.
|
|
1
|
+
{"version": "12.10.0"}
|
|
@@ -19,6 +19,6 @@
|
|
|
19
19
|
<body class="bg-secondary">
|
|
20
20
|
<lfb-root></lfb-root>
|
|
21
21
|
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
|
22
|
-
<script src="runtime.821ff28674267dd4.js" type="module"></script><script src="polyfills.741ec81967e9c9c3.js" type="module"></script><script src="scripts.5c83cbb4dbb11a83.js" defer></script><script src="main.
|
|
22
|
+
<script src="runtime.821ff28674267dd4.js" type="module"></script><script src="polyfills.741ec81967e9c9c3.js" type="module"></script><script src="scripts.5c83cbb4dbb11a83.js" defer></script><script src="main.82ff277b674bb593.js" type="module"></script></body>
|
|
23
23
|
</html>
|
|
24
24
|
|