openchs-models 1.32.31 → 1.32.32
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/dist/Concept.js +7 -2
- package/dist/Observation.js +2 -0
- package/dist/ObservationsHolder.js +13 -1
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/Concept.js
CHANGED
|
@@ -267,11 +267,15 @@ class Concept extends _BaseEntity.default {
|
|
|
267
267
|
}
|
|
268
268
|
|
|
269
269
|
isMediaConcept() {
|
|
270
|
+
return _lodash.default.includes([Concept.dataType.Image, Concept.dataType.ImageV2, Concept.dataType.Video, Concept.dataType.File], this.datatype);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
isMediaSelectConcept() {
|
|
270
274
|
return _lodash.default.includes([Concept.dataType.Image, Concept.dataType.Video, Concept.dataType.File], this.datatype);
|
|
271
275
|
}
|
|
272
276
|
|
|
273
277
|
isSelectConcept() {
|
|
274
|
-
return this.isCodedConcept() || this.isSubjectConcept() || this.isEncounterConcept() || this.
|
|
278
|
+
return this.isCodedConcept() || this.isSubjectConcept() || this.isEncounterConcept() || this.isMediaSelectConcept();
|
|
275
279
|
}
|
|
276
280
|
|
|
277
281
|
isDurationConcept() {
|
|
@@ -406,6 +410,7 @@ _defineProperty(Concept, "dataType", {
|
|
|
406
410
|
Notes: "Notes",
|
|
407
411
|
NA: "NA",
|
|
408
412
|
Image: "Image",
|
|
413
|
+
ImageV2: "ImageV2",
|
|
409
414
|
Video: "Video",
|
|
410
415
|
Audio: "Audio",
|
|
411
416
|
Id: "Id",
|
|
@@ -418,7 +423,7 @@ _defineProperty(Concept, "dataType", {
|
|
|
418
423
|
Encounter: "Encounter",
|
|
419
424
|
|
|
420
425
|
get Media() {
|
|
421
|
-
return [this.Image, this.Video, this.Audio, this.File];
|
|
426
|
+
return [this.Image, this.ImageV2, this.Video, this.Audio, this.File];
|
|
422
427
|
}
|
|
423
428
|
|
|
424
429
|
});
|
package/dist/Observation.js
CHANGED
|
@@ -86,6 +86,8 @@ class Observation extends _PersistedObject.default {
|
|
|
86
86
|
return new _Displayable.default(valueWrapper.asDisplayDate(), null);
|
|
87
87
|
} else if (observation.concept.datatype === _Concept.default.dataType.Time) {
|
|
88
88
|
return new _Displayable.default(valueWrapper.asDisplayTime(), null);
|
|
89
|
+
} else if (observation.concept.datatype === _Concept.default.dataType.ImageV2) {
|
|
90
|
+
return new _Displayable.default(JSON.parse(valueWrapper.getValue()), null);
|
|
89
91
|
} else if (valueWrapper.isSingleCoded) {
|
|
90
92
|
if (observation.concept.datatype === _Concept.default.dataType.Subject) {
|
|
91
93
|
const uuid = valueWrapper.getValue();
|
|
@@ -489,7 +489,19 @@ class ObservationsHolder {
|
|
|
489
489
|
if (observation) {
|
|
490
490
|
const valueWrapper = observation.getValueWrapper();
|
|
491
491
|
|
|
492
|
-
if (
|
|
492
|
+
if (observation.concept.datatype === _Concept.default.dataType.ImageV2) {
|
|
493
|
+
const mediaObjects = JSON.parse(valueWrapper.getValue());
|
|
494
|
+
|
|
495
|
+
const newAnswers = _lodash.default.map(mediaObjects, mediaObject => {
|
|
496
|
+
if (mediaObject.uri === oldValue) {
|
|
497
|
+
mediaObject.uri = newValue;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
return mediaObject;
|
|
501
|
+
});
|
|
502
|
+
|
|
503
|
+
observation.valueJSON = new _PrimitiveValue.default(JSON.stringify(newAnswers), _Concept.default.dataType.ImageV2);
|
|
504
|
+
} else if (valueWrapper.isMultipleCoded) {
|
|
493
505
|
const answers = valueWrapper.getValue();
|
|
494
506
|
|
|
495
507
|
const oldValueIndex = _lodash.default.indexOf(answers, oldValue);
|
package/dist/index.js
CHANGED
|
@@ -165,6 +165,12 @@ Object.defineProperty(exports, "FormMapping", {
|
|
|
165
165
|
return _FormMapping.default;
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
|
+
Object.defineProperty(exports, "findMediaObservations", {
|
|
169
|
+
enumerable: true,
|
|
170
|
+
get: function () {
|
|
171
|
+
return _Media.findMediaObservations;
|
|
172
|
+
}
|
|
173
|
+
});
|
|
168
174
|
Object.defineProperty(exports, "MenuItem", {
|
|
169
175
|
enumerable: true,
|
|
170
176
|
get: function () {
|
|
@@ -864,6 +870,8 @@ var _Form = _interopRequireDefault(require("./application/Form"));
|
|
|
864
870
|
|
|
865
871
|
var _FormMapping = _interopRequireDefault(require("./application/FormMapping"));
|
|
866
872
|
|
|
873
|
+
var _Media = require("./Media");
|
|
874
|
+
|
|
867
875
|
var _MenuItem = _interopRequireDefault(require("./application/MenuItem"));
|
|
868
876
|
|
|
869
877
|
var _Gender = _interopRequireDefault(require("./Gender"));
|