lforms 29.3.1 → 33.2.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.
Files changed (116) hide show
  1. package/CHANGELOG.md +256 -0
  2. package/README.md +97 -14
  3. package/changed-features.md +99 -0
  4. package/dist/lforms/LICENSE.md +70 -0
  5. package/dist/lforms/README.md +100 -0
  6. package/dist/lforms/fhir/R4/lformsFHIR.min.js +2 -0
  7. package/dist/lforms/fhir/R4/lformsFHIR.min.js.map +1 -0
  8. package/dist/lforms/fhir/STU3/lformsFHIR.min.js +2 -0
  9. package/dist/lforms/fhir/STU3/lformsFHIR.min.js.map +1 -0
  10. package/dist/lforms/fhir/lformsFHIRAll.min.js +2 -0
  11. package/dist/lforms/fhir/lformsFHIRAll.min.js.map +1 -0
  12. package/dist/lforms/webcomponent/assets/lib/zone.min.js +134 -0
  13. package/dist/lforms/webcomponent/down_arrow_gray_10_10.png +0 -0
  14. package/dist/lforms/webcomponent/favicon.ico +0 -0
  15. package/dist/lforms/webcomponent/index.html +9 -0
  16. package/dist/lforms/webcomponent/lhc-forms.js +2471 -0
  17. package/dist/lforms/webcomponent/magnifying_glass.png +0 -0
  18. package/dist/lforms/webcomponent/main.js +2464 -0
  19. package/dist/lforms/webcomponent/main.js.map +1 -0
  20. package/dist/lforms/webcomponent/polyfills.js +2 -0
  21. package/dist/lforms/webcomponent/polyfills.js.map +1 -0
  22. package/dist/lforms/webcomponent/runtime.js +2 -0
  23. package/dist/lforms/webcomponent/runtime.js.map +1 -0
  24. package/dist/lforms/webcomponent/scripts.js +3 -0
  25. package/dist/lforms/webcomponent/scripts.js.map +1 -0
  26. package/dist/lforms/webcomponent/styles.css +3 -0
  27. package/dist/lforms/webcomponent/styles.css.map +1 -0
  28. package/form_definition.md +382 -0
  29. package/lforms-33.2.0.tgz +0 -0
  30. package/package.json +94 -88
  31. package/r4-support.md +147 -0
  32. package/sdc-support.md +127 -0
  33. package/app/.npmignore +0 -3
  34. package/app/images/blank.gif +0 -0
  35. package/app/images/signal-stop.png +0 -0
  36. package/app/index.html +0 -10
  37. package/app/lforms.js +0 -56
  38. package/app/lforms.tpl.js +0 -964
  39. package/app/scripts/angular-packages.js +0 -11
  40. package/app/scripts/bootstrap-decorators.js +0 -31
  41. package/app/scripts/bower-index.js +0 -14
  42. package/app/scripts/fhir/R4/export.js +0 -33
  43. package/app/scripts/fhir/R4/fhirRequire.js +0 -36
  44. package/app/scripts/fhir/R4/lformsFHIR.js +0 -27260
  45. package/app/scripts/fhir/R4/sdc-export.js +0 -455
  46. package/app/scripts/fhir/R4/sdc-import.js +0 -483
  47. package/app/scripts/fhir/STU3/export.js +0 -27
  48. package/app/scripts/fhir/STU3/fhirRequire.js +0 -36
  49. package/app/scripts/fhir/STU3/lformsFHIR.js +0 -27291
  50. package/app/scripts/fhir/STU3/sdc-export.js +0 -493
  51. package/app/scripts/fhir/STU3/sdc-import.js +0 -494
  52. package/app/scripts/fhir/diagnostic-report.js +0 -707
  53. package/app/scripts/fhir/export-common.js +0 -209
  54. package/app/scripts/fhir/expression-processor.js +0 -670
  55. package/app/scripts/fhir/extensions/rendering-style.js +0 -23
  56. package/app/scripts/fhir/fhir-common.js +0 -3
  57. package/app/scripts/fhir/obs-prepop.mjs +0 -97
  58. package/app/scripts/fhir/runtime-common.js +0 -33
  59. package/app/scripts/fhir/sdc-common.js +0 -334
  60. package/app/scripts/fhir/sdc-export-common.js +0 -1046
  61. package/app/scripts/fhir/sdc-import-common.js +0 -1343
  62. package/app/scripts/fhir/versions.js +0 -8
  63. package/app/scripts/index.js +0 -20
  64. package/app/scripts/lforms-config.js +0 -12
  65. package/app/scripts/lforms-constants.js +0 -10
  66. package/app/scripts/lforms-controllers.js +0 -1196
  67. package/app/scripts/lforms-directives.js +0 -424
  68. package/app/scripts/lforms-index.js +0 -20
  69. package/app/scripts/lib/cross_browser.js +0 -21
  70. package/app/scripts/lib/lforms-data.js +0 -3591
  71. package/app/scripts/lib/lforms-hl7.js +0 -525
  72. package/app/scripts/lib/lforms-util.js +0 -1122
  73. package/app/scripts/lib/lforms-validate.js +0 -277
  74. package/app/scripts/lib/polyfill.js +0 -81
  75. package/app/scripts/themeList.js +0 -17
  76. package/app/styles/lforms.css +0 -1219
  77. package/app/styles/redmond-theme/README.txt +0 -2
  78. package/app/styles/redmond-theme/images/ui-bg_glass_75_d0e5f5_1x400.png +0 -0
  79. package/app/styles/redmond-theme/images/ui-bg_glass_85_dfeffc_1x400.png +0 -0
  80. package/app/styles/redmond-theme/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  81. package/app/styles/redmond-theme/images/ui-bg_gloss-wave_55_5c9ccc_500x100.png +0 -0
  82. package/app/styles/redmond-theme/images/ui-bg_inset-hard_100_f5f8f9_1x100.png +0 -0
  83. package/app/styles/redmond-theme/images/ui-bg_inset-hard_100_fcfdfd_1x100.png +0 -0
  84. package/app/styles/redmond-theme/images/ui-icons_217bc0_256x240.png +0 -0
  85. package/app/styles/redmond-theme/images/ui-icons_2e83ff_256x240.png +0 -0
  86. package/app/styles/redmond-theme/images/ui-icons_469bdd_256x240.png +0 -0
  87. package/app/styles/redmond-theme/images/ui-icons_6da8d5_256x240.png +0 -0
  88. package/app/styles/redmond-theme/images/ui-icons_cd0a0a_256x240.png +0 -0
  89. package/app/styles/redmond-theme/images/ui-icons_d8e7f3_256x240.png +0 -0
  90. package/app/styles/redmond-theme/images/ui-icons_f9bd01_256x240.png +0 -0
  91. package/app/styles/redmond-theme/jquery-ui.css +0 -1311
  92. package/app/styles/redmond-theme/jquery-ui.min.css +0 -7
  93. package/app/styles/redmond-theme/theme.css +0 -443
  94. package/app/styles/themes.css +0 -1541
  95. package/app/styles/themes.css.map +0 -9
  96. package/app/styles/themes.scss +0 -411
  97. package/app/version.json +0 -1
  98. package/app/views/partials/attachment.html +0 -38
  99. package/app/views/partials/field-answers.html +0 -67
  100. package/app/views/partials/field-units.html +0 -24
  101. package/app/views/partials/form-controls.html +0 -19
  102. package/app/views/partials/form-header.html +0 -35
  103. package/app/views/partials/form-options.html +0 -50
  104. package/app/views/partials/form-title.html +0 -20
  105. package/app/views/partials/form-view.html +0 -13
  106. package/app/views/partials/item-options.html +0 -48
  107. package/app/views/partials/item.html +0 -126
  108. package/app/views/partials/itemPrefixAndText.html +0 -4
  109. package/app/views/partials/layout-horizontal.html +0 -156
  110. package/app/views/partials/layout-matrix.html +0 -145
  111. package/app/views/partials/popover-content.html +0 -1
  112. package/app/views/partials/repeating-button.html +0 -16
  113. package/app/views/partials/table-item.html +0 -30
  114. package/app/views/partials/template-table.html +0 -69
  115. package/app/views/partials/uib-popover-templates/uib-popover-template.html +0 -13
  116. package/app/views/partials/uib-popover-templates/uib-popover.html +0 -11
