@openmrs/ngx-formentry 3.0.1-pre.25 → 3.0.1-pre.38
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/bundles/openmrs-ngx-formentry.umd.js +291 -284
- package/bundles/openmrs-ngx-formentry.umd.js.map +1 -1
- package/bundles/openmrs-ngx-formentry.umd.min.js +16 -1
- package/bundles/openmrs-ngx-formentry.umd.min.js.map +1 -1
- package/esm2015/components/date-time-picker/date-picker/date-picker.component.js +1 -1
- package/esm2015/components/date-time-picker/time-picker/time-picker.component.js +1 -1
- package/esm2015/form-entry/form-factory/form-node.js +1 -1
- package/esm2015/form-entry/form-factory/form.factory.js +4 -1
- package/esm2015/form-entry/form-factory/question.factory.js +22 -1
- package/esm2015/form-entry/question-models/question-base.js +1 -1
- package/esm2015/form-entry/value-adapters/encounter.adapter.js +1 -1
- package/esm2015/form-entry/value-adapters/obs-adapter-helper.js +24 -4
- package/fesm2015/openmrs-ngx-formentry.js +168 -126
- package/fesm2015/openmrs-ngx-formentry.js.map +1 -1
- package/form-entry/form-factory/form-node.d.ts +1 -0
- package/form-entry/form-factory/form.factory.d.ts +1 -0
- package/form-entry/form-factory/question.factory.d.ts +1 -0
- package/form-entry/question-models/question-base.d.ts +1 -0
- package/form-entry/value-adapters/obs-adapter-helper.d.ts +4 -0
- package/openmrs-ngx-formentry.metadata.json +1 -1
- package/package.json +1 -1
|
@@ -1,32 +1,12 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
2
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('rxjs'), require('moment'), require('lodash'), require('@angular/animations'), require('@ng-select/ng-select'), require('@angular/platform-browser'), require('ngx-webcam'), require('ngx-file-uploader'), require('@angular/cdk/a11y'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/cdk/keycodes'), require('@angular/cdk/coercion'), require('rxjs/operators'), require('@angular/cdk/platform'), require('@angular-extensions/elements')) :
|
|
3
3
|
typeof define === 'function' && define.amd ? define('@openmrs/ngx-formentry', ['exports', '@angular/core', '@angular/common', '@angular/forms', 'rxjs', 'moment', 'lodash', '@angular/animations', '@ng-select/ng-select', '@angular/platform-browser', 'ngx-webcam', 'ngx-file-uploader', '@angular/cdk/a11y', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/cdk/keycodes', '@angular/cdk/coercion', 'rxjs/operators', '@angular/cdk/platform', '@angular-extensions/elements'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.openmrs = global.openmrs || {}, global.openmrs[
|
|
5
|
-
}
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.openmrs = global.openmrs || {}, global.openmrs['ngx-formentry'] = {}), global.ng.core, global.ng.common, global.ng.forms, global.rxjs, global.moment, global._, global.ng.animations, global.ngSelect, global.ng.platformBrowser, global.ngxWebcam, global.ngxFileUploader, global.ng.cdk.a11y, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.cdk.keycodes, global.ng.cdk.coercion, global.rxjs.operators, global.ng.cdk.platform, global.elements));
|
|
5
|
+
}(this, (function (exports, i0, common, forms, rxjs, moment, _, animations, ngSelect, platformBrowser, ngxWebcam, ngxFileUploader, a11y, overlay, portal, keycodes, coercion, operators, platform, elements) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
8
8
|
|
|
9
|
-
function _interopNamespace(e) {
|
|
10
|
-
if (e && e.__esModule) return e;
|
|
11
|
-
var n = Object.create(null);
|
|
12
|
-
if (e) {
|
|
13
|
-
Object.keys(e).forEach(function (k) {
|
|
14
|
-
if (k !== 'default') {
|
|
15
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
16
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
17
|
-
enumerable: true,
|
|
18
|
-
get: function () { return e[k]; }
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
n["default"] = e;
|
|
24
|
-
return Object.freeze(n);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
28
9
|
var moment__default = /*#__PURE__*/_interopDefaultLegacy(moment);
|
|
29
|
-
var ___namespace = /*#__PURE__*/_interopNamespace(_);
|
|
30
10
|
var ___default = /*#__PURE__*/_interopDefaultLegacy(_);
|
|
31
11
|
|
|
32
12
|
/*
|
|
@@ -176,7 +156,7 @@
|
|
|
176
156
|
{ type: i0.Injectable }
|
|
177
157
|
];
|
|
178
158
|
|
|
179
|
-
|
|
159
|
+
/*! *****************************************************************************
|
|
180
160
|
Copyright (c) Microsoft Corporation.
|
|
181
161
|
|
|
182
162
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
@@ -338,11 +318,7 @@
|
|
|
338
318
|
var __createBinding = Object.create ? (function (o, m, k, k2) {
|
|
339
319
|
if (k2 === undefined)
|
|
340
320
|
k2 = k;
|
|
341
|
-
|
|
342
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
343
|
-
desc = { enumerable: true, get: function () { return m[k]; } };
|
|
344
|
-
}
|
|
345
|
-
Object.defineProperty(o, k2, desc);
|
|
321
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
|
|
346
322
|
}) : (function (o, m, k, k2) {
|
|
347
323
|
if (k2 === undefined)
|
|
348
324
|
k2 = k;
|
|
@@ -406,16 +382,10 @@
|
|
|
406
382
|
r[k] = a[j];
|
|
407
383
|
return r;
|
|
408
384
|
}
|
|
409
|
-
function __spreadArray(to, from
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
if (!ar)
|
|
414
|
-
ar = Array.prototype.slice.call(from, 0, i);
|
|
415
|
-
ar[i] = from[i];
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
385
|
+
function __spreadArray(to, from) {
|
|
386
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
387
|
+
to[j] = from[i];
|
|
388
|
+
return to;
|
|
419
389
|
}
|
|
420
390
|
function __await(v) {
|
|
421
391
|
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
|
@@ -497,11 +467,6 @@
|
|
|
497
467
|
throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
498
468
|
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
499
469
|
}
|
|
500
|
-
function __classPrivateFieldIn(state, receiver) {
|
|
501
|
-
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function"))
|
|
502
|
-
throw new TypeError("Cannot use 'in' operator on non-object");
|
|
503
|
-
return typeof state === "function" ? receiver === state : state.has(receiver);
|
|
504
|
-
}
|
|
505
470
|
|
|
506
471
|
// import { CanHide } from '../form-entry/control-hiders-disablers/can-hide';
|
|
507
472
|
// import { CanDisable } from '../form-entry/control-hiders-disablers/can-disable';
|
|
@@ -1124,7 +1089,7 @@
|
|
|
1124
1089
|
if (control.uuid) {
|
|
1125
1090
|
scope[control.uuid] = control.value;
|
|
1126
1091
|
}
|
|
1127
|
-
window['moment'] = moment__default[
|
|
1092
|
+
window['moment'] = moment__default['default'];
|
|
1128
1093
|
// scope.moment = moment;
|
|
1129
1094
|
scope['myValue'] = control.value;
|
|
1130
1095
|
scope['FORM'] = {};
|
|
@@ -1541,7 +1506,6 @@
|
|
|
1541
1506
|
return AfeFormArray;
|
|
1542
1507
|
}(forms.FormArray));
|
|
1543
1508
|
|
|
1544
|
-
exports.AfeControlType = void 0;
|
|
1545
1509
|
(function (AfeControlType) {
|
|
1546
1510
|
AfeControlType[AfeControlType["AfeFormControl"] = 0] = "AfeFormControl";
|
|
1547
1511
|
AfeControlType[AfeControlType["AfeFormArray"] = 1] = "AfeFormArray";
|
|
@@ -1834,7 +1798,7 @@
|
|
|
1834
1798
|
if (height && weight) {
|
|
1835
1799
|
bmi = (weight / (((height / 100) * height) / 100)).toFixed(1);
|
|
1836
1800
|
}
|
|
1837
|
-
var refSectionObject =
|
|
1801
|
+
var refSectionObject = _.first(bmiForAgeRef);
|
|
1838
1802
|
var formattedSDValue;
|
|
1839
1803
|
if (refSectionObject) {
|
|
1840
1804
|
var refObjectValues = Object.keys(refSectionObject)
|
|
@@ -1847,14 +1811,14 @@
|
|
|
1847
1811
|
minReferencePoint_1.push(minimumValue);
|
|
1848
1812
|
}
|
|
1849
1813
|
else {
|
|
1850
|
-
|
|
1814
|
+
_.forEach(refObjectValues, function (value) {
|
|
1851
1815
|
if (value <= bmi) {
|
|
1852
1816
|
minReferencePoint_1.push(value);
|
|
1853
1817
|
}
|
|
1854
1818
|
});
|
|
1855
1819
|
}
|
|
1856
|
-
var lastReferenceValue_1 =
|
|
1857
|
-
var lastValueIndex =
|
|
1820
|
+
var lastReferenceValue_1 = _.last(minReferencePoint_1);
|
|
1821
|
+
var lastValueIndex = _.findIndex(refObjectValues, function (o) {
|
|
1858
1822
|
return o === lastReferenceValue_1;
|
|
1859
1823
|
});
|
|
1860
1824
|
var SDValue = refObjectKeys[lastValueIndex];
|
|
@@ -1884,11 +1848,11 @@
|
|
|
1884
1848
|
formattedSDValue = -4;
|
|
1885
1849
|
}
|
|
1886
1850
|
else {
|
|
1887
|
-
refSection =
|
|
1851
|
+
refSection = _.filter(weightForHeightRef, function (refObject) {
|
|
1888
1852
|
return parseFloat(refObject['Length']).toFixed(1) === height;
|
|
1889
1853
|
});
|
|
1890
1854
|
}
|
|
1891
|
-
var refSectionObject =
|
|
1855
|
+
var refSectionObject = _.first(refSection);
|
|
1892
1856
|
if (refSectionObject) {
|
|
1893
1857
|
var refObjectValues = Object.keys(refSectionObject)
|
|
1894
1858
|
.map(function (key) { return refSectionObject[key]; })
|
|
@@ -1900,14 +1864,14 @@
|
|
|
1900
1864
|
minReferencePoint_2.push(minimumValue);
|
|
1901
1865
|
}
|
|
1902
1866
|
else {
|
|
1903
|
-
|
|
1867
|
+
_.forEach(refObjectValues, function (value) {
|
|
1904
1868
|
if (value <= weight) {
|
|
1905
1869
|
minReferencePoint_2.push(value);
|
|
1906
1870
|
}
|
|
1907
1871
|
});
|
|
1908
1872
|
}
|
|
1909
|
-
var lastReferenceValue_2 =
|
|
1910
|
-
var lastValueIndex =
|
|
1873
|
+
var lastReferenceValue_2 = _.last(minReferencePoint_2);
|
|
1874
|
+
var lastValueIndex = _.findIndex(refObjectValues, function (o) {
|
|
1911
1875
|
return o === lastReferenceValue_2;
|
|
1912
1876
|
});
|
|
1913
1877
|
var SDValue = refObjectKeys[lastValueIndex];
|
|
@@ -1926,7 +1890,7 @@
|
|
|
1926
1890
|
return height && weight ? formattedSDValue : null;
|
|
1927
1891
|
};
|
|
1928
1892
|
JsExpressionHelper.prototype.calcHeightForAgeZscore = function (heightForAgeRef, height, weight) {
|
|
1929
|
-
var refSectionObject =
|
|
1893
|
+
var refSectionObject = _.first(heightForAgeRef);
|
|
1930
1894
|
var formattedSDValue;
|
|
1931
1895
|
if (refSectionObject) {
|
|
1932
1896
|
var refObjectValues = Object.keys(refSectionObject)
|
|
@@ -1939,14 +1903,14 @@
|
|
|
1939
1903
|
minReferencePoint_3.push(minimumValue);
|
|
1940
1904
|
}
|
|
1941
1905
|
else {
|
|
1942
|
-
|
|
1906
|
+
_.forEach(refObjectValues, function (value) {
|
|
1943
1907
|
if (value <= height) {
|
|
1944
1908
|
minReferencePoint_3.push(value);
|
|
1945
1909
|
}
|
|
1946
1910
|
});
|
|
1947
1911
|
}
|
|
1948
|
-
var lastReferenceValue_3 =
|
|
1949
|
-
var lastValueIndex =
|
|
1912
|
+
var lastReferenceValue_3 = _.last(minReferencePoint_3);
|
|
1913
|
+
var lastValueIndex = _.findIndex(refObjectValues, function (o) {
|
|
1950
1914
|
return o === lastReferenceValue_3;
|
|
1951
1915
|
});
|
|
1952
1916
|
var SDValue = refObjectKeys[lastValueIndex];
|
|
@@ -2108,7 +2072,7 @@
|
|
|
2108
2072
|
var _this = this;
|
|
2109
2073
|
var list = [];
|
|
2110
2074
|
if (question.validators) {
|
|
2111
|
-
|
|
2075
|
+
_.forEach(question.validators, function (validator) {
|
|
2112
2076
|
switch (validator.type) {
|
|
2113
2077
|
case 'date':
|
|
2114
2078
|
list.push(_this.dateValidator);
|
|
@@ -2734,7 +2698,7 @@
|
|
|
2734
2698
|
ErrorRendererComponent.prototype.announceErrorField = function (errorNode) {
|
|
2735
2699
|
var _this = this;
|
|
2736
2700
|
var nodes = this.form.searchNodeByQuestionId(errorNode.path.substring(0, errorNode.path.indexOf('.')));
|
|
2737
|
-
|
|
2701
|
+
_.forEach(nodes, function (node) {
|
|
2738
2702
|
if (node.question.renderingType === 'page') {
|
|
2739
2703
|
var pageIndex = _this.getPageIndex(node);
|
|
2740
2704
|
_this.formErrorsService.announceErrorField(pageIndex + ',' + errorNode.question.key);
|
|
@@ -2769,10 +2733,10 @@
|
|
|
2769
2733
|
HistoricalFieldHelperService.prototype.getDisplayTextFromOptions = function (question, valueProperty, displayProperty) {
|
|
2770
2734
|
var displayText = '';
|
|
2771
2735
|
var historicalValue = question.historicalDataValue;
|
|
2772
|
-
if (
|
|
2736
|
+
if (_.isArray(historicalValue.value)) {
|
|
2773
2737
|
var valueConverted_1 = 0;
|
|
2774
|
-
|
|
2775
|
-
|
|
2738
|
+
_.each(historicalValue.value, function (val) {
|
|
2739
|
+
_.each(question.options, function (option) {
|
|
2776
2740
|
if (option[valueProperty] === val) {
|
|
2777
2741
|
if (valueConverted_1 === 0) {
|
|
2778
2742
|
displayText = displayText + option[displayProperty];
|
|
@@ -2786,7 +2750,7 @@
|
|
|
2786
2750
|
});
|
|
2787
2751
|
}
|
|
2788
2752
|
else {
|
|
2789
|
-
|
|
2753
|
+
_.each(question.options, function (option) {
|
|
2790
2754
|
if (option[valueProperty] === historicalValue.value) {
|
|
2791
2755
|
displayText = option[displayProperty];
|
|
2792
2756
|
}
|
|
@@ -2830,7 +2794,7 @@
|
|
|
2830
2794
|
if (node) {
|
|
2831
2795
|
this._node = node;
|
|
2832
2796
|
if (this._node.question.enableHistoricalValue &&
|
|
2833
|
-
!
|
|
2797
|
+
!_.isUndefined(this._node.question.historicalDataValue)) {
|
|
2834
2798
|
var display = { text: '', _date: '' };
|
|
2835
2799
|
if (this._node.question.renderingType === 'select' ||
|
|
2836
2800
|
this._node.question.renderingType === 'multi-select' ||
|
|
@@ -2839,7 +2803,7 @@
|
|
|
2839
2803
|
display._date = this._node.question.historicalDataValue.valueDate;
|
|
2840
2804
|
this._node.question['historicalDisplay'] = display;
|
|
2841
2805
|
}
|
|
2842
|
-
else if (!
|
|
2806
|
+
else if (!_.isUndefined(this._node.question.historicalDataValue)) {
|
|
2843
2807
|
display.text = this._node.question.historicalDataValue.value;
|
|
2844
2808
|
display._date = this._node.question.historicalDataValue.valueDate;
|
|
2845
2809
|
this._node.question['historicalDisplay'] = display;
|
|
@@ -3537,13 +3501,13 @@
|
|
|
3537
3501
|
this.onDisplayMonths = false;
|
|
3538
3502
|
this.onDisplayYears = false;
|
|
3539
3503
|
this.displayYearsIndex = 0;
|
|
3540
|
-
this.monthsShort = moment__default[
|
|
3504
|
+
this.monthsShort = moment__default['default'].monthsShort();
|
|
3541
3505
|
}
|
|
3542
3506
|
DatePickerComponent.prototype.ngOnInit = function () {
|
|
3543
3507
|
var _this = this;
|
|
3544
3508
|
this.initValue();
|
|
3545
3509
|
// default to current year range
|
|
3546
|
-
___default[
|
|
3510
|
+
___default['default'].each(this.fullYearRange, function (v, i) {
|
|
3547
3511
|
_this.currentYear = _this.calendarDate.clone().startOf('year').year();
|
|
3548
3512
|
if (v.indexOf(_this.currentYear) !== -1) {
|
|
3549
3513
|
_this.displayYearsIndex = i;
|
|
@@ -3605,7 +3569,7 @@
|
|
|
3605
3569
|
this.generateCalendar();
|
|
3606
3570
|
};
|
|
3607
3571
|
DatePickerComponent.prototype.selectToday = function () {
|
|
3608
|
-
var today = this.parseToReturnObjectType(moment__default[
|
|
3572
|
+
var today = this.parseToReturnObjectType(moment__default['default']());
|
|
3609
3573
|
this.onSelectDate.emit(today);
|
|
3610
3574
|
this.cancelDatePicker();
|
|
3611
3575
|
return;
|
|
@@ -3620,34 +3584,34 @@
|
|
|
3620
3584
|
return;
|
|
3621
3585
|
};
|
|
3622
3586
|
DatePickerComponent.prototype.generateYears = function () {
|
|
3623
|
-
var currentYear = moment__default[
|
|
3587
|
+
var currentYear = moment__default['default']().year();
|
|
3624
3588
|
var startYr = this.calendarDate.clone().subtract(100, 'y').year();
|
|
3625
3589
|
// const endYr = this.calendarDate.clone().add(10, 'y').year();
|
|
3626
3590
|
var years = [];
|
|
3627
3591
|
for (var year = startYr; year <= currentYear; year++) {
|
|
3628
3592
|
years.push(year);
|
|
3629
3593
|
}
|
|
3630
|
-
this.fullYearRange = ___default[
|
|
3594
|
+
this.fullYearRange = ___default['default'].chunk(years, 14);
|
|
3631
3595
|
};
|
|
3632
3596
|
DatePickerComponent.prototype.initValue = function () {
|
|
3633
3597
|
// set moment locale (default is en)
|
|
3634
|
-
moment__default[
|
|
3598
|
+
moment__default['default'].locale(this.locale);
|
|
3635
3599
|
// set today value
|
|
3636
|
-
this.today = moment__default[
|
|
3637
|
-
this.currentMonth = this.monthsShort[moment__default[
|
|
3638
|
-
this.currentYear = moment__default[
|
|
3600
|
+
this.today = moment__default['default']().startOf('date');
|
|
3601
|
+
this.currentMonth = this.monthsShort[moment__default['default']().month()];
|
|
3602
|
+
this.currentYear = moment__default['default']().year();
|
|
3639
3603
|
// set week days name array
|
|
3640
|
-
this.dayNames = moment__default[
|
|
3604
|
+
this.dayNames = moment__default['default'].weekdaysShort(true);
|
|
3641
3605
|
// check if the input initDate has value
|
|
3642
3606
|
if (this.initDate) {
|
|
3643
3607
|
this.calendarDate =
|
|
3644
3608
|
this.returnObject === 'string'
|
|
3645
|
-
? moment__default[
|
|
3646
|
-
: moment__default[
|
|
3609
|
+
? moment__default['default'](this.initDate, this.viewFormat)
|
|
3610
|
+
: moment__default['default'](this.initDate);
|
|
3647
3611
|
this.selectedDate = this.calendarDate.clone().startOf('date');
|
|
3648
3612
|
}
|
|
3649
3613
|
else {
|
|
3650
|
-
this.calendarDate = moment__default[
|
|
3614
|
+
this.calendarDate = moment__default['default']();
|
|
3651
3615
|
}
|
|
3652
3616
|
this.generateYears();
|
|
3653
3617
|
};
|
|
@@ -3655,7 +3619,7 @@
|
|
|
3655
3619
|
this.calendarDays = [];
|
|
3656
3620
|
var start = 0 -
|
|
3657
3621
|
((this.calendarDate.clone().startOf('month').day() +
|
|
3658
|
-
(7 - moment__default[
|
|
3622
|
+
(7 - moment__default['default'].localeData().firstDayOfWeek())) %
|
|
3659
3623
|
7);
|
|
3660
3624
|
var end = 41 + start; // iterator ending point
|
|
3661
3625
|
for (var i = start; i <= end; i += 1) {
|
|
@@ -3689,7 +3653,7 @@
|
|
|
3689
3653
|
{ type: i0.Component, args: [{
|
|
3690
3654
|
selector: 'date-picker',
|
|
3691
3655
|
template: "<picker-modal (onOverlayClick)=\"cancelDatePicker()\">\n <div class=\"picker-wrap\">\n <div class=\"picker-box\">\n <div class=\"picker-header\">\n <div class=\"picker-header-nav\">\n <span class=\"nav-prev\" (click)=\"prev()\"></span>\n </div>\n <div class=\"picker-header-content\">\n <div class=\"content\">\n <span (click)=\"showMonthSelection()\" class=\"month\">{{\n calendarDate | moment: 'MMMM'\n }}</span>\n <span class=\"seperator\">|</span>\n <span (click)=\"showYearSelection()\" class=\"year\">{{\n calendarDate | moment: 'YYYY'\n }}</span>\n </div>\n </div>\n <div class=\"picker-header-nav\">\n <span class=\"nav-next\" (click)=\"next()\"></span>\n </div>\n </div>\n <div class=\"picker-calendar\">\n <div\n class=\"picker-calendar-row\"\n *ngIf=\"!onDisplayMonths && !onDisplayYears\"\n >\n <span class=\"picker-weekday\" *ngFor=\"let day of dayNames\">{{\n day\n }}</span>\n </div>\n <div\n class=\"picker-calendar-row\"\n *ngIf=\"!onDisplayMonths && !onDisplayYears\"\n >\n <span\n class=\"picker-day\"\n (click)=\"selectDay(day)\"\n [ngClass]=\"{\n 'out-focus': day.month() != calendarDate.month(),\n today: day.isSame(today),\n selected: day.isSame(selectedDate)\n }\"\n *ngFor=\"let day of calendarDays\"\n >\n {{ day | moment: 'D' }}\n </span>\n </div>\n <div class=\"picker-calendar-row\" *ngIf=\"onDisplayMonths\">\n <span\n class=\"picker-month\"\n *ngFor=\"let month of monthsShort\"\n (click)=\"selectMonth(month)\"\n [ngClass]=\"{\n selected: month === currentMonth\n }\"\n >\n {{ month }}\n </span>\n </div>\n <div class=\"picker-calendar-row\" *ngIf=\"onDisplayYears\">\n <span\n class=\"picker-year\"\n *ngFor=\"let year of displayYearRange\"\n (click)=\"selectYear(year)\"\n [ngClass]=\"{\n selected: year === currentYear\n }\"\n >\n {{ year }}\n </span>\n </div>\n </div>\n <div class=\"picker-footer\">\n <div class=\"picker-action action-today\" (click)=\"selectToday()\">\n <span class=\"text\">Today</span>\n </div>\n <div class=\"picker-action action-clear\" (click)=\"clearPickDate()\">\n <span class=\"text\">Clear</span>\n </div>\n <div class=\"picker-action action-close\" (click)=\"cancelDatePicker()\">\n <span class=\"text\">Close</span>\n </div>\n </div>\n </div>\n </div>\n</picker-modal>\n",
|
|
3692
|
-
styles: ["*,:after,:before{box-sizing:border-box}.picker-wrap{width:95vw;max-width:666px}.picker-box{font-family:Open Sans;min-width:400px!important;padding:.625rem 1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.picker-footer,.picker-header{font-size:1.333rem;line-height:2.5rem;display:flex;height:2.5rem;width:100%}.picker-header-nav{position:relative;cursor:pointer;width:calc(100% / 8)}.picker-header-nav>*{position:absolute;top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}.picker-header-nav .nav-next:before,.picker-header-nav .nav-prev:before{content:\" \";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker-header-nav .nav-next:before{border-right:0;border-left:.75em solid #000}.picker-header-content{width:calc(100% * 6 / 8);text-align:center}.picker-header-content .month{font-size:1.778rem;line-height:2.5rem;margin-right:.5rem;font-weight:700}.picker-header-content .year{font-style:italic;color:#999}.picker-calendar{width:100%}.picker-calendar .picker-calendar-row{display:flex;flex-wrap:wrap;width:100%;margin-bottom:.625rem}.picker-calendar .picker-weekday{font-weight:700;text-align:left;color:#999;width:calc(100% / 7)}.picker-calendar .picker-day,.picker-calendar .picker-month,.picker-calendar .picker-year{font-size:1.333rem;line-height:2.5rem;position:relative;height:2.5rem;text-align:center;cursor:pointer;width:calc(100% / 7)}.picker-calendar .picker-day:hover,.picker-calendar .picker-month:hover,.picker-calendar .picker-year:hover{background:#b1dcfb}.picker-calendar .out-focus{color:#ddd}.picker-calendar .out-focus:hover{color:#000}.picker-calendar .selected{background:#0089ec;color:#fff}.picker-calendar .selected:hover{background:#0089ec}.picker-calendar .today:before{content:\" \";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker-footer{cursor:pointer}.picker-footer .picker-action{text-align:center;width:calc(100% / 3)}.picker-footer .picker-action:hover{background-color:#b1dcfb}.picker-footer .picker-action .text{padding-left:.8rem}.picker-footer .action-clear:before,.picker-footer .action-close:before,.picker-footer .action-today:before{content:\" \";position:relative;display:inline-block;height:0;width:0}.picker-footer .action-today:before{border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker-footer .action-clear:before{top:-.5rem;width:1rem;border-top:3px solid #e20}.picker-footer .action-close:before{width:1rem;height:1rem;background:linear-gradient(180deg,transparent 35%,#777 0,#777 65%,transparent 0),linear-gradient(90deg,transparent 35%,#777 0,#777 65%,transparent 0);transform:rotate(45deg)}"]
|
|
3656
|
+
styles: ["*,:after,:before{box-sizing:border-box}.picker-wrap{width:95vw;max-width:666px}.picker-box{font-family:Open Sans;min-width:400px!important;padding:.625rem 1rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker-footer,.picker-header{font-size:1.333rem;line-height:2.5rem;display:flex;height:2.5rem;width:100%}.picker-header-nav{position:relative;cursor:pointer;width:calc(100% / 8)}.picker-header-nav>*{position:absolute;top:50%;right:auto;bottom:auto;left:50%;transform:translate(-50%,-50%)}.picker-header-nav .nav-next:before,.picker-header-nav .nav-prev:before{content:\" \";border-top:.5em solid transparent;border-bottom:.5em solid transparent;border-right:.75em solid #000;width:0;height:0;display:block;margin:0 auto}.picker-header-nav .nav-next:before{border-right:0;border-left:.75em solid #000}.picker-header-content{width:calc(100% * 6 / 8);text-align:center}.picker-header-content .month{font-size:1.778rem;line-height:2.5rem;margin-right:.5rem;font-weight:700}.picker-header-content .year{font-style:italic;color:#999}.picker-calendar{width:100%}.picker-calendar .picker-calendar-row{display:flex;flex-wrap:wrap;width:100%;margin-bottom:.625rem}.picker-calendar .picker-weekday{font-weight:700;text-align:left;color:#999;width:calc(100% / 7)}.picker-calendar .picker-day,.picker-calendar .picker-month,.picker-calendar .picker-year{font-size:1.333rem;line-height:2.5rem;position:relative;height:2.5rem;text-align:center;cursor:pointer;width:calc(100% / 7)}.picker-calendar .picker-day:hover,.picker-calendar .picker-month:hover,.picker-calendar .picker-year:hover{background:#b1dcfb}.picker-calendar .out-focus{color:#ddd}.picker-calendar .out-focus:hover{color:#000}.picker-calendar .selected{background:#0089ec;color:#fff}.picker-calendar .selected:hover{background:#0089ec}.picker-calendar .today:before{content:\" \";position:absolute;top:2px;right:2px;width:0;height:0;border-top:.5em solid #0059bc;border-left:.5em solid transparent}.picker-footer{cursor:pointer}.picker-footer .picker-action{text-align:center;width:calc(100% / 3)}.picker-footer .picker-action:hover{background-color:#b1dcfb}.picker-footer .picker-action .text{padding-left:.8rem}.picker-footer .action-clear:before,.picker-footer .action-close:before,.picker-footer .action-today:before{content:\" \";position:relative;display:inline-block;height:0;width:0}.picker-footer .action-today:before{border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker-footer .action-clear:before{top:-.5rem;width:1rem;border-top:3px solid #e20}.picker-footer .action-close:before{width:1rem;height:1rem;background:linear-gradient(180deg,transparent 35%,#777 0,#777 65%,transparent 0),linear-gradient(90deg,transparent 35%,#777 0,#777 65%,transparent 0);transform:rotate(45deg)}"]
|
|
3693
3657
|
},] }
|
|
3694
3658
|
];
|
|
3695
3659
|
DatePickerComponent.ctorParameters = function () { return []; };
|
|
@@ -3723,17 +3687,17 @@
|
|
|
3723
3687
|
this.hourFormat = 'hh';
|
|
3724
3688
|
}
|
|
3725
3689
|
this.time = this.initTime
|
|
3726
|
-
? moment__default[
|
|
3727
|
-
: moment__default[
|
|
3690
|
+
? moment__default['default'](this.initTime, this.viewFormat)
|
|
3691
|
+
: moment__default['default']();
|
|
3728
3692
|
// check if the input initDate has value
|
|
3729
3693
|
if (this.initTime) {
|
|
3730
3694
|
this.time =
|
|
3731
3695
|
this.returnObject === 'string'
|
|
3732
|
-
? moment__default[
|
|
3733
|
-
: moment__default[
|
|
3696
|
+
? moment__default['default'](this.initTime, this.viewFormat)
|
|
3697
|
+
: moment__default['default'](this.initTime);
|
|
3734
3698
|
}
|
|
3735
3699
|
else {
|
|
3736
|
-
this.time = moment__default[
|
|
3700
|
+
this.time = moment__default['default']();
|
|
3737
3701
|
}
|
|
3738
3702
|
};
|
|
3739
3703
|
TimePickerComponent.prototype.increaseHour = function () {
|
|
@@ -3761,7 +3725,7 @@
|
|
|
3761
3725
|
return;
|
|
3762
3726
|
};
|
|
3763
3727
|
TimePickerComponent.prototype.selectNow = function () {
|
|
3764
|
-
var selectTime = this.parseToReturnObjectType(moment__default[
|
|
3728
|
+
var selectTime = this.parseToReturnObjectType(moment__default['default']());
|
|
3765
3729
|
this.onSelectTime.emit(selectTime);
|
|
3766
3730
|
this.cancelTimePicker();
|
|
3767
3731
|
return;
|
|
@@ -3801,7 +3765,7 @@
|
|
|
3801
3765
|
{ type: i0.Component, args: [{
|
|
3802
3766
|
selector: 'time-picker',
|
|
3803
3767
|
template: "<picker-modal (onOverlayClick)=\"cancelTimePicker()\">\n <div class=\"picker-wrap\">\n <div class=\"picker-box\">\n <div class=\"picker-header\">Time Picker</div>\n <div class=\"picker-table\">\n <ul class=\"picker-table-time\">\n <li class=\"picker-table-number hour\">\n <span class=\"arrow up\" (click)=\"increaseHour()\"></span>\n {{ time | moment: hourFormat }}\n <span class=\"arrow down\" (click)=\"decreaseHour()\"></span>\n </li>\n <li class=\"picker-table-separator\">:</li>\n <li class=\"picker-table-number minute\">\n <span class=\"arrow up\" (click)=\"increaseMinute()\"></span>\n {{ time | moment: 'mm' }}\n <span class=\"arrow down\" (click)=\"decreaseMinute()\"></span>\n </li>\n <li *ngIf=\"showSecond\" class=\"picker-table-separator\">:</li>\n <li *ngIf=\"showSecond\" class=\"picker-table-number second\">\n <span class=\"arrow up\" (click)=\"increaseSecond()\"></span>\n {{ time | moment: 'ss' }}\n <span class=\"arrow down\" (click)=\"decreaseSecond()\"></span>\n </li>\n <li *ngIf=\"use12Hour\" class=\"picker-table-meridiem meridiem\">\n {{ time | moment: 'A' }}\n </li>\n </ul>\n </div>\n <div class=\"picker-footer\">\n <div class=\"picker-action action-now\" (click)=\"selectNow()\">\n <span class=\"text\">Now</span>\n </div>\n <div class=\"picker-action action-confirm\" (click)=\"selectTime()\">\n <span class=\"text\">Confirm</span>\n </div>\n <div class=\"picker-action action-clear\" (click)=\"clearTime()\">\n <span class=\"text\">Clear</span>\n </div>\n <div class=\"picker-action action-close\" (click)=\"cancelTimePicker()\">\n <span class=\"text\">Close</span>\n </div>\n </div>\n </div>\n </div>\n</picker-modal>\n",
|
|
3804
|
-
styles: ["*,:after,:before{box-sizing:border-box}.picker-wrap{width:95vw;max-width:40rem;font-family:Open Sans}.picker-box{width:100%;padding:.625rem 1rem;-webkit-user-select:none;-moz-user-select:none;user-select:none}.picker-footer,.picker-header{font-size:1.333rem;line-height:2.5rem;height:2.5rem;width:100%}.picker-header{text-align:center}.picker-table{width:100%;margin:2.5rem 0}.picker-table-time{font-size:2.37rem;line-height:2.5rem;list-style:none;margin:0;padding:0;display:flex;justify-content:center;width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none}.picker-table-meridiem,.picker-table-number,.picker-table-separator{text-align:center}.picker-table-meridiem,.picker-table-number{position:relative;width:20%}.arrow{position:absolute;left:50%;border:solid #777;border-width:0 .2rem .2rem 0;display:inline-block;padding:.25rem;cursor:pointer}.arrow.up{top:-1rem;transform:translateX(-50%) rotate(-135deg)}.arrow.down{bottom:-1rem;transform:translateX(-50%) rotate(45deg)}.arrow:hover{border-color:#1975d2}.picker-table-separator{width:calc(20% / 3)}.picker-footer{display:flex;justify-content:center;width:100%;cursor:pointer}.picker-footer .picker-action{width:25%;text-align:center}.picker-footer .picker-action:hover{background-color:#b1dcfb}.picker-footer .picker-action .text{padding-left:.8rem}.picker-footer .action-clear:before,.picker-footer .action-close:before,.picker-footer .action-confirm:before,.picker-footer .action-now:before{content:\" \";position:relative;display:inline-block;height:0;width:0}.picker-footer .action-now:before{border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker-footer .action-confirm:before{width:1rem;height:1rem;border-radius:100%;background-color:#00b5ad}.picker-footer .action-clear:before{top:-.5rem;width:1rem;border-top:3px solid #e20}.picker-footer .action-close:before{width:1rem;height:1rem;background:linear-gradient(180deg,transparent 35%,#777 0,#777 65%,transparent 0),linear-gradient(90deg,transparent 35%,#777 0,#777 65%,transparent 0);transform:rotate(45deg)}"]
|
|
3768
|
+
styles: ["*,:after,:before{box-sizing:border-box}.picker-wrap{width:95vw;max-width:40rem;font-family:Open Sans}.picker-box{width:100%;padding:.625rem 1rem;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker-footer,.picker-header{font-size:1.333rem;line-height:2.5rem;height:2.5rem;width:100%}.picker-header{text-align:center}.picker-table{width:100%;margin:2.5rem 0}.picker-table-time{font-size:2.37rem;line-height:2.5rem;list-style:none;margin:0;padding:0;display:flex;justify-content:center;width:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.picker-table-meridiem,.picker-table-number,.picker-table-separator{text-align:center}.picker-table-meridiem,.picker-table-number{position:relative;width:20%}.arrow{position:absolute;left:50%;border:solid #777;border-width:0 .2rem .2rem 0;display:inline-block;padding:.25rem;cursor:pointer}.arrow.up{top:-1rem;transform:translateX(-50%) rotate(-135deg)}.arrow.down{bottom:-1rem;transform:translateX(-50%) rotate(45deg)}.arrow:hover{border-color:#1975d2}.picker-table-separator{width:calc(20% / 3)}.picker-footer{display:flex;justify-content:center;width:100%;cursor:pointer}.picker-footer .picker-action{width:25%;text-align:center}.picker-footer .picker-action:hover{background-color:#b1dcfb}.picker-footer .picker-action .text{padding-left:.8rem}.picker-footer .action-clear:before,.picker-footer .action-close:before,.picker-footer .action-confirm:before,.picker-footer .action-now:before{content:\" \";position:relative;display:inline-block;height:0;width:0}.picker-footer .action-now:before{border-top:.66em solid #0059bc;border-left:.66em solid transparent}.picker-footer .action-confirm:before{width:1rem;height:1rem;border-radius:100%;background-color:#00b5ad}.picker-footer .action-clear:before{top:-.5rem;width:1rem;border-top:3px solid #e20}.picker-footer .action-close:before{width:1rem;height:1rem;background:linear-gradient(180deg,transparent 35%,#777 0,#777 65%,transparent 0),linear-gradient(90deg,transparent 35%,#777 0,#777 65%,transparent 0);transform:rotate(45deg)}"]
|
|
3805
3769
|
},] }
|
|
3806
3770
|
];
|
|
3807
3771
|
TimePickerComponent.ctorParameters = function () { return []; };
|
|
@@ -3876,11 +3840,11 @@
|
|
|
3876
3840
|
DateTimePickerComponent.prototype.weeksSelected = function (count) {
|
|
3877
3841
|
var now = new Date();
|
|
3878
3842
|
var nextDate = now.setDate(now.getDate() + count * 7);
|
|
3879
|
-
this.value = moment__default[
|
|
3843
|
+
this.value = moment__default['default'](nextDate).format();
|
|
3880
3844
|
};
|
|
3881
3845
|
DateTimePickerComponent.prototype.setDate = function (date) {
|
|
3882
3846
|
if (date && date !== '') {
|
|
3883
|
-
this.value = moment__default[
|
|
3847
|
+
this.value = moment__default['default'](date).format();
|
|
3884
3848
|
}
|
|
3885
3849
|
else {
|
|
3886
3850
|
this.value = date;
|
|
@@ -3888,7 +3852,7 @@
|
|
|
3888
3852
|
};
|
|
3889
3853
|
DateTimePickerComponent.prototype.setTime = function (time) {
|
|
3890
3854
|
if (time && time !== '') {
|
|
3891
|
-
this.value = moment__default[
|
|
3855
|
+
this.value = moment__default['default'](time).format();
|
|
3892
3856
|
}
|
|
3893
3857
|
else {
|
|
3894
3858
|
this.value = time;
|
|
@@ -3934,7 +3898,7 @@
|
|
|
3934
3898
|
};
|
|
3935
3899
|
DateTimePickerComponent.prototype.writeValue = function (value) {
|
|
3936
3900
|
if (value instanceof Date) {
|
|
3937
|
-
this.value = moment__default[
|
|
3901
|
+
this.value = moment__default['default'](value).format();
|
|
3938
3902
|
}
|
|
3939
3903
|
else {
|
|
3940
3904
|
this.value = value;
|
|
@@ -4008,11 +3972,11 @@
|
|
|
4008
3972
|
}
|
|
4009
3973
|
NgxDatetimeComponent.prototype.onInput = function ($event) {
|
|
4010
3974
|
this.onTouch();
|
|
4011
|
-
this.onChange(moment__default[
|
|
3975
|
+
this.onChange(moment__default['default']($event.value).format());
|
|
4012
3976
|
};
|
|
4013
3977
|
NgxDatetimeComponent.prototype.writeValue = function (value) {
|
|
4014
3978
|
if (value && value !== '') {
|
|
4015
|
-
this.value = moment__default[
|
|
3979
|
+
this.value = moment__default['default'](value).format();
|
|
4016
3980
|
}
|
|
4017
3981
|
else {
|
|
4018
3982
|
this.value = '';
|
|
@@ -4029,7 +3993,7 @@
|
|
|
4029
3993
|
};
|
|
4030
3994
|
NgxDatetimeComponent.prototype.onWeeksSelected = function (numberOfWeeks) {
|
|
4031
3995
|
var currentDate = new Date().toString();
|
|
4032
|
-
this.onInput({ value: moment__default[
|
|
3996
|
+
this.onInput({ value: moment__default['default'](currentDate).add(numberOfWeeks, 'weeks') });
|
|
4033
3997
|
};
|
|
4034
3998
|
return NgxDatetimeComponent;
|
|
4035
3999
|
}());
|
|
@@ -4183,7 +4147,7 @@
|
|
|
4183
4147
|
}
|
|
4184
4148
|
return OwlDateTimeIntl;
|
|
4185
4149
|
}());
|
|
4186
|
-
OwlDateTimeIntl.ɵprov =
|
|
4150
|
+
OwlDateTimeIntl.ɵprov = i0.ɵɵdefineInjectable({ factory: function OwlDateTimeIntl_Factory() { return new OwlDateTimeIntl(); }, token: OwlDateTimeIntl, providedIn: "root" });
|
|
4187
4151
|
OwlDateTimeIntl.decorators = [
|
|
4188
4152
|
{ type: i0.Injectable, args: [{ providedIn: 'root' },] }
|
|
4189
4153
|
];
|
|
@@ -6955,7 +6919,7 @@
|
|
|
6955
6919
|
};
|
|
6956
6920
|
|
|
6957
6921
|
/* eslint-disable @angular-eslint/no-host-metadata-property */
|
|
6958
|
-
var OWL_DATETIME_VALUE_ACCESSOR
|
|
6922
|
+
var OWL_DATETIME_VALUE_ACCESSOR = {
|
|
6959
6923
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
6960
6924
|
useExisting: i0.forwardRef(function () { return OwlDateTimeInputDirective; }),
|
|
6961
6925
|
multi: true
|
|
@@ -7582,7 +7546,7 @@
|
|
|
7582
7546
|
'[attr.max]': 'maxIso8601',
|
|
7583
7547
|
'[disabled]': 'owlDateTimeInputDisabled'
|
|
7584
7548
|
},
|
|
7585
|
-
providers: [OWL_DATETIME_VALUE_ACCESSOR
|
|
7549
|
+
providers: [OWL_DATETIME_VALUE_ACCESSOR, OWL_DATETIME_VALIDATORS]
|
|
7586
7550
|
},] }
|
|
7587
7551
|
];
|
|
7588
7552
|
OwlDateTimeInputDirective.ctorParameters = function () { return [
|
|
@@ -9193,7 +9157,7 @@
|
|
|
9193
9157
|
},] }
|
|
9194
9158
|
];
|
|
9195
9159
|
|
|
9196
|
-
var OWL_DATETIME_VALUE_ACCESSOR = {
|
|
9160
|
+
var OWL_DATETIME_VALUE_ACCESSOR$1 = {
|
|
9197
9161
|
provide: forms.NG_VALUE_ACCESSOR,
|
|
9198
9162
|
useExisting: i0.forwardRef(function () { return OwlDateTimeInlineComponent; }),
|
|
9199
9163
|
multi: true
|
|
@@ -9477,7 +9441,7 @@
|
|
|
9477
9441
|
},
|
|
9478
9442
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
9479
9443
|
preserveWhitespaces: false,
|
|
9480
|
-
providers: [OWL_DATETIME_VALUE_ACCESSOR],
|
|
9444
|
+
providers: [OWL_DATETIME_VALUE_ACCESSOR$1],
|
|
9481
9445
|
styles: [""]
|
|
9482
9446
|
},] }
|
|
9483
9447
|
];
|
|
@@ -9607,9 +9571,9 @@
|
|
|
9607
9571
|
short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
9608
9572
|
narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
|
|
9609
9573
|
};
|
|
9610
|
-
var ɵ0
|
|
9574
|
+
var ɵ0 = function (i) { return String(i + 1); };
|
|
9611
9575
|
/** The default date names to use if Intl API is not available. */
|
|
9612
|
-
var DEFAULT_DATE_NAMES = range(31, ɵ0
|
|
9576
|
+
var DEFAULT_DATE_NAMES = range(31, ɵ0);
|
|
9613
9577
|
/** Whether the browser supports the Intl API. */
|
|
9614
9578
|
var SUPPORTS_INTL_API = typeof Intl !== 'undefined';
|
|
9615
9579
|
/**
|
|
@@ -9940,7 +9904,7 @@
|
|
|
9940
9904
|
providers: [{ provide: DateTimeAdapter, useClass: NativeDateTimeAdapter }]
|
|
9941
9905
|
},] }
|
|
9942
9906
|
];
|
|
9943
|
-
var ɵ0 = OWL_NATIVE_DATE_TIME_FORMATS;
|
|
9907
|
+
var ɵ0$1 = OWL_NATIVE_DATE_TIME_FORMATS;
|
|
9944
9908
|
var OwlNativeDateTimeModule = /** @class */ (function () {
|
|
9945
9909
|
function OwlNativeDateTimeModule() {
|
|
9946
9910
|
}
|
|
@@ -9950,7 +9914,7 @@
|
|
|
9950
9914
|
{ type: i0.NgModule, args: [{
|
|
9951
9915
|
imports: [NativeDateTimeModule],
|
|
9952
9916
|
providers: [
|
|
9953
|
-
{ provide: OWL_DATE_TIME_FORMATS, useValue: ɵ0 }
|
|
9917
|
+
{ provide: OWL_DATE_TIME_FORMATS, useValue: ɵ0$1 }
|
|
9954
9918
|
]
|
|
9955
9919
|
},] }
|
|
9956
9920
|
];
|
|
@@ -9978,7 +9942,7 @@
|
|
|
9978
9942
|
},] }
|
|
9979
9943
|
];
|
|
9980
9944
|
|
|
9981
|
-
var Option
|
|
9945
|
+
var Option = /** @class */ (function () {
|
|
9982
9946
|
function Option(options) {
|
|
9983
9947
|
this.label = options.label;
|
|
9984
9948
|
this.value = options.value;
|
|
@@ -10023,7 +9987,7 @@
|
|
|
10023
9987
|
// console.log('options', options);
|
|
10024
9988
|
var mappedOptions = new Array();
|
|
10025
9989
|
for (var i = 0; i < options.length; i++) {
|
|
10026
|
-
mappedOptions.push(new Option
|
|
9990
|
+
mappedOptions.push(new Option(options[i]));
|
|
10027
9991
|
}
|
|
10028
9992
|
_this.subject.next(mappedOptions);
|
|
10029
9993
|
}, function (error) {
|
|
@@ -10074,12 +10038,12 @@
|
|
|
10074
10038
|
FormSchemaCompiler.prototype.compileFormSchema = function (formSchema, referencedComponents) {
|
|
10075
10039
|
// get all referenced forms
|
|
10076
10040
|
var refForms = this.getReferencedForms(formSchema, referencedComponents);
|
|
10077
|
-
if (
|
|
10041
|
+
if (_.isEmpty(refForms)) {
|
|
10078
10042
|
return formSchema;
|
|
10079
10043
|
}
|
|
10080
10044
|
// get all place-holders from the form schema
|
|
10081
10045
|
var placeHolders = this.getAllPlaceholderObjects(formSchema);
|
|
10082
|
-
if (
|
|
10046
|
+
if (_.isEmpty(placeHolders)) {
|
|
10083
10047
|
return formSchema;
|
|
10084
10048
|
}
|
|
10085
10049
|
// replace all placeHolders
|
|
@@ -10087,11 +10051,11 @@
|
|
|
10087
10051
|
return formSchema;
|
|
10088
10052
|
};
|
|
10089
10053
|
FormSchemaCompiler.prototype.findSchemaByName = function (schemaArray, nameOfSchema) {
|
|
10090
|
-
if (
|
|
10054
|
+
if (_.isEmpty(schemaArray) || _.isEmpty(nameOfSchema)) {
|
|
10091
10055
|
return;
|
|
10092
10056
|
}
|
|
10093
10057
|
var foundSchema = {};
|
|
10094
|
-
|
|
10058
|
+
_.each(schemaArray, function (schema) {
|
|
10095
10059
|
if (schema.name === nameOfSchema) {
|
|
10096
10060
|
foundSchema = schema;
|
|
10097
10061
|
}
|
|
@@ -10099,11 +10063,11 @@
|
|
|
10099
10063
|
return foundSchema;
|
|
10100
10064
|
};
|
|
10101
10065
|
FormSchemaCompiler.prototype.getPageInSchemaByLabel = function (schema, pageLabel) {
|
|
10102
|
-
if (
|
|
10066
|
+
if (_.isEmpty(schema) || _.isEmpty(pageLabel)) {
|
|
10103
10067
|
return;
|
|
10104
10068
|
}
|
|
10105
10069
|
var foundPage = {};
|
|
10106
|
-
|
|
10070
|
+
_.each(schema.pages, function (page) {
|
|
10107
10071
|
if (page.label === pageLabel) {
|
|
10108
10072
|
foundPage = page;
|
|
10109
10073
|
}
|
|
@@ -10111,15 +10075,15 @@
|
|
|
10111
10075
|
return foundPage;
|
|
10112
10076
|
};
|
|
10113
10077
|
FormSchemaCompiler.prototype.getSectionInSchemaByPageLabelBySectionLabel = function (schema, pageLabel, sectionLabel) {
|
|
10114
|
-
if (
|
|
10078
|
+
if (_.isEmpty(schema) || _.isEmpty(pageLabel) || _.isEmpty(sectionLabel)) {
|
|
10115
10079
|
return;
|
|
10116
10080
|
}
|
|
10117
10081
|
var foundPage = this.getPageInSchemaByLabel(schema, pageLabel);
|
|
10118
|
-
if (
|
|
10082
|
+
if (_.isEmpty(foundPage)) {
|
|
10119
10083
|
return;
|
|
10120
10084
|
}
|
|
10121
10085
|
var foundSection = {};
|
|
10122
|
-
|
|
10086
|
+
_.each(foundPage.sections, function (section) {
|
|
10123
10087
|
if (section.label === sectionLabel) {
|
|
10124
10088
|
foundSection = section;
|
|
10125
10089
|
}
|
|
@@ -10127,16 +10091,16 @@
|
|
|
10127
10091
|
return foundSection;
|
|
10128
10092
|
};
|
|
10129
10093
|
FormSchemaCompiler.prototype.getQuestionByIdInSchema = function (schema, questionId) {
|
|
10130
|
-
if (
|
|
10094
|
+
if (_.isEmpty(schema) || _.isEmpty(questionId)) {
|
|
10131
10095
|
return;
|
|
10132
10096
|
}
|
|
10133
10097
|
if (Array.isArray(schema)) {
|
|
10134
10098
|
var question = void 0;
|
|
10135
10099
|
for (var i = 0; i < schema.length; i++) {
|
|
10136
|
-
if (!
|
|
10100
|
+
if (!_.isEmpty(schema[i])) {
|
|
10137
10101
|
question = this.getQuestionByIdInSchema(schema[i], questionId);
|
|
10138
10102
|
}
|
|
10139
|
-
if (!
|
|
10103
|
+
if (!_.isEmpty(question)) {
|
|
10140
10104
|
break;
|
|
10141
10105
|
}
|
|
10142
10106
|
}
|
|
@@ -10159,7 +10123,7 @@
|
|
|
10159
10123
|
}
|
|
10160
10124
|
};
|
|
10161
10125
|
FormSchemaCompiler.prototype.getQuestionsArrayByQuestionIdInSchema = function (schema, questionId) {
|
|
10162
|
-
if (
|
|
10126
|
+
if (_.isEmpty(schema) || _.isEmpty(questionId)) {
|
|
10163
10127
|
return;
|
|
10164
10128
|
}
|
|
10165
10129
|
return this.getQuestionsArrayByQuestionId(schema, schema, questionId);
|
|
@@ -10168,10 +10132,10 @@
|
|
|
10168
10132
|
if (Array.isArray(object)) {
|
|
10169
10133
|
var returnedValue = void 0;
|
|
10170
10134
|
for (var i = 0; i < object.length; i++) {
|
|
10171
|
-
if (!
|
|
10135
|
+
if (!_.isEmpty(object[i])) {
|
|
10172
10136
|
returnedValue = this.getQuestionsArrayByQuestionId(object, object[i], questionId);
|
|
10173
10137
|
}
|
|
10174
|
-
if (!
|
|
10138
|
+
if (!_.isEmpty(returnedValue)) {
|
|
10175
10139
|
break;
|
|
10176
10140
|
}
|
|
10177
10141
|
}
|
|
@@ -10197,9 +10161,9 @@
|
|
|
10197
10161
|
FormSchemaCompiler.prototype.isSchemaSubObjectExpandable = function (object) {
|
|
10198
10162
|
if (typeof object === 'object') {
|
|
10199
10163
|
var objectKeys = Object.keys(object);
|
|
10200
|
-
if (
|
|
10201
|
-
|
|
10202
|
-
|
|
10164
|
+
if (_.includes(objectKeys, 'pages') ||
|
|
10165
|
+
_.includes(objectKeys, 'sections') ||
|
|
10166
|
+
_.includes(objectKeys, 'questions')) {
|
|
10203
10167
|
return true;
|
|
10204
10168
|
}
|
|
10205
10169
|
}
|
|
@@ -10214,18 +10178,18 @@
|
|
|
10214
10178
|
return referencedObjects;
|
|
10215
10179
|
};
|
|
10216
10180
|
FormSchemaCompiler.prototype.extractPlaceholderObjects = function (subSchema, objectsArray) {
|
|
10217
|
-
if (
|
|
10181
|
+
if (_.isEmpty(subSchema)) {
|
|
10218
10182
|
return;
|
|
10219
10183
|
}
|
|
10220
10184
|
if (Array.isArray(subSchema)) {
|
|
10221
10185
|
for (var i = 0; i < subSchema.length; i++) {
|
|
10222
|
-
if (!
|
|
10186
|
+
if (!_.isEmpty(subSchema[i])) {
|
|
10223
10187
|
this.extractPlaceholderObjects(subSchema[i], objectsArray);
|
|
10224
10188
|
}
|
|
10225
10189
|
}
|
|
10226
10190
|
}
|
|
10227
10191
|
else if (typeof subSchema === 'object') {
|
|
10228
|
-
if (!
|
|
10192
|
+
if (!_.isEmpty(subSchema.reference)) {
|
|
10229
10193
|
objectsArray.push(subSchema);
|
|
10230
10194
|
}
|
|
10231
10195
|
else if (this.isSchemaSubObjectExpandable(subSchema)) {
|
|
@@ -10236,7 +10200,7 @@
|
|
|
10236
10200
|
};
|
|
10237
10201
|
FormSchemaCompiler.prototype.fillPlaceholderObject = function (placeHolderObject, referenceObject) {
|
|
10238
10202
|
for (var member in referenceObject) {
|
|
10239
|
-
if (
|
|
10203
|
+
if (_.isEmpty(placeHolderObject[member])) {
|
|
10240
10204
|
placeHolderObject[member] = referenceObject[member];
|
|
10241
10205
|
}
|
|
10242
10206
|
}
|
|
@@ -10244,9 +10208,9 @@
|
|
|
10244
10208
|
};
|
|
10245
10209
|
FormSchemaCompiler.prototype.replaceAllPlaceholdersWithActualObjects = function (keyValReferencedForms, placeHoldersArray) {
|
|
10246
10210
|
var _this = this;
|
|
10247
|
-
|
|
10211
|
+
_.each(placeHoldersArray, function (placeHolder) {
|
|
10248
10212
|
var referencedObject = _this.getReferencedObject(placeHolder.reference, keyValReferencedForms);
|
|
10249
|
-
if (
|
|
10213
|
+
if (_.isEmpty(referencedObject)) {
|
|
10250
10214
|
console.error('Form compile: Error finding referenced object', placeHolder.reference);
|
|
10251
10215
|
}
|
|
10252
10216
|
else {
|
|
@@ -10267,7 +10231,7 @@
|
|
|
10267
10231
|
FormSchemaCompiler.prototype.removeExcludedQuestionsFromPlaceholder = function (placeHolder) {
|
|
10268
10232
|
var _this = this;
|
|
10269
10233
|
if (Array.isArray(placeHolder.reference.excludeQuestions)) {
|
|
10270
|
-
|
|
10234
|
+
_.each(placeHolder.reference.excludeQuestions, function (excludedQuestionId) {
|
|
10271
10235
|
var questionsArray = _this.getQuestionsArrayByQuestionIdInSchema(placeHolder, excludedQuestionId);
|
|
10272
10236
|
if (!Array.isArray(questionsArray)) {
|
|
10273
10237
|
return;
|
|
@@ -10279,21 +10243,21 @@
|
|
|
10279
10243
|
return placeHolder;
|
|
10280
10244
|
};
|
|
10281
10245
|
FormSchemaCompiler.prototype.getReferencedObject = function (referenceData, keyValReferencedForms) {
|
|
10282
|
-
if (
|
|
10246
|
+
if (_.isEmpty(referenceData.form)) {
|
|
10283
10247
|
console.error('Form compile: reference missing form attribute', referenceData);
|
|
10284
10248
|
return;
|
|
10285
10249
|
}
|
|
10286
|
-
if (
|
|
10250
|
+
if (_.isEmpty(keyValReferencedForms[referenceData.form])) {
|
|
10287
10251
|
console.error('Form compile: referenced form alias not found', referenceData);
|
|
10288
10252
|
return;
|
|
10289
10253
|
}
|
|
10290
|
-
if (!
|
|
10254
|
+
if (!_.isEmpty(referenceData.questionId)) {
|
|
10291
10255
|
return this.getQuestionByIdInSchema(keyValReferencedForms[referenceData.form], referenceData.questionId);
|
|
10292
10256
|
}
|
|
10293
|
-
if (!
|
|
10257
|
+
if (!_.isEmpty(referenceData.page) && !_.isEmpty(referenceData.section)) {
|
|
10294
10258
|
return this.getSectionInSchemaByPageLabelBySectionLabel(keyValReferencedForms[referenceData.form], referenceData.page, referenceData.section);
|
|
10295
10259
|
}
|
|
10296
|
-
if (!
|
|
10260
|
+
if (!_.isEmpty(referenceData.page)) {
|
|
10297
10261
|
return this.getPageInSchemaByLabel(keyValReferencedForms[referenceData.form], referenceData.page);
|
|
10298
10262
|
}
|
|
10299
10263
|
console.error('Form compile: Unsupported reference type', referenceData.reference);
|
|
@@ -10301,11 +10265,11 @@
|
|
|
10301
10265
|
FormSchemaCompiler.prototype.getReferencedForms = function (formSchema, formSchemasLookupArray) {
|
|
10302
10266
|
var _this = this;
|
|
10303
10267
|
var referencedForms = formSchema.referencedForms;
|
|
10304
|
-
if (
|
|
10268
|
+
if (_.isEmpty(referencedForms)) {
|
|
10305
10269
|
return;
|
|
10306
10270
|
}
|
|
10307
10271
|
var keyValReferencedForms = {};
|
|
10308
|
-
|
|
10272
|
+
_.each(referencedForms, function (reference) {
|
|
10309
10273
|
keyValReferencedForms[reference.alias] = _this.findSchemaByName(formSchemasLookupArray, reference.formName);
|
|
10310
10274
|
});
|
|
10311
10275
|
return keyValReferencedForms;
|
|
@@ -10508,7 +10472,7 @@
|
|
|
10508
10472
|
DummyDataSource.prototype.resolveSelectedValue = function (value) {
|
|
10509
10473
|
var selectOptions = this.sampleData();
|
|
10510
10474
|
selectOptions = selectOptions.map(function (obj) {
|
|
10511
|
-
var option = new Option
|
|
10475
|
+
var option = new Option({
|
|
10512
10476
|
label: obj.label,
|
|
10513
10477
|
value: obj.concept
|
|
10514
10478
|
});
|
|
@@ -10533,7 +10497,7 @@
|
|
|
10533
10497
|
DummyDataSource.prototype.searchOptions = function (searchText) {
|
|
10534
10498
|
var selectOptions = this.sampleData();
|
|
10535
10499
|
selectOptions = selectOptions.map(function (obj) {
|
|
10536
|
-
var option = new Option
|
|
10500
|
+
var option = new Option({
|
|
10537
10501
|
label: obj.label,
|
|
10538
10502
|
value: obj.concept
|
|
10539
10503
|
});
|
|
@@ -10628,13 +10592,13 @@
|
|
|
10628
10592
|
return encStore.data[index];
|
|
10629
10593
|
}
|
|
10630
10594
|
};
|
|
10631
|
-
if (___default[
|
|
10595
|
+
if (___default['default'].isArray(encounters)) {
|
|
10632
10596
|
var group_1 = [];
|
|
10633
|
-
___default[
|
|
10597
|
+
___default['default'].each(encounters, function (encounter) {
|
|
10634
10598
|
group_1.push(_this._transformEncounter(encounter));
|
|
10635
10599
|
});
|
|
10636
10600
|
// Sort them in reverse chronological order
|
|
10637
|
-
encStore.data = ___default[
|
|
10601
|
+
encStore.data = ___default['default'].sortBy(group_1, 'encounterDatetime').reverse();
|
|
10638
10602
|
}
|
|
10639
10603
|
else {
|
|
10640
10604
|
// Assume a single openmrs rest encounter object.
|
|
@@ -10654,25 +10618,25 @@
|
|
|
10654
10618
|
if (answers.length > 0) {
|
|
10655
10619
|
return {
|
|
10656
10620
|
value: answers[0],
|
|
10657
|
-
valueDate: moment__default[
|
|
10621
|
+
valueDate: moment__default['default'](object.encounterDatetime).format('YYYY-MM-DDTHH:mm:ss')
|
|
10658
10622
|
};
|
|
10659
10623
|
}
|
|
10660
10624
|
};
|
|
10661
10625
|
HistoricalEncounterDataService.prototype.getAllValues = function (path, object, answers) {
|
|
10662
10626
|
var _this = this;
|
|
10663
|
-
if (___default[
|
|
10627
|
+
if (___default['default'].isNil(object)) {
|
|
10664
10628
|
return;
|
|
10665
10629
|
}
|
|
10666
10630
|
if (path.length <= 1) {
|
|
10667
|
-
if (!___default[
|
|
10631
|
+
if (!___default['default'].isNil(object[path[0]])) {
|
|
10668
10632
|
answers.push(object[path[0]]);
|
|
10669
10633
|
}
|
|
10670
10634
|
return;
|
|
10671
10635
|
}
|
|
10672
10636
|
var newpath = path.splice(1);
|
|
10673
10637
|
var key = path[0];
|
|
10674
|
-
if (___default[
|
|
10675
|
-
___default[
|
|
10638
|
+
if (___default['default'].isArray(object[key]) && object[key].length > 0) {
|
|
10639
|
+
___default['default'].each(object[key], function (childObject) {
|
|
10676
10640
|
_this.getAllValues(newpath.slice(0), childObject, answers);
|
|
10677
10641
|
});
|
|
10678
10642
|
}
|
|
@@ -10681,7 +10645,7 @@
|
|
|
10681
10645
|
}
|
|
10682
10646
|
};
|
|
10683
10647
|
HistoricalEncounterDataService.prototype._transformEncounter = function (encounter) {
|
|
10684
|
-
if (___default[
|
|
10648
|
+
if (___default['default'].isNil(encounter)) {
|
|
10685
10649
|
return;
|
|
10686
10650
|
}
|
|
10687
10651
|
// Transform encounter Level details to key value pairs.
|
|
@@ -10708,7 +10672,7 @@
|
|
|
10708
10672
|
if (encounter.obs) {
|
|
10709
10673
|
var processedObs = this._transformObs(encounter.obs);
|
|
10710
10674
|
// add in individual processed obs to prevEncounter
|
|
10711
|
-
___default[
|
|
10675
|
+
___default['default'].extend(prevEncounter, processedObs);
|
|
10712
10676
|
}
|
|
10713
10677
|
return prevEncounter;
|
|
10714
10678
|
};
|
|
@@ -10718,19 +10682,19 @@
|
|
|
10718
10682
|
return null;
|
|
10719
10683
|
}
|
|
10720
10684
|
var obsRep = {};
|
|
10721
|
-
if (___default[
|
|
10722
|
-
___default[
|
|
10685
|
+
if (___default['default'].isArray(obs)) {
|
|
10686
|
+
___default['default'].each(obs, function (singleObs) {
|
|
10723
10687
|
_this._augumentObs(obsRep, _this._transformObs(singleObs));
|
|
10724
10688
|
});
|
|
10725
10689
|
return obsRep;
|
|
10726
10690
|
}
|
|
10727
10691
|
else if (obs.groupMembers) {
|
|
10728
10692
|
var group_2 = {};
|
|
10729
|
-
___default[
|
|
10693
|
+
___default['default'].each(obs.groupMembers, function (member) {
|
|
10730
10694
|
_this._augumentObs(group_2, _this._transformObs(member));
|
|
10731
10695
|
});
|
|
10732
10696
|
// Handle already existing data
|
|
10733
|
-
if (obsRep[obs.concept.uuid] && ___default[
|
|
10697
|
+
if (obsRep[obs.concept.uuid] && ___default['default'].isArray(obsRep[obs.concept.uuid])) {
|
|
10734
10698
|
obsRep[obs.concept.uuid].push(group_2);
|
|
10735
10699
|
}
|
|
10736
10700
|
else {
|
|
@@ -10750,14 +10714,14 @@
|
|
|
10750
10714
|
};
|
|
10751
10715
|
HistoricalEncounterDataService.prototype._augumentObs = function (existing, toAdd) {
|
|
10752
10716
|
for (var key in toAdd) {
|
|
10753
|
-
if (___default[
|
|
10717
|
+
if (___default['default'].has(existing, key)) {
|
|
10754
10718
|
// check if not an array yet
|
|
10755
|
-
if (!___default[
|
|
10719
|
+
if (!___default['default'].isArray(existing[key])) {
|
|
10756
10720
|
var temp = existing[key];
|
|
10757
10721
|
existing[key] = [temp];
|
|
10758
10722
|
}
|
|
10759
10723
|
// Check whether the incoming is array (for group members)
|
|
10760
|
-
if (___default[
|
|
10724
|
+
if (___default['default'].isArray(toAdd[key])) {
|
|
10761
10725
|
Array.prototype.push.apply(existing[key], toAdd[key]);
|
|
10762
10726
|
}
|
|
10763
10727
|
else {
|
|
@@ -10816,6 +10780,7 @@
|
|
|
10816
10780
|
function QuestionFactory() {
|
|
10817
10781
|
this.dataSources = {};
|
|
10818
10782
|
this.historicalHelperService = new HistoricalHelperService();
|
|
10783
|
+
this.quetionIndex = 0;
|
|
10819
10784
|
}
|
|
10820
10785
|
QuestionFactory.prototype.createQuestionModel = function (formSchema, form) {
|
|
10821
10786
|
if (form) {
|
|
@@ -10826,6 +10791,7 @@
|
|
|
10826
10791
|
};
|
|
10827
10792
|
QuestionFactory.prototype.toSelectQuestion = function (schemaQuestion) {
|
|
10828
10793
|
var question = new SelectQuestion({ options: [], type: '', key: '' });
|
|
10794
|
+
question.questionIndex = this.quetionIndex;
|
|
10829
10795
|
question.label = schemaQuestion.label;
|
|
10830
10796
|
question.prefix = schemaQuestion.prefix;
|
|
10831
10797
|
question.key = schemaQuestion.id;
|
|
@@ -10862,6 +10828,7 @@
|
|
|
10862
10828
|
type: '',
|
|
10863
10829
|
key: ''
|
|
10864
10830
|
});
|
|
10831
|
+
question.questionIndex = this.quetionIndex;
|
|
10865
10832
|
question.label = schemaQuestion.label;
|
|
10866
10833
|
question.prefix = schemaQuestion.prefix;
|
|
10867
10834
|
question.key = schemaQuestion.id;
|
|
@@ -10889,6 +10856,7 @@
|
|
|
10889
10856
|
type: '',
|
|
10890
10857
|
key: ''
|
|
10891
10858
|
});
|
|
10859
|
+
question.questionIndex = this.quetionIndex;
|
|
10892
10860
|
question.label = schemaQuestion.label;
|
|
10893
10861
|
question.prefix = schemaQuestion.prefix;
|
|
10894
10862
|
question.key = schemaQuestion.id;
|
|
@@ -10914,6 +10882,7 @@
|
|
|
10914
10882
|
return this.toEncounterDatetimeQuestion(schemaQuestion);
|
|
10915
10883
|
}
|
|
10916
10884
|
var question = new DateQuestion({ type: '', key: '' });
|
|
10885
|
+
question.questionIndex = this.quetionIndex;
|
|
10917
10886
|
question.renderingType = 'date';
|
|
10918
10887
|
question.validators = this.addValidators(schemaQuestion);
|
|
10919
10888
|
question.extras = schemaQuestion;
|
|
@@ -10937,6 +10906,7 @@
|
|
|
10937
10906
|
QuestionFactory.prototype.toEncounterDatetimeQuestion = function (schemaQuestion) {
|
|
10938
10907
|
var _a;
|
|
10939
10908
|
var question = new DateQuestion({ type: '', key: '' });
|
|
10909
|
+
question.questionIndex = this.quetionIndex;
|
|
10940
10910
|
question.label = schemaQuestion.label;
|
|
10941
10911
|
question.prefix = schemaQuestion.prefix;
|
|
10942
10912
|
question.renderingType = 'date';
|
|
@@ -10963,6 +10933,7 @@
|
|
|
10963
10933
|
};
|
|
10964
10934
|
QuestionFactory.prototype.toCheckBoxQuestion = function (schemaQuestion) {
|
|
10965
10935
|
var question = new CheckBoxQuestion({ options: [], type: '', key: '' });
|
|
10936
|
+
question.questionIndex = this.quetionIndex;
|
|
10966
10937
|
question.label = schemaQuestion.label;
|
|
10967
10938
|
question.prefix = schemaQuestion.prefix;
|
|
10968
10939
|
question.key = schemaQuestion.id;
|
|
@@ -10996,6 +10967,7 @@
|
|
|
10996
10967
|
type: '',
|
|
10997
10968
|
key: ''
|
|
10998
10969
|
});
|
|
10970
|
+
question.questionIndex = this.quetionIndex;
|
|
10999
10971
|
question.label = schemaQuestion.label;
|
|
11000
10972
|
question.prefix = schemaQuestion.prefix;
|
|
11001
10973
|
question.key = schemaQuestion.id;
|
|
@@ -11029,6 +11001,7 @@
|
|
|
11029
11001
|
type: '',
|
|
11030
11002
|
key: ''
|
|
11031
11003
|
});
|
|
11004
|
+
question.questionIndex = this.quetionIndex;
|
|
11032
11005
|
question.label = schemaQuestion.label;
|
|
11033
11006
|
question.prefix = schemaQuestion.prefix;
|
|
11034
11007
|
question.key = schemaQuestion.id;
|
|
@@ -11057,6 +11030,7 @@
|
|
|
11057
11030
|
type: '',
|
|
11058
11031
|
key: ''
|
|
11059
11032
|
});
|
|
11033
|
+
question.questionIndex = this.quetionIndex;
|
|
11060
11034
|
question.label = schemaQuestion.label;
|
|
11061
11035
|
question.prefix = schemaQuestion.prefix;
|
|
11062
11036
|
question.key = schemaQuestion.id;
|
|
@@ -11080,6 +11054,7 @@
|
|
|
11080
11054
|
};
|
|
11081
11055
|
QuestionFactory.prototype.toFileUploadQuestion = function (schemaQuestion) {
|
|
11082
11056
|
var question = new FileUploadQuestion({ type: '', key: '' });
|
|
11057
|
+
question.questionIndex = this.quetionIndex;
|
|
11083
11058
|
question.label = schemaQuestion.label;
|
|
11084
11059
|
question.prefix = schemaQuestion.prefix;
|
|
11085
11060
|
question.key = schemaQuestion.id;
|
|
@@ -11102,6 +11077,7 @@
|
|
|
11102
11077
|
};
|
|
11103
11078
|
QuestionFactory.prototype.toDrugQuestion = function (schemaQuestion) {
|
|
11104
11079
|
var question = new SelectQuestion({ options: [], type: '', key: '' });
|
|
11080
|
+
question.questionIndex = this.quetionIndex;
|
|
11105
11081
|
question.label = schemaQuestion.label;
|
|
11106
11082
|
question.prefix = schemaQuestion.prefix;
|
|
11107
11083
|
question.key = schemaQuestion.id;
|
|
@@ -11124,6 +11100,7 @@
|
|
|
11124
11100
|
};
|
|
11125
11101
|
QuestionFactory.prototype.toProblemQuestion = function (schemaQuestion) {
|
|
11126
11102
|
var question = new SelectQuestion({ options: [], type: '', key: '' });
|
|
11103
|
+
question.questionIndex = this.quetionIndex;
|
|
11127
11104
|
question.label = schemaQuestion.label;
|
|
11128
11105
|
question.prefix = schemaQuestion.prefix;
|
|
11129
11106
|
question.key = schemaQuestion.id;
|
|
@@ -11146,6 +11123,7 @@
|
|
|
11146
11123
|
};
|
|
11147
11124
|
QuestionFactory.prototype.toConceptAnswerSelect = function (schemaQuestion) {
|
|
11148
11125
|
var question = new SelectQuestion({ options: [], type: '', key: '' });
|
|
11126
|
+
question.questionIndex = this.quetionIndex;
|
|
11149
11127
|
question.label = schemaQuestion.label;
|
|
11150
11128
|
question.prefix = schemaQuestion.prefix;
|
|
11151
11129
|
question.key = schemaQuestion.id;
|
|
@@ -11176,6 +11154,7 @@
|
|
|
11176
11154
|
type: '',
|
|
11177
11155
|
key: ''
|
|
11178
11156
|
});
|
|
11157
|
+
question.questionIndex = this.quetionIndex;
|
|
11179
11158
|
question.label = schemaQuestion.label;
|
|
11180
11159
|
question.prefix = schemaQuestion.prefix;
|
|
11181
11160
|
question.questions = this.getChildrenQuestionModels(schemaQuestion.questions);
|
|
@@ -11203,6 +11182,7 @@
|
|
|
11203
11182
|
};
|
|
11204
11183
|
QuestionFactory.prototype.toGroupQuestion = function (schemaQuestion) {
|
|
11205
11184
|
var question = new QuestionGroup({ questions: [], type: '', key: '' });
|
|
11185
|
+
question.questionIndex = this.quetionIndex;
|
|
11206
11186
|
question.label = schemaQuestion.label;
|
|
11207
11187
|
question.prefix = schemaQuestion.prefix;
|
|
11208
11188
|
question.questions = this.getChildrenQuestionModels(schemaQuestion.questions);
|
|
@@ -11273,6 +11253,7 @@
|
|
|
11273
11253
|
searchFunction: function () { },
|
|
11274
11254
|
resolveFunction: function () { }
|
|
11275
11255
|
});
|
|
11256
|
+
question.questionIndex = this.quetionIndex;
|
|
11276
11257
|
question.label = schemaQuestion.label;
|
|
11277
11258
|
question.prefix = schemaQuestion.prefix;
|
|
11278
11259
|
question.key = schemaQuestion.id;
|
|
@@ -11302,6 +11283,7 @@
|
|
|
11302
11283
|
searchFunction: function () { },
|
|
11303
11284
|
resolveFunction: function () { }
|
|
11304
11285
|
});
|
|
11286
|
+
question.questionIndex = this.quetionIndex;
|
|
11305
11287
|
question.label = schemaQuestion.label;
|
|
11306
11288
|
question.prefix = schemaQuestion.prefix;
|
|
11307
11289
|
question.key = schemaQuestion.id;
|
|
@@ -11336,6 +11318,7 @@
|
|
|
11336
11318
|
searchFunction: function () { },
|
|
11337
11319
|
resolveFunction: function () { }
|
|
11338
11320
|
});
|
|
11321
|
+
question.questionIndex = this.quetionIndex;
|
|
11339
11322
|
question.label = schemaQuestion.label;
|
|
11340
11323
|
question.prefix = schemaQuestion.prefix;
|
|
11341
11324
|
question.key = schemaQuestion.id;
|
|
@@ -11367,6 +11350,7 @@
|
|
|
11367
11350
|
label: '',
|
|
11368
11351
|
rendering: ''
|
|
11369
11352
|
});
|
|
11353
|
+
question.questionIndex = this.quetionIndex;
|
|
11370
11354
|
question.label = schemaQuestion.label;
|
|
11371
11355
|
question.prefix = schemaQuestion.prefix;
|
|
11372
11356
|
question.key = schemaQuestion.id;
|
|
@@ -11431,6 +11415,7 @@
|
|
|
11431
11415
|
return children;
|
|
11432
11416
|
};
|
|
11433
11417
|
QuestionFactory.prototype.toModel = function (schema, renderType) {
|
|
11418
|
+
this.quetionIndex++;
|
|
11434
11419
|
if (renderType === 'ui-select-extended') {
|
|
11435
11420
|
renderType = schema.type;
|
|
11436
11421
|
}
|
|
@@ -11542,7 +11527,7 @@
|
|
|
11542
11527
|
var validators = [];
|
|
11543
11528
|
if (schemaQuestion.validators) {
|
|
11544
11529
|
// TODO - add more validator types
|
|
11545
|
-
___default[
|
|
11530
|
+
___default['default'].forEach(schemaQuestion.validators, function (validator) {
|
|
11546
11531
|
switch (validator.type) {
|
|
11547
11532
|
case 'date':
|
|
11548
11533
|
validators.push(new DateValidationModel(validator));
|
|
@@ -11617,8 +11602,8 @@
|
|
|
11617
11602
|
// sample schema options for this branch
|
|
11618
11603
|
// "historicalPrepopulate":true,
|
|
11619
11604
|
// "allowedHistoricalValueAgeInDays": 40000,
|
|
11620
|
-
var valDate = moment__default[
|
|
11621
|
-
var differenceInDays = moment__default[
|
|
11605
|
+
var valDate = moment__default['default'](origValue.valueDate);
|
|
11606
|
+
var differenceInDays = moment__default['default']().diff(valDate, 'days');
|
|
11622
11607
|
if (Number.isInteger(schemaQuestion.allowedHistoricalValueAgeInDays)) {
|
|
11623
11608
|
if (differenceInDays <= schemaQuestion.allowedHistoricalValueAgeInDays) {
|
|
11624
11609
|
question.defaultValue = origValue.value;
|
|
@@ -11827,7 +11812,7 @@
|
|
|
11827
11812
|
if (arrayNode &&
|
|
11828
11813
|
arrayNode.children &&
|
|
11829
11814
|
arrayNode.children.length > 0) {
|
|
11830
|
-
|
|
11815
|
+
_.forEach(arrayNode.children, function (groupNode) {
|
|
11831
11816
|
_this.markInvalidControls(groupNode, invalidControlNodes);
|
|
11832
11817
|
});
|
|
11833
11818
|
}
|
|
@@ -11895,6 +11880,7 @@
|
|
|
11895
11880
|
this.controlService = controlService;
|
|
11896
11881
|
this.questionFactroy = questionFactroy;
|
|
11897
11882
|
this.controlRelationsFactory = controlRelationsFactory;
|
|
11883
|
+
this.nodeIndex = 0;
|
|
11898
11884
|
this.hd = {
|
|
11899
11885
|
getValue: function () {
|
|
11900
11886
|
return 20;
|
|
@@ -11936,6 +11922,8 @@
|
|
|
11936
11922
|
else {
|
|
11937
11923
|
node = this.createLeafNode(question, parentNode, parentControl, form);
|
|
11938
11924
|
}
|
|
11925
|
+
node.nodeIndex = this.nodeIndex;
|
|
11926
|
+
this.nodeIndex++;
|
|
11939
11927
|
return node;
|
|
11940
11928
|
};
|
|
11941
11929
|
FormFactory.prototype.createLeafNode = function (question, parentNode, parentControl, form) {
|
|
@@ -12017,16 +12005,19 @@
|
|
|
12017
12005
|
|
|
12018
12006
|
var ObsAdapterHelper = /** @class */ (function () {
|
|
12019
12007
|
function ObsAdapterHelper() {
|
|
12008
|
+
this.formFieldNamespace = 'O3';
|
|
12009
|
+
this.obsIndex = 0;
|
|
12020
12010
|
}
|
|
12021
12011
|
ObsAdapterHelper.prototype.findObsAnswerToQuestion = function (node, obsArray) {
|
|
12022
12012
|
var _this = this;
|
|
12013
|
+
// Find and Order the obs based on form_namespace_and_path
|
|
12023
12014
|
var found = [];
|
|
12024
12015
|
if (!this.isObsNode(node)) {
|
|
12025
12016
|
return found;
|
|
12026
12017
|
}
|
|
12027
12018
|
if (node instanceof LeafNode ||
|
|
12028
12019
|
(node instanceof GroupNode && node.question.extras.type === 'complex-obs')) {
|
|
12029
|
-
___default[
|
|
12020
|
+
___default['default'].each(obsArray, function (item) {
|
|
12030
12021
|
if (item.concept &&
|
|
12031
12022
|
item.concept.uuid === node.question.extras.questionOptions.concept) {
|
|
12032
12023
|
found.push(item);
|
|
@@ -12037,7 +12028,7 @@
|
|
|
12037
12028
|
// At this point the node is either a group or a repeating node
|
|
12038
12029
|
var childQuestionsUuids = this.getChildQuestionsConceptUuids(node);
|
|
12039
12030
|
if (childQuestionsUuids.length > 0) {
|
|
12040
|
-
___default[
|
|
12031
|
+
___default['default'].each(obsArray, function (obs) {
|
|
12041
12032
|
if (obs.concept &&
|
|
12042
12033
|
obs.concept.uuid === node.question.extras.questionOptions.concept &&
|
|
12043
12034
|
Array.isArray(obs.groupMembers) &&
|
|
@@ -12051,7 +12042,7 @@
|
|
|
12051
12042
|
ObsAdapterHelper.prototype.getChildQuestionsConceptUuids = function (node) {
|
|
12052
12043
|
var found = [];
|
|
12053
12044
|
if (node.question.extras && node.question.extras.questions) {
|
|
12054
|
-
___default[
|
|
12045
|
+
___default['default'].each(node.question.extras.questions, function (question) {
|
|
12055
12046
|
if (question.questionOptions && question.questionOptions.concept) {
|
|
12056
12047
|
found.push(question.questionOptions.concept);
|
|
12057
12048
|
}
|
|
@@ -12062,7 +12053,7 @@
|
|
|
12062
12053
|
ObsAdapterHelper.prototype.getGroupMembersConceptUuids = function (obsWithGroupMembers) {
|
|
12063
12054
|
var found = [];
|
|
12064
12055
|
if (Array.isArray(obsWithGroupMembers.groupMembers)) {
|
|
12065
|
-
___default[
|
|
12056
|
+
___default['default'].each(obsWithGroupMembers.groupMembers, function (member) {
|
|
12066
12057
|
found.push(member.concept.uuid);
|
|
12067
12058
|
});
|
|
12068
12059
|
}
|
|
@@ -12098,8 +12089,9 @@
|
|
|
12098
12089
|
}
|
|
12099
12090
|
};
|
|
12100
12091
|
ObsAdapterHelper.prototype.setMultiselectObsNodeValue = function (node, obs) {
|
|
12101
|
-
var e_1,
|
|
12092
|
+
var e_1, _b;
|
|
12102
12093
|
if (node && obs.length > 0) {
|
|
12094
|
+
obs = obs.sort(this.comparePath);
|
|
12103
12095
|
node.initialValue = obs;
|
|
12104
12096
|
var obsUuids = [];
|
|
12105
12097
|
try {
|
|
@@ -12111,7 +12103,7 @@
|
|
|
12111
12103
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
12112
12104
|
finally {
|
|
12113
12105
|
try {
|
|
12114
|
-
if (obs_1_1 && !obs_1_1.done && (
|
|
12106
|
+
if (obs_1_1 && !obs_1_1.done && (_b = obs_1.return)) _b.call(obs_1);
|
|
12115
12107
|
}
|
|
12116
12108
|
finally { if (e_1) throw e_1.error; }
|
|
12117
12109
|
}
|
|
@@ -12157,6 +12149,7 @@
|
|
|
12157
12149
|
ObsAdapterHelper.prototype.setRepeatingGroupObsNodeValue = function (node, obs) {
|
|
12158
12150
|
if (node && obs.length > 0) {
|
|
12159
12151
|
var arrayNode = node;
|
|
12152
|
+
obs = obs.sort(this.comparePath);
|
|
12160
12153
|
arrayNode.initialValue = obs;
|
|
12161
12154
|
for (var i = 0; i < obs.length; i++) {
|
|
12162
12155
|
var createdNode = arrayNode.createChildNode();
|
|
@@ -12164,6 +12157,12 @@
|
|
|
12164
12157
|
}
|
|
12165
12158
|
}
|
|
12166
12159
|
};
|
|
12160
|
+
ObsAdapterHelper.prototype.comparePath = function (first, second) {
|
|
12161
|
+
if (!first || !second) {
|
|
12162
|
+
return -1;
|
|
12163
|
+
}
|
|
12164
|
+
return Number(first.formFieldPath) - Number(second.formFieldPath);
|
|
12165
|
+
};
|
|
12167
12166
|
ObsAdapterHelper.prototype.setNodeValue = function (node, obs) {
|
|
12168
12167
|
switch (this.getObsNodeType(node)) {
|
|
12169
12168
|
case 'unknown':
|
|
@@ -12288,6 +12287,13 @@
|
|
|
12288
12287
|
delete obs.concept;
|
|
12289
12288
|
obs.uuid = node.initialValue.uuid;
|
|
12290
12289
|
}
|
|
12290
|
+
return this.addFieldNameSpaceandPath(node, obs);
|
|
12291
|
+
};
|
|
12292
|
+
ObsAdapterHelper.prototype.addFieldNameSpaceandPath = function (node, obs) {
|
|
12293
|
+
var _a;
|
|
12294
|
+
obs.formFieldNamespace = this.formFieldNamespace;
|
|
12295
|
+
obs.formFieldPath = "" + ((_a = node === null || node === void 0 ? void 0 : node.question) === null || _a === void 0 ? void 0 : _a.questionIndex) + (node === null || node === void 0 ? void 0 : node.nodeIndex) + this.obsIndex;
|
|
12296
|
+
this.obsIndex++;
|
|
12291
12297
|
return obs;
|
|
12292
12298
|
};
|
|
12293
12299
|
ObsAdapterHelper.prototype.getComplexObsPayload = function (node) {
|
|
@@ -12324,11 +12330,12 @@
|
|
|
12324
12330
|
return null;
|
|
12325
12331
|
};
|
|
12326
12332
|
ObsAdapterHelper.prototype.getMultiselectObsPayload = function (node) {
|
|
12333
|
+
var _this = this;
|
|
12327
12334
|
var payload = [];
|
|
12328
12335
|
var existingUuids = [];
|
|
12329
12336
|
// add voided obs i.e. deleted options
|
|
12330
12337
|
if (Array.isArray(node.initialValue)) {
|
|
12331
|
-
___default[
|
|
12338
|
+
___default['default'].each(node.initialValue, function (item) {
|
|
12332
12339
|
existingUuids.push(item.value.uuid);
|
|
12333
12340
|
if (Array.isArray(node.control.value)) {
|
|
12334
12341
|
if (node.control.value.indexOf(item.value.uuid) < 0) {
|
|
@@ -12349,12 +12356,12 @@
|
|
|
12349
12356
|
}
|
|
12350
12357
|
// add new obs i.e they didn't exisit originally
|
|
12351
12358
|
if (Array.isArray(node.control.value)) {
|
|
12352
|
-
___default[
|
|
12359
|
+
___default['default'].each(node.control.value, function (item) {
|
|
12353
12360
|
if (existingUuids.indexOf(item) < 0) {
|
|
12354
|
-
payload.push({
|
|
12361
|
+
payload.push(_this.addFieldNameSpaceandPath(node, {
|
|
12355
12362
|
concept: node.question.extras.questionOptions.concept,
|
|
12356
12363
|
value: item
|
|
12357
|
-
});
|
|
12364
|
+
}));
|
|
12358
12365
|
}
|
|
12359
12366
|
});
|
|
12360
12367
|
}
|
|
@@ -12364,7 +12371,7 @@
|
|
|
12364
12371
|
var _this = this;
|
|
12365
12372
|
var nodeAsGroup = node;
|
|
12366
12373
|
var childrenPayload = [];
|
|
12367
|
-
___default[
|
|
12374
|
+
___default['default'].each(nodeAsGroup.children, function (child) {
|
|
12368
12375
|
var payload = _this.getObsNodePayload(child);
|
|
12369
12376
|
if (payload.length > 0) {
|
|
12370
12377
|
childrenPayload = childrenPayload.concat(payload);
|
|
@@ -12383,6 +12390,7 @@
|
|
|
12383
12390
|
groupPayload.concept =
|
|
12384
12391
|
nodeAsGroup.question.extras.questionOptions.concept;
|
|
12385
12392
|
}
|
|
12393
|
+
this.addFieldNameSpaceandPath(node, groupPayload);
|
|
12386
12394
|
return groupPayload;
|
|
12387
12395
|
};
|
|
12388
12396
|
ObsAdapterHelper.prototype.getRepeatingGroupPayload = function (node) {
|
|
@@ -12390,7 +12398,7 @@
|
|
|
12390
12398
|
var nodeAsArray = node;
|
|
12391
12399
|
var childrenPayload = [];
|
|
12392
12400
|
var groupsUuidsAfterEditting = [];
|
|
12393
|
-
___default[
|
|
12401
|
+
___default['default'].each(nodeAsArray.children, function (child) {
|
|
12394
12402
|
var payload = _this.getObsNodePayload(child);
|
|
12395
12403
|
if (payload.length > 0) {
|
|
12396
12404
|
childrenPayload = childrenPayload.concat(payload);
|
|
@@ -12402,7 +12410,7 @@
|
|
|
12402
12410
|
// void deleted groups
|
|
12403
12411
|
// console.log('groupsUuidsAfterEditting', groupsUuidsAfterEditting);
|
|
12404
12412
|
if (nodeAsArray.initialValue && Array.isArray(nodeAsArray.initialValue)) {
|
|
12405
|
-
___default[
|
|
12413
|
+
___default['default'].each(nodeAsArray.initialValue, function (obs) {
|
|
12406
12414
|
if (groupsUuidsAfterEditting.indexOf(obs.uuid) < 0) {
|
|
12407
12415
|
var voidedGroup = {
|
|
12408
12416
|
uuid: obs.uuid,
|
|
@@ -12494,7 +12502,7 @@
|
|
|
12494
12502
|
return false;
|
|
12495
12503
|
};
|
|
12496
12504
|
ObsAdapterHelper.prototype.areDatesEqual = function (date1, date2) {
|
|
12497
|
-
return moment__default[
|
|
12505
|
+
return moment__default['default'](date1).isSame(date2);
|
|
12498
12506
|
};
|
|
12499
12507
|
ObsAdapterHelper.prototype.isEmpty = function (value) {
|
|
12500
12508
|
if (value === '' ||
|
|
@@ -12513,7 +12521,7 @@
|
|
|
12513
12521
|
}
|
|
12514
12522
|
else {
|
|
12515
12523
|
// transform value to moment value to avoid error
|
|
12516
|
-
var formattedVal = moment__default[
|
|
12524
|
+
var formattedVal = moment__default['default'](datetime).format();
|
|
12517
12525
|
var val = formattedVal.substring(0, 19).replace('T', ' ');
|
|
12518
12526
|
return this.isEmpty(val) ? undefined : val;
|
|
12519
12527
|
}
|
|
@@ -12566,7 +12574,7 @@
|
|
|
12566
12574
|
node.question.extras &&
|
|
12567
12575
|
node.question.renderingType === 'group') ||
|
|
12568
12576
|
forcegroup) {
|
|
12569
|
-
var groupObs =
|
|
12577
|
+
var groupObs = _.find(payload, function (o) {
|
|
12570
12578
|
return (o.concept.uuid === node.question.extras.questionOptions.concept &&
|
|
12571
12579
|
o.groupMembers);
|
|
12572
12580
|
});
|
|
@@ -12620,7 +12628,7 @@
|
|
|
12620
12628
|
node.question.extras.questionOptions.rendering !== 'multiCheckbox') ||
|
|
12621
12629
|
node.question.extras.questionOptions.rendering !== 'checkbox' ||
|
|
12622
12630
|
node.question.extras.questionOptions.rendering !== 'multi-select') {
|
|
12623
|
-
var obs =
|
|
12631
|
+
var obs = _.find(payload, function (o) {
|
|
12624
12632
|
return o.concept.uuid === node.question.extras.questionOptions.concept;
|
|
12625
12633
|
});
|
|
12626
12634
|
if (obs) {
|
|
@@ -12636,7 +12644,7 @@
|
|
|
12636
12644
|
}
|
|
12637
12645
|
}
|
|
12638
12646
|
else {
|
|
12639
|
-
var multiObs =
|
|
12647
|
+
var multiObs = _.filter(payload, function (o) {
|
|
12640
12648
|
return o.concept.uuid === node.question.extras.questionOptions.concept;
|
|
12641
12649
|
});
|
|
12642
12650
|
if (multiObs && multiObs.length > 0) {
|
|
@@ -12663,7 +12671,7 @@
|
|
|
12663
12671
|
// set the usual obs value
|
|
12664
12672
|
this.setObsValue(valueField, payload);
|
|
12665
12673
|
// set the obs date
|
|
12666
|
-
var obs =
|
|
12674
|
+
var obs = _.find(payload, function (o) {
|
|
12667
12675
|
return o.concept.uuid === node.question.extras.questionOptions.concept;
|
|
12668
12676
|
});
|
|
12669
12677
|
if (obs) {
|
|
@@ -12692,7 +12700,7 @@
|
|
|
12692
12700
|
};
|
|
12693
12701
|
ObsValueAdapter.prototype.setRepeatingGroupValues = function (node, payload) {
|
|
12694
12702
|
var e_3, _a;
|
|
12695
|
-
var groupRepeatingObs =
|
|
12703
|
+
var groupRepeatingObs = _.filter(payload, function (o) {
|
|
12696
12704
|
var found = o.concept.uuid === node.question.extras.questionOptions.concept;
|
|
12697
12705
|
var intersect = false;
|
|
12698
12706
|
if (found && o.groupMembers) {
|
|
@@ -12702,7 +12710,7 @@
|
|
|
12702
12710
|
var schemaQuestions = node.question.questions.map(function (a) {
|
|
12703
12711
|
return a.extras.questionOptions.concept;
|
|
12704
12712
|
});
|
|
12705
|
-
intersect =
|
|
12713
|
+
intersect = _.intersection(obs, schemaQuestions).length > 0;
|
|
12706
12714
|
}
|
|
12707
12715
|
return found && intersect;
|
|
12708
12716
|
});
|
|
@@ -12797,7 +12805,7 @@
|
|
|
12797
12805
|
if (obs.question &&
|
|
12798
12806
|
obs.question.extras &&
|
|
12799
12807
|
obs.question.extras.questionOptions.rendering === 'group') {
|
|
12800
|
-
var members =
|
|
12808
|
+
var members = _.filter(this.getObsPayload(obs.groupMembers), function (o) {
|
|
12801
12809
|
return o.value !== '';
|
|
12802
12810
|
});
|
|
12803
12811
|
var mappedMembers = members.map(function (a) {
|
|
@@ -12857,7 +12865,7 @@
|
|
|
12857
12865
|
var current = {};
|
|
12858
12866
|
for (var key in value) {
|
|
12859
12867
|
if (value.hasOwnProperty(key)) {
|
|
12860
|
-
var groupQuestion =
|
|
12868
|
+
var groupQuestion = _.find(node.question.questions, {
|
|
12861
12869
|
key: key
|
|
12862
12870
|
});
|
|
12863
12871
|
var modelValue = value[key];
|
|
@@ -12950,7 +12958,7 @@
|
|
|
12950
12958
|
ObsValueAdapter.prototype.leftOuterJoinArrays = function (first, second) {
|
|
12951
12959
|
var unique = first.filter(function (obj) {
|
|
12952
12960
|
return !second.some(function (obj2) {
|
|
12953
|
-
return
|
|
12961
|
+
return _.isEqual(obj.value, obj2.value);
|
|
12954
12962
|
});
|
|
12955
12963
|
});
|
|
12956
12964
|
return unique;
|
|
@@ -13339,7 +13347,7 @@
|
|
|
13339
13347
|
dateVoided: o.auditInfo.dateVoided
|
|
13340
13348
|
};
|
|
13341
13349
|
});
|
|
13342
|
-
return (existingOrders =
|
|
13350
|
+
return (existingOrders = _.filter(existingOrders, function (order) {
|
|
13343
13351
|
if (order.voided === true || order.dateVoided) {
|
|
13344
13352
|
return false;
|
|
13345
13353
|
}
|
|
@@ -13502,8 +13510,8 @@
|
|
|
13502
13510
|
case 'encounterDatetime':
|
|
13503
13511
|
if (payload['encounterDatetime']) {
|
|
13504
13512
|
// console.log('date', payload['encounterDatetime']);
|
|
13505
|
-
node.control.setValue(moment__default[
|
|
13506
|
-
node.initialValue = moment__default[
|
|
13513
|
+
node.control.setValue(moment__default['default'](payload['encounterDatetime']).toDate());
|
|
13514
|
+
node.initialValue = moment__default['default'](payload['encounterDatetime']).toDate();
|
|
13507
13515
|
}
|
|
13508
13516
|
break;
|
|
13509
13517
|
case 'encounterProvider':
|
|
@@ -13547,7 +13555,7 @@
|
|
|
13547
13555
|
node.control.value !== '') {
|
|
13548
13556
|
switch (node.question.extras.type) {
|
|
13549
13557
|
case 'encounterDatetime':
|
|
13550
|
-
var dateValue = moment__default[
|
|
13558
|
+
var dateValue = moment__default['default'](node.control.value).utcOffset(rootNode.form.valueProcessingInfo.utcOffset || '+0300');
|
|
13551
13559
|
payload['encounterDatetime'] = dateValue.format();
|
|
13552
13560
|
break;
|
|
13553
13561
|
case 'encounterProvider':
|
|
@@ -13906,15 +13914,15 @@
|
|
|
13906
13914
|
}
|
|
13907
13915
|
var locationUuid = (_b = (_a = node.form.dataSourcesContainer.dataSources) === null || _a === void 0 ? void 0 : _a.userLocation) === null || _b === void 0 ? void 0 : _b.uuid;
|
|
13908
13916
|
if (dataSource && locationUuid) {
|
|
13909
|
-
var startDate = moment__default[
|
|
13917
|
+
var startDate = moment__default['default'](appointmentDate)
|
|
13910
13918
|
.startOf('week')
|
|
13911
13919
|
.add(1, 'day')
|
|
13912
13920
|
.format('YYYY-MM-DD');
|
|
13913
|
-
var endDate = moment__default[
|
|
13921
|
+
var endDate = moment__default['default'](appointmentDate)
|
|
13914
13922
|
.endOf('week')
|
|
13915
13923
|
.subtract(1, 'day')
|
|
13916
13924
|
.format('YYYY-MM-DD');
|
|
13917
|
-
_this.today = moment__default[
|
|
13925
|
+
_this.today = moment__default['default'](appointmentDate).format('DD-MM-YYYY');
|
|
13918
13926
|
// create 5 week days
|
|
13919
13927
|
var scheduledAppointments_1 = [];
|
|
13920
13928
|
var programTypes = [
|
|
@@ -13930,7 +13938,7 @@
|
|
|
13930
13938
|
var programTypeParams = programTypes.join();
|
|
13931
13939
|
for (var i = 1; i <= 5; i++) {
|
|
13932
13940
|
scheduledAppointments_1.push({
|
|
13933
|
-
date: moment__default[
|
|
13941
|
+
date: moment__default['default'](appointmentDate)
|
|
13934
13942
|
.startOf('week')
|
|
13935
13943
|
.add(i, 'day')
|
|
13936
13944
|
.format('DD-MM-YYYY'),
|
|
@@ -14403,19 +14411,19 @@
|
|
|
14403
14411
|
};
|
|
14404
14412
|
|
|
14405
14413
|
/* eslint-disable @angular-eslint/component-class-suffix, @angular-eslint/directive-class-suffix */
|
|
14406
|
-
var Option = /** @class */ (function () {
|
|
14414
|
+
var Option$1 = /** @class */ (function () {
|
|
14407
14415
|
function Option() {
|
|
14408
14416
|
this.inputClass = 'cds--select-option';
|
|
14409
14417
|
}
|
|
14410
14418
|
return Option;
|
|
14411
14419
|
}());
|
|
14412
|
-
Option.decorators = [
|
|
14420
|
+
Option$1.decorators = [
|
|
14413
14421
|
{ type: i0.Directive, args: [{
|
|
14414
14422
|
// eslint-disable-next-line
|
|
14415
14423
|
selector: 'option'
|
|
14416
14424
|
},] }
|
|
14417
14425
|
];
|
|
14418
|
-
Option.propDecorators = {
|
|
14426
|
+
Option$1.propDecorators = {
|
|
14419
14427
|
inputClass: [{ type: i0.HostBinding, args: ['class',] }]
|
|
14420
14428
|
};
|
|
14421
14429
|
|
|
@@ -14444,8 +14452,8 @@
|
|
|
14444
14452
|
}());
|
|
14445
14453
|
SelectModule.decorators = [
|
|
14446
14454
|
{ type: i0.NgModule, args: [{
|
|
14447
|
-
declarations: [Select, Option, OptGroup],
|
|
14448
|
-
exports: [Select, Option, OptGroup],
|
|
14455
|
+
declarations: [Select, Option$1, OptGroup],
|
|
14456
|
+
exports: [Select, Option$1, OptGroup],
|
|
14449
14457
|
imports: [common.CommonModule, forms.FormsModule]
|
|
14450
14458
|
},] }
|
|
14451
14459
|
];
|
|
@@ -14865,7 +14873,6 @@
|
|
|
14865
14873
|
return Pair;
|
|
14866
14874
|
}());
|
|
14867
14875
|
|
|
14868
|
-
exports.RenderingType = void 0;
|
|
14869
14876
|
(function (RenderingType) {
|
|
14870
14877
|
RenderingType[RenderingType["Form"] = 0] = "Form";
|
|
14871
14878
|
RenderingType[RenderingType["Page"] = 1] = "Page";
|
|
@@ -14910,7 +14917,7 @@
|
|
|
14910
14917
|
exports.NgxDateTimePickerModule = NgxDateTimePickerModule;
|
|
14911
14918
|
exports.ObsAdapterHelper = ObsAdapterHelper;
|
|
14912
14919
|
exports.ObsValueAdapter = ObsValueAdapter;
|
|
14913
|
-
exports.Option = Option
|
|
14920
|
+
exports.Option = Option;
|
|
14914
14921
|
exports.OrderValueAdapter = OrderValueAdapter;
|
|
14915
14922
|
exports.Pair = Pair;
|
|
14916
14923
|
exports.PersonAttribuAdapter = PersonAttribuAdapter;
|
|
@@ -14925,91 +14932,91 @@
|
|
|
14925
14932
|
exports.UiSelectQuestion = UiSelectQuestion;
|
|
14926
14933
|
exports.ValidationFactory = ValidationFactory;
|
|
14927
14934
|
exports.ValidationModel = ValidationModel;
|
|
14928
|
-
exports
|
|
14929
|
-
exports
|
|
14930
|
-
exports
|
|
14931
|
-
exports
|
|
14932
|
-
exports
|
|
14933
|
-
exports
|
|
14934
|
-
exports
|
|
14935
|
-
exports
|
|
14936
|
-
exports
|
|
14937
|
-
exports
|
|
14938
|
-
exports
|
|
14939
|
-
exports
|
|
14940
|
-
exports
|
|
14941
|
-
exports
|
|
14942
|
-
exports
|
|
14943
|
-
exports
|
|
14944
|
-
exports
|
|
14945
|
-
exports
|
|
14946
|
-
exports
|
|
14947
|
-
exports
|
|
14948
|
-
exports
|
|
14949
|
-
exports
|
|
14950
|
-
exports
|
|
14951
|
-
exports
|
|
14952
|
-
exports
|
|
14953
|
-
exports
|
|
14954
|
-
exports
|
|
14955
|
-
exports
|
|
14956
|
-
exports
|
|
14957
|
-
exports
|
|
14958
|
-
exports
|
|
14959
|
-
exports
|
|
14960
|
-
exports
|
|
14961
|
-
exports
|
|
14962
|
-
exports
|
|
14963
|
-
exports
|
|
14964
|
-
exports
|
|
14965
|
-
exports
|
|
14966
|
-
exports
|
|
14967
|
-
exports
|
|
14968
|
-
exports
|
|
14969
|
-
exports
|
|
14970
|
-
exports
|
|
14971
|
-
exports
|
|
14972
|
-
exports
|
|
14973
|
-
exports
|
|
14974
|
-
exports
|
|
14975
|
-
exports
|
|
14976
|
-
exports
|
|
14977
|
-
exports
|
|
14978
|
-
exports
|
|
14979
|
-
exports
|
|
14980
|
-
exports
|
|
14981
|
-
exports
|
|
14982
|
-
exports
|
|
14983
|
-
exports
|
|
14984
|
-
exports
|
|
14985
|
-
exports
|
|
14986
|
-
exports
|
|
14987
|
-
exports
|
|
14988
|
-
exports
|
|
14989
|
-
exports
|
|
14990
|
-
exports
|
|
14991
|
-
exports
|
|
14992
|
-
exports
|
|
14993
|
-
exports
|
|
14994
|
-
exports
|
|
14995
|
-
exports
|
|
14996
|
-
exports
|
|
14997
|
-
exports
|
|
14998
|
-
exports
|
|
14999
|
-
exports
|
|
15000
|
-
exports
|
|
15001
|
-
exports
|
|
15002
|
-
exports
|
|
15003
|
-
exports
|
|
15004
|
-
exports
|
|
15005
|
-
exports
|
|
15006
|
-
exports
|
|
15007
|
-
exports
|
|
15008
|
-
exports
|
|
15009
|
-
exports
|
|
15010
|
-
exports
|
|
14935
|
+
exports.ɵa = SelectModule;
|
|
14936
|
+
exports.ɵb = Select;
|
|
14937
|
+
exports.ɵba = OWL_DIALOG_SCROLL_STRATEGY;
|
|
14938
|
+
exports.ɵbb = OWL_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY;
|
|
14939
|
+
exports.ɵbc = OWL_DIALOG_SCROLL_STRATEGY_PROVIDER;
|
|
14940
|
+
exports.ɵbd = OWL_DIALOG_DEFAULT_OPTIONS;
|
|
14941
|
+
exports.ɵbe = OwlDialogService;
|
|
14942
|
+
exports.ɵbf = OwlDialogConfig;
|
|
14943
|
+
exports.ɵbg = OwlCalendarComponent;
|
|
14944
|
+
exports.ɵbi = OWL_DATE_TIME_FORMATS;
|
|
14945
|
+
exports.ɵbj = OwlDateTimeIntl;
|
|
14946
|
+
exports.ɵbk = OWL_DATE_TIME_LOCALE;
|
|
14947
|
+
exports.ɵbl = OWL_DATE_TIME_LOCALE_FACTORY;
|
|
14948
|
+
exports.ɵbm = DateTimeAdapter;
|
|
14949
|
+
exports.ɵbn = OwlTimerComponent;
|
|
14950
|
+
exports.ɵbo = OwlDateTimeTriggerDirective;
|
|
14951
|
+
exports.ɵbp = OWL_DATETIME_VALUE_ACCESSOR;
|
|
14952
|
+
exports.ɵbq = OWL_DATETIME_VALIDATORS;
|
|
14953
|
+
exports.ɵbr = OwlDateTimeInputDirective;
|
|
14954
|
+
exports.ɵbs = OWL_DTPICKER_SCROLL_STRATEGY;
|
|
14955
|
+
exports.ɵbt = OWL_DTPICKER_SCROLL_STRATEGY_PROVIDER_FACTORY;
|
|
14956
|
+
exports.ɵbu = OWL_DTPICKER_SCROLL_STRATEGY_PROVIDER;
|
|
14957
|
+
exports.ɵbv = OwlDateTimeComponent;
|
|
14958
|
+
exports.ɵbw = OwlDateTime;
|
|
14959
|
+
exports.ɵbx = OWL_DATETIME_VALUE_ACCESSOR$1;
|
|
14960
|
+
exports.ɵby = OwlDateTimeInlineComponent;
|
|
14961
|
+
exports.ɵbz = OwlDateTimeContainerComponent;
|
|
14962
|
+
exports.ɵc = Option$1;
|
|
14963
|
+
exports.ɵca = owlDateTimePickerAnimations;
|
|
14964
|
+
exports.ɵcb = OwlMultiYearViewComponent;
|
|
14965
|
+
exports.ɵcc = OwlCalendarBodyComponent;
|
|
14966
|
+
exports.ɵcd = OwlYearViewComponent;
|
|
14967
|
+
exports.ɵce = OwlMonthViewComponent;
|
|
14968
|
+
exports.ɵcf = OwlTimerBoxComponent;
|
|
14969
|
+
exports.ɵcg = NumberFixedLenPipe;
|
|
14970
|
+
exports.ɵch = NativeDateTimeModule;
|
|
14971
|
+
exports.ɵci = OwlNativeDateTimeModule;
|
|
14972
|
+
exports.ɵcj = NativeDateTimeAdapter;
|
|
14973
|
+
exports.ɵck = OWL_NATIVE_DATE_TIME_FORMATS;
|
|
14974
|
+
exports.ɵcl = NgxDatetimeComponent;
|
|
14975
|
+
exports.ɵcm = CustomControlWrapperModule;
|
|
14976
|
+
exports.ɵcn = CustomControlWrapperComponent;
|
|
14977
|
+
exports.ɵco = CustomComponentWrapperModule;
|
|
14978
|
+
exports.ɵcp = CustomComponentWrapperComponent;
|
|
14979
|
+
exports.ɵcq = NgxTabSetModule;
|
|
14980
|
+
exports.ɵcr = TabComponent;
|
|
14981
|
+
exports.ɵcs = TabSetComponent;
|
|
14982
|
+
exports.ɵct = HoverClassDirective;
|
|
14983
|
+
exports.ɵcu = FormRendererComponent;
|
|
14984
|
+
exports.ɵcv = AfeNgSelectComponent;
|
|
14985
|
+
exports.ɵcw = AppointmentsOverviewComponent;
|
|
14986
|
+
exports.ɵcx = HistoricalValueDirective;
|
|
14987
|
+
exports.ɵcy = HistoricalFieldHelperService;
|
|
14988
|
+
exports.ɵcz = ErrorRendererComponent;
|
|
14989
|
+
exports.ɵd = OptGroup;
|
|
14990
|
+
exports.ɵda = TimeAgoPipe;
|
|
14991
|
+
exports.ɵdb = CollapseDirective;
|
|
14992
|
+
exports.ɵdc = HidersDisablersFactory;
|
|
14993
|
+
exports.ɵdd = ExpressionRunner;
|
|
14994
|
+
exports.ɵde = DebugModeService;
|
|
14995
|
+
exports.ɵdf = AlertsFactory;
|
|
14996
|
+
exports.ɵe = NumberInputModule;
|
|
14997
|
+
exports.ɵf = NumberInputComponent;
|
|
14998
|
+
exports.ɵg = InputModule;
|
|
14999
|
+
exports.ɵh = Label;
|
|
15000
|
+
exports.ɵi = TextArea;
|
|
15001
|
+
exports.ɵj = TextInput;
|
|
15002
|
+
exports.ɵk = DatePickerComponent;
|
|
15003
|
+
exports.ɵl = TimePickerComponent;
|
|
15004
|
+
exports.ɵm = ModalComponent;
|
|
15005
|
+
exports.ɵn = MomentPipe;
|
|
15006
|
+
exports.ɵo = DateTimePickerComponent;
|
|
15007
|
+
exports.ɵp = NgxRemoteSelectModule;
|
|
15008
|
+
exports.ɵq = RemoteSelectComponent;
|
|
15009
|
+
exports.ɵr = RemoteFileUploadModule;
|
|
15010
|
+
exports.ɵs = SharedModule;
|
|
15011
|
+
exports.ɵt = SecurePipe;
|
|
15012
|
+
exports.ɵu = FileUploadComponent;
|
|
15013
|
+
exports.ɵv = CheckboxModule;
|
|
15014
|
+
exports.ɵw = CheckboxControlComponent;
|
|
15015
|
+
exports.ɵx = OwlDateTimeModule;
|
|
15016
|
+
exports.ɵy = OwlDialogModule;
|
|
15017
|
+
exports.ɵz = OwlDialogContainerComponent;
|
|
15011
15018
|
|
|
15012
15019
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
15013
15020
|
|
|
15014
|
-
}));
|
|
15021
|
+
})));
|
|
15015
15022
|
//# sourceMappingURL=openmrs-ngx-formentry.umd.js.map
|