@@ -1,209 +0,0 @@
1
- /* jshint -W097 */ // suppress jshint warning about strict
2
- /* jshint node: true */ // suppress warning about "require"
3
- "use strict";
4
-
5
- import {LOINC_URI} from './fhir-common';
6
- var LForms = require('../lforms-index');
7
-
8
- var _versionTagStr = 'lformsVersion: ';
9
-
10
- /**
11
- * Defines export functions that are the same across the different FHIR
12
- * versions and that are used by both the SDC and DiagnosticReport exports.
13
- */
14
- var self = {
15
-
16
- /**
17
- * Creates Observation resources from an LForms item object
18
- * @param item an LForms item object
19
- * @param setId (optional) a flag indicating if a unique ID should be set on the Observation resource
20
- * @returns {{}} an array of observation resources representing the values
21
- * stored in the item.
22
- * @private
23
- */
24
- _createObservation: function(item, setId) {
25
-
26
- var values = [];
27
-
28
- var dataType = item.dataType;
29
- // any item has a unit must be a numerical type, let use REAL for now.
30
- if ((!dataType || dataType==="ST") && item.units && item.units.length>0 ) {
31
- dataType = "REAL";
32
- }
33
- switch (dataType) {
34
- case "INT":
35
- values = [this._createObsIntValue(item)];
36
- break;
37
- case "REAL":
38
- // A "real" data type should be exported as valueQuantity, because
39
- // there is no valueDecimal for Observation (as of R4).
40
- case "QTY":
41
- var valValue = {value: item.value};
42
- this._setFHIRQuantityUnit(valValue, item.unit);
43
- values = [{
44
- key: "valueQuantity",
45
- val: valValue
46
- }];
47
- break;
48
- case "DT":
49
- values = [{
50
- key: "valueDate",
51
- val: item.value
52
- }];
53
- break;
54
- case "DTM":
55
- values = [{
56
- key: "valueDateTime",
57
- val: item.value
58
- }];
59
- break;
60
- case "CNE":
61
- case "CWE":
62
- var max = item.answerCardinality.max;
63
- // multiple values, each value creates a separate Observation resource
64
- var itemValues;
65
- if (max && (max === "*" || parseInt(max) > 1)) {
66
- itemValues = item.value;
67
- }
68
- else {
69
- itemValues = [item.value];
70
- }
71
- for (var j=0,jLen=itemValues.length; j<jLen; j++) {
72
- var val = itemValues[j];
73
- if (typeof val === "object") {
74
- var coding = {};
75
- if (val.code) coding.code = val.code;
76
- if (val.text) coding.display = val.text;
77
- var codeSystem = val.system;
78
- if (codeSystem) coding.system = LForms.Util.getCodeSystem(codeSystem);
79
- values.push(
80
- { key: "valueCodeableConcept",
81
- val: {
82
- "coding" : [coding],
83
- "text": coding.display
84
- }
85
- }
86
- );
87
- }
88
- else if (typeof val === "string") {
89
- if (val !== "") {
90
- values.push(
91
- { key: "valueString",
92
- val: val
93
- }
94
- );
95
- }
96
- }
97
- }
98
- break;
99
- case "attachment":
100
- values = [{
101
- key: "valueAttachment",
102
- val: item.value
103
- }];
104
- break;
105
- default:
106
- values = [{
107
- key: "valueString",
108
- val: item.value
109
- }];
110
- }
111
-
112
- var obxs = [];
113
- for(var i=0, iLen=values.length; i<iLen; i++) {
114
- var obx = {
115
- "resourceType": "Observation",
116
- "status": "final",
117
- "code": {
118
- "coding": item.codeList,
119
- "text": item.question
120
- }
121
- };
122
- this._addVersionTag(obx);
123
- if (setId) {
124
- obx.id = this._getUniqueId(item.questionCode);
125
- }
126
- if (!item.header) {
127
- obx[values[i].key] = values[i].val;
128
- }
129
- obxs.push(obx);
130
- }
131
- return obxs;
132
- },
133
-
134
-
135
- /**
136
- * Generate an almost unique ID for a given Observation code
137
- * @param prefix A prefix for the ID (e.g. a code or resource name)
138
- * @returns {string} a unique id
139
- * @private
140
- */
141
- _getUniqueId: function(prefix) {
142
- this._idCtr || (this._idCtr = 0);
143
- return prefix + "-" + Date.now() + '-' + ++this._idCtr + '-' +
144
- Math.random().toString(16).substr(2);
145
- },
146
-
147
-
148
- /**
149
- * Sets the unit for a Quantity.
150
- * @param qty the FHIR Quantity structure whose unit will be set. This
151
- * function assumes there is no unit information already set.
152
- * @param unit An LForms unit object.
153
- */
154
- _setFHIRQuantityUnit: function(qty, unit) {
155
- if (unit) {
156
- if (unit.name) qty.unit = unit.name;
157
- if (unit.code) qty.code = unit.code;
158
- if (unit.system) qty.system = unit.system;
159
- }
160
- },
161
-
162
-
163
- /**
164
- * Returns and creates if necessary the tag array object on the resource. If
165
- * created, the given resource will be modified.
166
- * @param res the resource whose tag array is needed.
167
- */
168
- _resTags: function(res) {
169
- var meta = res.meta;
170
- if (!meta)
171
- meta = (res.meta = {});
172
- var tag = meta.tag;
173
- if (!tag)
174
- tag = (meta.tag = []);
175
- return tag;
176
- },
177
-
178
-
179
- /**
180
- * Sets the LForms version tag on a FHIR resource to indicate the LForms version used to
181
- * export it. This will replace any version tag already present.
182
- * @param res the resource object to be tagged.
183
- */
184
- _setVersionTag: function(res) {
185
- var tags = this._resTags(res);
186
- // Delete any lformsVersion tag present. There should be at most one
187
- for (var i=0, len=tags.length; i<len; ++i) {
188
- var t = tags[i];
189
- if (t.code && t.code.indexOf(_versionTagStr)===0) {
190
- tags.splice(i, 1);
191
- break;
192
- }
193
- }
194
- this._addVersionTag(res);
195
- },
196
-
197
-
198
- /**
199
- * Adds a tag to a FHIR resource to indicate the LForms version used to
200
- * export it. Assumes the version tag does not already exist.
201
- * @param res the resource object to be tagged.
202
- */
203
- _addVersionTag: function(res) {
204
- var tag = this._resTags(res);
205
- tag.push({code: _versionTagStr+LForms.lformsVersion});
206
- }
207
- };
208
-
209
- export default self;