@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,11 +1,9 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Injectable, Pipe, ChangeDetectorRef, NgZone, Component, Inject, Input, EventEmitter, Directive, Output, HostListener, ElementRef, Renderer2, HostBinding, TemplateRef, forwardRef, NgModule, WrappedValue, ChangeDetectionStrategy, InjectionToken, inject, LOCALE_ID, Optional, ViewChild, Injector, SkipSelf, ViewContainerRef, CUSTOM_ELEMENTS_SCHEMA, ContentChild, ContentChildren } from '@angular/core';
|
|
1
|
+
import { Injectable, Pipe, ChangeDetectorRef, NgZone, Component, Inject, Input, EventEmitter, Directive, Output, HostListener, ElementRef, Renderer2, HostBinding, TemplateRef, forwardRef, NgModule, WrappedValue, ChangeDetectionStrategy, ɵɵdefineInjectable, InjectionToken, inject, LOCALE_ID, Optional, ViewChild, Injector, SkipSelf, ViewContainerRef, CUSTOM_ELEMENTS_SCHEMA, ContentChild, ContentChildren } from '@angular/core';
|
|
3
2
|
import { DOCUMENT, CommonModule, Location } from '@angular/common';
|
|
4
3
|
import { AbstractControl, FormControl, FormGroup, FormArray, Validators, NG_VALUE_ACCESSOR, FormsModule, NG_VALIDATORS, ReactiveFormsModule, FormBuilder } from '@angular/forms';
|
|
5
4
|
import { Subject, BehaviorSubject, Subscription, defer, merge, of, concat } from 'rxjs';
|
|
6
5
|
import moment from 'moment';
|
|
7
|
-
import
|
|
8
|
-
import ___default from 'lodash';
|
|
6
|
+
import _, { first, forEach, last, findIndex, filter, isArray, each, isUndefined, isEmpty, includes, find, intersection, isEqual } from 'lodash';
|
|
9
7
|
import { style, animate, AnimationBuilder, trigger, state, transition, group, query, animateChild, keyframes } from '@angular/animations';
|
|
10
8
|
import { NgSelectModule } from '@ng-select/ng-select';
|
|
11
9
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
@@ -16,7 +14,7 @@ import { NoopScrollStrategy, Overlay, OverlayConfig, OverlayContainer, OverlayMo
|
|
|
16
14
|
import { BasePortalOutlet, CdkPortalOutlet, ComponentPortal, PortalInjector, PortalModule } from '@angular/cdk/portal';
|
|
17
15
|
import { SPACE, LEFT_ARROW, UP_ARROW, RIGHT_ARROW, DOWN_ARROW, ESCAPE, ENTER, PAGE_DOWN, PAGE_UP, END, HOME } from '@angular/cdk/keycodes';
|
|
18
16
|
import { coerceBooleanProperty, coerceNumberProperty, coerceArray } from '@angular/cdk/coercion';
|
|
19
|
-
import { take, filter, startWith, debounceTime, distinctUntilChanged, tap, switchMap, catchError } from 'rxjs/operators';
|
|
17
|
+
import { take, filter as filter$1, startWith, debounceTime, distinctUntilChanged, tap, switchMap, catchError } from 'rxjs/operators';
|
|
20
18
|
import { Platform, PlatformModule } from '@angular/cdk/platform';
|
|
21
19
|
import { LazyElementsModule } from '@angular-extensions/elements';
|
|
22
20
|
|
|
@@ -1333,7 +1331,7 @@ class JsExpressionHelper {
|
|
|
1333
1331
|
if (height && weight) {
|
|
1334
1332
|
bmi = (weight / (((height / 100) * height) / 100)).toFixed(1);
|
|
1335
1333
|
}
|
|
1336
|
-
const refSectionObject =
|
|
1334
|
+
const refSectionObject = first(bmiForAgeRef);
|
|
1337
1335
|
let formattedSDValue;
|
|
1338
1336
|
if (refSectionObject) {
|
|
1339
1337
|
const refObjectValues = Object.keys(refSectionObject)
|
|
@@ -1346,14 +1344,14 @@ class JsExpressionHelper {
|
|
|
1346
1344
|
minReferencePoint.push(minimumValue);
|
|
1347
1345
|
}
|
|
1348
1346
|
else {
|
|
1349
|
-
|
|
1347
|
+
forEach(refObjectValues, (value) => {
|
|
1350
1348
|
if (value <= bmi) {
|
|
1351
1349
|
minReferencePoint.push(value);
|
|
1352
1350
|
}
|
|
1353
1351
|
});
|
|
1354
1352
|
}
|
|
1355
|
-
const lastReferenceValue =
|
|
1356
|
-
const lastValueIndex =
|
|
1353
|
+
const lastReferenceValue = last(minReferencePoint);
|
|
1354
|
+
const lastValueIndex = findIndex(refObjectValues, (o) => {
|
|
1357
1355
|
return o === lastReferenceValue;
|
|
1358
1356
|
});
|
|
1359
1357
|
const SDValue = refObjectKeys[lastValueIndex];
|
|
@@ -1383,11 +1381,11 @@ class JsExpressionHelper {
|
|
|
1383
1381
|
formattedSDValue = -4;
|
|
1384
1382
|
}
|
|
1385
1383
|
else {
|
|
1386
|
-
refSection =
|
|
1384
|
+
refSection = filter(weightForHeightRef, (refObject) => {
|
|
1387
1385
|
return parseFloat(refObject['Length']).toFixed(1) === height;
|
|
1388
1386
|
});
|
|
1389
1387
|
}
|
|
1390
|
-
const refSectionObject =
|
|
1388
|
+
const refSectionObject = first(refSection);
|
|
1391
1389
|
if (refSectionObject) {
|
|
1392
1390
|
const refObjectValues = Object.keys(refSectionObject)
|
|
1393
1391
|
.map((key) => refSectionObject[key])
|
|
@@ -1399,14 +1397,14 @@ class JsExpressionHelper {
|
|
|
1399
1397
|
minReferencePoint.push(minimumValue);
|
|
1400
1398
|
}
|
|
1401
1399
|
else {
|
|
1402
|
-
|
|
1400
|
+
forEach(refObjectValues, (value) => {
|
|
1403
1401
|
if (value <= weight) {
|
|
1404
1402
|
minReferencePoint.push(value);
|
|
1405
1403
|
}
|
|
1406
1404
|
});
|
|
1407
1405
|
}
|
|
1408
|
-
const lastReferenceValue =
|
|
1409
|
-
const lastValueIndex =
|
|
1406
|
+
const lastReferenceValue = last(minReferencePoint);
|
|
1407
|
+
const lastValueIndex = findIndex(refObjectValues, (o) => {
|
|
1410
1408
|
return o === lastReferenceValue;
|
|
1411
1409
|
});
|
|
1412
1410
|
const SDValue = refObjectKeys[lastValueIndex];
|
|
@@ -1425,7 +1423,7 @@ class JsExpressionHelper {
|
|
|
1425
1423
|
return height && weight ? formattedSDValue : null;
|
|
1426
1424
|
}
|
|
1427
1425
|
calcHeightForAgeZscore(heightForAgeRef, height, weight) {
|
|
1428
|
-
const refSectionObject =
|
|
1426
|
+
const refSectionObject = first(heightForAgeRef);
|
|
1429
1427
|
let formattedSDValue;
|
|
1430
1428
|
if (refSectionObject) {
|
|
1431
1429
|
const refObjectValues = Object.keys(refSectionObject)
|
|
@@ -1438,14 +1436,14 @@ class JsExpressionHelper {
|
|
|
1438
1436
|
minReferencePoint.push(minimumValue);
|
|
1439
1437
|
}
|
|
1440
1438
|
else {
|
|
1441
|
-
|
|
1439
|
+
forEach(refObjectValues, (value) => {
|
|
1442
1440
|
if (value <= height) {
|
|
1443
1441
|
minReferencePoint.push(value);
|
|
1444
1442
|
}
|
|
1445
1443
|
});
|
|
1446
1444
|
}
|
|
1447
|
-
const lastReferenceValue =
|
|
1448
|
-
const lastValueIndex =
|
|
1445
|
+
const lastReferenceValue = last(minReferencePoint);
|
|
1446
|
+
const lastValueIndex = findIndex(refObjectValues, (o) => {
|
|
1449
1447
|
return o === lastReferenceValue;
|
|
1450
1448
|
});
|
|
1451
1449
|
const SDValue = refObjectKeys[lastValueIndex];
|
|
@@ -1593,7 +1591,7 @@ class ValidationFactory {
|
|
|
1593
1591
|
getValidators(question, form) {
|
|
1594
1592
|
const list = [];
|
|
1595
1593
|
if (question.validators) {
|
|
1596
|
-
|
|
1594
|
+
forEach(question.validators, (validator) => {
|
|
1597
1595
|
switch (validator.type) {
|
|
1598
1596
|
case 'date':
|
|
1599
1597
|
list.push(this.dateValidator);
|
|
@@ -2267,7 +2265,7 @@ class Form {
|
|
|
2267
2265
|
if (arrayNode &&
|
|
2268
2266
|
arrayNode.children &&
|
|
2269
2267
|
arrayNode.children.length > 0) {
|
|
2270
|
-
|
|
2268
|
+
forEach(arrayNode.children, (groupNode) => {
|
|
2271
2269
|
this.markInvalidControls(groupNode, invalidControlNodes);
|
|
2272
2270
|
});
|
|
2273
2271
|
}
|
|
@@ -2349,7 +2347,7 @@ class ErrorRendererComponent {
|
|
|
2349
2347
|
}
|
|
2350
2348
|
announceErrorField(errorNode) {
|
|
2351
2349
|
const nodes = this.form.searchNodeByQuestionId(errorNode.path.substring(0, errorNode.path.indexOf('.')));
|
|
2352
|
-
|
|
2350
|
+
forEach(nodes, (node) => {
|
|
2353
2351
|
if (node.question.renderingType === 'page') {
|
|
2354
2352
|
const pageIndex = this.getPageIndex(node);
|
|
2355
2353
|
this.formErrorsService.announceErrorField(pageIndex + ',' + errorNode.question.key);
|
|
@@ -2381,10 +2379,10 @@ class HistoricalFieldHelperService {
|
|
|
2381
2379
|
getDisplayTextFromOptions(question, valueProperty, displayProperty) {
|
|
2382
2380
|
let displayText = '';
|
|
2383
2381
|
const historicalValue = question.historicalDataValue;
|
|
2384
|
-
if (
|
|
2382
|
+
if (isArray(historicalValue.value)) {
|
|
2385
2383
|
let valueConverted = 0;
|
|
2386
|
-
|
|
2387
|
-
|
|
2384
|
+
each(historicalValue.value, (val) => {
|
|
2385
|
+
each(question.options, (option) => {
|
|
2388
2386
|
if (option[valueProperty] === val) {
|
|
2389
2387
|
if (valueConverted === 0) {
|
|
2390
2388
|
displayText = displayText + option[displayProperty];
|
|
@@ -2398,7 +2396,7 @@ class HistoricalFieldHelperService {
|
|
|
2398
2396
|
});
|
|
2399
2397
|
}
|
|
2400
2398
|
else {
|
|
2401
|
-
|
|
2399
|
+
each(question.options, (option) => {
|
|
2402
2400
|
if (option[valueProperty] === historicalValue.value) {
|
|
2403
2401
|
displayText = option[displayProperty];
|
|
2404
2402
|
}
|
|
@@ -2440,7 +2438,7 @@ class HistoricalValueDirective {
|
|
|
2440
2438
|
if (node) {
|
|
2441
2439
|
this._node = node;
|
|
2442
2440
|
if (this._node.question.enableHistoricalValue &&
|
|
2443
|
-
!
|
|
2441
|
+
!isUndefined(this._node.question.historicalDataValue)) {
|
|
2444
2442
|
const display = { text: '', _date: '' };
|
|
2445
2443
|
if (this._node.question.renderingType === 'select' ||
|
|
2446
2444
|
this._node.question.renderingType === 'multi-select' ||
|
|
@@ -2449,7 +2447,7 @@ class HistoricalValueDirective {
|
|
|
2449
2447
|
display._date = this._node.question.historicalDataValue.valueDate;
|
|
2450
2448
|
this._node.question['historicalDisplay'] = display;
|
|
2451
2449
|
}
|
|
2452
|
-
else if (!
|
|
2450
|
+
else if (!isUndefined(this._node.question.historicalDataValue)) {
|
|
2453
2451
|
display.text = this._node.question.historicalDataValue.value;
|
|
2454
2452
|
display._date = this._node.question.historicalDataValue.valueDate;
|
|
2455
2453
|
this._node.question['historicalDisplay'] = display;
|
|
@@ -3105,7 +3103,7 @@ class DatePickerComponent {
|
|
|
3105
3103
|
ngOnInit() {
|
|
3106
3104
|
this.initValue();
|
|
3107
3105
|
// default to current year range
|
|
3108
|
-
|
|
3106
|
+
_.each(this.fullYearRange, (v, i) => {
|
|
3109
3107
|
this.currentYear = this.calendarDate.clone().startOf('year').year();
|
|
3110
3108
|
if (v.indexOf(this.currentYear) !== -1) {
|
|
3111
3109
|
this.displayYearsIndex = i;
|
|
@@ -3189,7 +3187,7 @@ class DatePickerComponent {
|
|
|
3189
3187
|
for (let year = startYr; year <= currentYear; year++) {
|
|
3190
3188
|
years.push(year);
|
|
3191
3189
|
}
|
|
3192
|
-
this.fullYearRange =
|
|
3190
|
+
this.fullYearRange = _.chunk(years, 14);
|
|
3193
3191
|
}
|
|
3194
3192
|
initValue() {
|
|
3195
3193
|
// set moment locale (default is en)
|
|
@@ -3250,7 +3248,7 @@ DatePickerComponent.decorators = [
|
|
|
3250
3248
|
{ type: Component, args: [{
|
|
3251
3249
|
selector: 'date-picker',
|
|
3252
3250
|
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",
|
|
3253
|
-
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)}"]
|
|
3251
|
+
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)}"]
|
|
3254
3252
|
},] }
|
|
3255
3253
|
];
|
|
3256
3254
|
DatePickerComponent.ctorParameters = () => [];
|
|
@@ -3361,7 +3359,7 @@ TimePickerComponent.decorators = [
|
|
|
3361
3359
|
{ type: Component, args: [{
|
|
3362
3360
|
selector: 'time-picker',
|
|
3363
3361
|
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",
|
|
3364
|
-
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)}"]
|
|
3362
|
+
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)}"]
|
|
3365
3363
|
},] }
|
|
3366
3364
|
];
|
|
3367
3365
|
TimePickerComponent.ctorParameters = () => [];
|
|
@@ -3654,7 +3652,7 @@ class OwlDateTimeIntl {
|
|
|
3654
3652
|
this.hour12PMLabel = 'PM';
|
|
3655
3653
|
}
|
|
3656
3654
|
}
|
|
3657
|
-
OwlDateTimeIntl.ɵprov =
|
|
3655
|
+
OwlDateTimeIntl.ɵprov = ɵɵdefineInjectable({ factory: function OwlDateTimeIntl_Factory() { return new OwlDateTimeIntl(); }, token: OwlDateTimeIntl, providedIn: "root" });
|
|
3658
3656
|
OwlDateTimeIntl.decorators = [
|
|
3659
3657
|
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
3660
3658
|
];
|
|
@@ -4993,13 +4991,13 @@ class OwlDialogRef {
|
|
|
4993
4991
|
/** Whether the user is allowed to close the dialog. */
|
|
4994
4992
|
this.disableClose = this.container.config.disableClose;
|
|
4995
4993
|
this.container.animationStateChanged
|
|
4996
|
-
.pipe(filter((event) => event.phaseName === 'done' && event.toState === 'enter'), take(1))
|
|
4994
|
+
.pipe(filter$1((event) => event.phaseName === 'done' && event.toState === 'enter'), take(1))
|
|
4997
4995
|
.subscribe(() => {
|
|
4998
4996
|
this._afterOpen$.next();
|
|
4999
4997
|
this._afterOpen$.complete();
|
|
5000
4998
|
});
|
|
5001
4999
|
this.container.animationStateChanged
|
|
5002
|
-
.pipe(filter((event) => event.phaseName === 'done' && event.toState === 'exit'), take(1))
|
|
5000
|
+
.pipe(filter$1((event) => event.phaseName === 'done' && event.toState === 'exit'), take(1))
|
|
5003
5001
|
.subscribe(() => {
|
|
5004
5002
|
this.overlayRef.dispose();
|
|
5005
5003
|
this.locationChanged.unsubscribe();
|
|
@@ -5009,7 +5007,7 @@ class OwlDialogRef {
|
|
|
5009
5007
|
});
|
|
5010
5008
|
this.overlayRef
|
|
5011
5009
|
.keydownEvents()
|
|
5012
|
-
.pipe(filter((event) => event.keyCode === ESCAPE && !this.disableClose))
|
|
5010
|
+
.pipe(filter$1((event) => event.keyCode === ESCAPE && !this.disableClose))
|
|
5013
5011
|
.subscribe(() => this.close());
|
|
5014
5012
|
if (location) {
|
|
5015
5013
|
this.locationChanged = location.subscribe(() => {
|
|
@@ -5022,7 +5020,7 @@ class OwlDialogRef {
|
|
|
5022
5020
|
close(dialogResult) {
|
|
5023
5021
|
this.result = dialogResult;
|
|
5024
5022
|
this.container.animationStateChanged
|
|
5025
|
-
.pipe(filter((event) => event.phaseName === 'start'), take(1))
|
|
5023
|
+
.pipe(filter$1((event) => event.phaseName === 'start'), take(1))
|
|
5026
5024
|
.subscribe(() => {
|
|
5027
5025
|
this._beforeClose$.next(dialogResult);
|
|
5028
5026
|
this._beforeClose$.complete();
|
|
@@ -5946,7 +5944,7 @@ class OwlDateTimeComponent extends OwlDateTime {
|
|
|
5946
5944
|
this.popupRef = this.overlay.create(overlayConfig);
|
|
5947
5945
|
merge(this.popupRef.backdropClick(), this.popupRef.detachments(), this.popupRef
|
|
5948
5946
|
.keydownEvents()
|
|
5949
|
-
.pipe(filter((event) => event.keyCode === ESCAPE ||
|
|
5947
|
+
.pipe(filter$1((event) => event.keyCode === ESCAPE ||
|
|
5950
5948
|
(this._dtInput && event.altKey && event.keyCode === UP_ARROW)))).subscribe(() => this.close());
|
|
5951
5949
|
}
|
|
5952
5950
|
/**
|
|
@@ -6103,7 +6101,7 @@ OwlDateTimeTriggerDirective.propDecorators = {
|
|
|
6103
6101
|
};
|
|
6104
6102
|
|
|
6105
6103
|
/* eslint-disable @angular-eslint/no-host-metadata-property */
|
|
6106
|
-
const OWL_DATETIME_VALUE_ACCESSOR
|
|
6104
|
+
const OWL_DATETIME_VALUE_ACCESSOR = {
|
|
6107
6105
|
provide: NG_VALUE_ACCESSOR,
|
|
6108
6106
|
useExisting: forwardRef(() => OwlDateTimeInputDirective),
|
|
6109
6107
|
multi: true
|
|
@@ -6658,7 +6656,7 @@ OwlDateTimeInputDirective.decorators = [
|
|
|
6658
6656
|
'[attr.max]': 'maxIso8601',
|
|
6659
6657
|
'[disabled]': 'owlDateTimeInputDisabled'
|
|
6660
6658
|
},
|
|
6661
|
-
providers: [OWL_DATETIME_VALUE_ACCESSOR
|
|
6659
|
+
providers: [OWL_DATETIME_VALUE_ACCESSOR, OWL_DATETIME_VALIDATORS]
|
|
6662
6660
|
},] }
|
|
6663
6661
|
];
|
|
6664
6662
|
OwlDateTimeInputDirective.ctorParameters = () => [
|
|
@@ -8055,7 +8053,7 @@ NumberFixedLenPipe.decorators = [
|
|
|
8055
8053
|
];
|
|
8056
8054
|
|
|
8057
8055
|
/* eslint-disable @angular-eslint/no-host-metadata-property */
|
|
8058
|
-
const OWL_DATETIME_VALUE_ACCESSOR = {
|
|
8056
|
+
const OWL_DATETIME_VALUE_ACCESSOR$1 = {
|
|
8059
8057
|
provide: NG_VALUE_ACCESSOR,
|
|
8060
8058
|
useExisting: forwardRef(() => OwlDateTimeInlineComponent),
|
|
8061
8059
|
multi: true
|
|
@@ -8271,7 +8269,7 @@ OwlDateTimeInlineComponent.decorators = [
|
|
|
8271
8269
|
},
|
|
8272
8270
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
8273
8271
|
preserveWhitespaces: false,
|
|
8274
|
-
providers: [OWL_DATETIME_VALUE_ACCESSOR],
|
|
8272
|
+
providers: [OWL_DATETIME_VALUE_ACCESSOR$1],
|
|
8275
8273
|
styles: [""]
|
|
8276
8274
|
},] }
|
|
8277
8275
|
];
|
|
@@ -8398,9 +8396,9 @@ const DEFAULT_DAY_OF_WEEK_NAMES = {
|
|
|
8398
8396
|
short: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],
|
|
8399
8397
|
narrow: ['S', 'M', 'T', 'W', 'T', 'F', 'S']
|
|
8400
8398
|
};
|
|
8401
|
-
const ɵ0
|
|
8399
|
+
const ɵ0 = (i) => String(i + 1);
|
|
8402
8400
|
/** The default date names to use if Intl API is not available. */
|
|
8403
|
-
const DEFAULT_DATE_NAMES = range(31, ɵ0
|
|
8401
|
+
const DEFAULT_DATE_NAMES = range(31, ɵ0);
|
|
8404
8402
|
/** Whether the browser supports the Intl API. */
|
|
8405
8403
|
const SUPPORTS_INTL_API = typeof Intl !== 'undefined';
|
|
8406
8404
|
/**
|
|
@@ -8716,14 +8714,14 @@ NativeDateTimeModule.decorators = [
|
|
|
8716
8714
|
providers: [{ provide: DateTimeAdapter, useClass: NativeDateTimeAdapter }]
|
|
8717
8715
|
},] }
|
|
8718
8716
|
];
|
|
8719
|
-
const ɵ0 = OWL_NATIVE_DATE_TIME_FORMATS;
|
|
8717
|
+
const ɵ0$1 = OWL_NATIVE_DATE_TIME_FORMATS;
|
|
8720
8718
|
class OwlNativeDateTimeModule {
|
|
8721
8719
|
}
|
|
8722
8720
|
OwlNativeDateTimeModule.decorators = [
|
|
8723
8721
|
{ type: NgModule, args: [{
|
|
8724
8722
|
imports: [NativeDateTimeModule],
|
|
8725
8723
|
providers: [
|
|
8726
|
-
{ provide: OWL_DATE_TIME_FORMATS, useValue: ɵ0 }
|
|
8724
|
+
{ provide: OWL_DATE_TIME_FORMATS, useValue: ɵ0$1 }
|
|
8727
8725
|
]
|
|
8728
8726
|
},] }
|
|
8729
8727
|
];
|
|
@@ -8748,7 +8746,7 @@ NgxDateTimePickerModule.decorators = [
|
|
|
8748
8746
|
},] }
|
|
8749
8747
|
];
|
|
8750
8748
|
|
|
8751
|
-
class Option
|
|
8749
|
+
class Option {
|
|
8752
8750
|
constructor(options) {
|
|
8753
8751
|
this.label = options.label;
|
|
8754
8752
|
this.value = options.value;
|
|
@@ -8789,7 +8787,7 @@ class AfeNgSelectComponent {
|
|
|
8789
8787
|
// console.log('options', options);
|
|
8790
8788
|
const mappedOptions = new Array();
|
|
8791
8789
|
for (let i = 0; i < options.length; i++) {
|
|
8792
|
-
mappedOptions.push(new Option
|
|
8790
|
+
mappedOptions.push(new Option(options[i]));
|
|
8793
8791
|
}
|
|
8794
8792
|
this.subject.next(mappedOptions);
|
|
8795
8793
|
}, (error) => {
|
|
@@ -8843,12 +8841,12 @@ class FormSchemaCompiler {
|
|
|
8843
8841
|
compileFormSchema(formSchema, referencedComponents) {
|
|
8844
8842
|
// get all referenced forms
|
|
8845
8843
|
const refForms = this.getReferencedForms(formSchema, referencedComponents);
|
|
8846
|
-
if (
|
|
8844
|
+
if (isEmpty(refForms)) {
|
|
8847
8845
|
return formSchema;
|
|
8848
8846
|
}
|
|
8849
8847
|
// get all place-holders from the form schema
|
|
8850
8848
|
const placeHolders = this.getAllPlaceholderObjects(formSchema);
|
|
8851
|
-
if (
|
|
8849
|
+
if (isEmpty(placeHolders)) {
|
|
8852
8850
|
return formSchema;
|
|
8853
8851
|
}
|
|
8854
8852
|
// replace all placeHolders
|
|
@@ -8856,11 +8854,11 @@ class FormSchemaCompiler {
|
|
|
8856
8854
|
return formSchema;
|
|
8857
8855
|
}
|
|
8858
8856
|
findSchemaByName(schemaArray, nameOfSchema) {
|
|
8859
|
-
if (
|
|
8857
|
+
if (isEmpty(schemaArray) || isEmpty(nameOfSchema)) {
|
|
8860
8858
|
return;
|
|
8861
8859
|
}
|
|
8862
8860
|
let foundSchema = {};
|
|
8863
|
-
|
|
8861
|
+
each(schemaArray, (schema) => {
|
|
8864
8862
|
if (schema.name === nameOfSchema) {
|
|
8865
8863
|
foundSchema = schema;
|
|
8866
8864
|
}
|
|
@@ -8868,11 +8866,11 @@ class FormSchemaCompiler {
|
|
|
8868
8866
|
return foundSchema;
|
|
8869
8867
|
}
|
|
8870
8868
|
getPageInSchemaByLabel(schema, pageLabel) {
|
|
8871
|
-
if (
|
|
8869
|
+
if (isEmpty(schema) || isEmpty(pageLabel)) {
|
|
8872
8870
|
return;
|
|
8873
8871
|
}
|
|
8874
8872
|
let foundPage = {};
|
|
8875
|
-
|
|
8873
|
+
each(schema.pages, (page) => {
|
|
8876
8874
|
if (page.label === pageLabel) {
|
|
8877
8875
|
foundPage = page;
|
|
8878
8876
|
}
|
|
@@ -8880,15 +8878,15 @@ class FormSchemaCompiler {
|
|
|
8880
8878
|
return foundPage;
|
|
8881
8879
|
}
|
|
8882
8880
|
getSectionInSchemaByPageLabelBySectionLabel(schema, pageLabel, sectionLabel) {
|
|
8883
|
-
if (
|
|
8881
|
+
if (isEmpty(schema) || isEmpty(pageLabel) || isEmpty(sectionLabel)) {
|
|
8884
8882
|
return;
|
|
8885
8883
|
}
|
|
8886
8884
|
const foundPage = this.getPageInSchemaByLabel(schema, pageLabel);
|
|
8887
|
-
if (
|
|
8885
|
+
if (isEmpty(foundPage)) {
|
|
8888
8886
|
return;
|
|
8889
8887
|
}
|
|
8890
8888
|
let foundSection = {};
|
|
8891
|
-
|
|
8889
|
+
each(foundPage.sections, (section) => {
|
|
8892
8890
|
if (section.label === sectionLabel) {
|
|
8893
8891
|
foundSection = section;
|
|
8894
8892
|
}
|
|
@@ -8896,16 +8894,16 @@ class FormSchemaCompiler {
|
|
|
8896
8894
|
return foundSection;
|
|
8897
8895
|
}
|
|
8898
8896
|
getQuestionByIdInSchema(schema, questionId) {
|
|
8899
|
-
if (
|
|
8897
|
+
if (isEmpty(schema) || isEmpty(questionId)) {
|
|
8900
8898
|
return;
|
|
8901
8899
|
}
|
|
8902
8900
|
if (Array.isArray(schema)) {
|
|
8903
8901
|
let question;
|
|
8904
8902
|
for (let i = 0; i < schema.length; i++) {
|
|
8905
|
-
if (!
|
|
8903
|
+
if (!isEmpty(schema[i])) {
|
|
8906
8904
|
question = this.getQuestionByIdInSchema(schema[i], questionId);
|
|
8907
8905
|
}
|
|
8908
|
-
if (!
|
|
8906
|
+
if (!isEmpty(question)) {
|
|
8909
8907
|
break;
|
|
8910
8908
|
}
|
|
8911
8909
|
}
|
|
@@ -8928,7 +8926,7 @@ class FormSchemaCompiler {
|
|
|
8928
8926
|
}
|
|
8929
8927
|
}
|
|
8930
8928
|
getQuestionsArrayByQuestionIdInSchema(schema, questionId) {
|
|
8931
|
-
if (
|
|
8929
|
+
if (isEmpty(schema) || isEmpty(questionId)) {
|
|
8932
8930
|
return;
|
|
8933
8931
|
}
|
|
8934
8932
|
return this.getQuestionsArrayByQuestionId(schema, schema, questionId);
|
|
@@ -8937,10 +8935,10 @@ class FormSchemaCompiler {
|
|
|
8937
8935
|
if (Array.isArray(object)) {
|
|
8938
8936
|
let returnedValue;
|
|
8939
8937
|
for (let i = 0; i < object.length; i++) {
|
|
8940
|
-
if (!
|
|
8938
|
+
if (!isEmpty(object[i])) {
|
|
8941
8939
|
returnedValue = this.getQuestionsArrayByQuestionId(object, object[i], questionId);
|
|
8942
8940
|
}
|
|
8943
|
-
if (!
|
|
8941
|
+
if (!isEmpty(returnedValue)) {
|
|
8944
8942
|
break;
|
|
8945
8943
|
}
|
|
8946
8944
|
}
|
|
@@ -8966,9 +8964,9 @@ class FormSchemaCompiler {
|
|
|
8966
8964
|
isSchemaSubObjectExpandable(object) {
|
|
8967
8965
|
if (typeof object === 'object') {
|
|
8968
8966
|
const objectKeys = Object.keys(object);
|
|
8969
|
-
if (
|
|
8970
|
-
|
|
8971
|
-
|
|
8967
|
+
if (includes(objectKeys, 'pages') ||
|
|
8968
|
+
includes(objectKeys, 'sections') ||
|
|
8969
|
+
includes(objectKeys, 'questions')) {
|
|
8972
8970
|
return true;
|
|
8973
8971
|
}
|
|
8974
8972
|
}
|
|
@@ -8983,18 +8981,18 @@ class FormSchemaCompiler {
|
|
|
8983
8981
|
return referencedObjects;
|
|
8984
8982
|
}
|
|
8985
8983
|
extractPlaceholderObjects(subSchema, objectsArray) {
|
|
8986
|
-
if (
|
|
8984
|
+
if (isEmpty(subSchema)) {
|
|
8987
8985
|
return;
|
|
8988
8986
|
}
|
|
8989
8987
|
if (Array.isArray(subSchema)) {
|
|
8990
8988
|
for (let i = 0; i < subSchema.length; i++) {
|
|
8991
|
-
if (!
|
|
8989
|
+
if (!isEmpty(subSchema[i])) {
|
|
8992
8990
|
this.extractPlaceholderObjects(subSchema[i], objectsArray);
|
|
8993
8991
|
}
|
|
8994
8992
|
}
|
|
8995
8993
|
}
|
|
8996
8994
|
else if (typeof subSchema === 'object') {
|
|
8997
|
-
if (!
|
|
8995
|
+
if (!isEmpty(subSchema.reference)) {
|
|
8998
8996
|
objectsArray.push(subSchema);
|
|
8999
8997
|
}
|
|
9000
8998
|
else if (this.isSchemaSubObjectExpandable(subSchema)) {
|
|
@@ -9005,16 +9003,16 @@ class FormSchemaCompiler {
|
|
|
9005
9003
|
}
|
|
9006
9004
|
fillPlaceholderObject(placeHolderObject, referenceObject) {
|
|
9007
9005
|
for (const member in referenceObject) {
|
|
9008
|
-
if (
|
|
9006
|
+
if (isEmpty(placeHolderObject[member])) {
|
|
9009
9007
|
placeHolderObject[member] = referenceObject[member];
|
|
9010
9008
|
}
|
|
9011
9009
|
}
|
|
9012
9010
|
return placeHolderObject;
|
|
9013
9011
|
}
|
|
9014
9012
|
replaceAllPlaceholdersWithActualObjects(keyValReferencedForms, placeHoldersArray) {
|
|
9015
|
-
|
|
9013
|
+
each(placeHoldersArray, (placeHolder) => {
|
|
9016
9014
|
const referencedObject = this.getReferencedObject(placeHolder.reference, keyValReferencedForms);
|
|
9017
|
-
if (
|
|
9015
|
+
if (isEmpty(referencedObject)) {
|
|
9018
9016
|
console.error('Form compile: Error finding referenced object', placeHolder.reference);
|
|
9019
9017
|
}
|
|
9020
9018
|
else {
|
|
@@ -9034,7 +9032,7 @@ class FormSchemaCompiler {
|
|
|
9034
9032
|
}
|
|
9035
9033
|
removeExcludedQuestionsFromPlaceholder(placeHolder) {
|
|
9036
9034
|
if (Array.isArray(placeHolder.reference.excludeQuestions)) {
|
|
9037
|
-
|
|
9035
|
+
each(placeHolder.reference.excludeQuestions, (excludedQuestionId) => {
|
|
9038
9036
|
const questionsArray = this.getQuestionsArrayByQuestionIdInSchema(placeHolder, excludedQuestionId);
|
|
9039
9037
|
if (!Array.isArray(questionsArray)) {
|
|
9040
9038
|
return;
|
|
@@ -9046,32 +9044,32 @@ class FormSchemaCompiler {
|
|
|
9046
9044
|
return placeHolder;
|
|
9047
9045
|
}
|
|
9048
9046
|
getReferencedObject(referenceData, keyValReferencedForms) {
|
|
9049
|
-
if (
|
|
9047
|
+
if (isEmpty(referenceData.form)) {
|
|
9050
9048
|
console.error('Form compile: reference missing form attribute', referenceData);
|
|
9051
9049
|
return;
|
|
9052
9050
|
}
|
|
9053
|
-
if (
|
|
9051
|
+
if (isEmpty(keyValReferencedForms[referenceData.form])) {
|
|
9054
9052
|
console.error('Form compile: referenced form alias not found', referenceData);
|
|
9055
9053
|
return;
|
|
9056
9054
|
}
|
|
9057
|
-
if (!
|
|
9055
|
+
if (!isEmpty(referenceData.questionId)) {
|
|
9058
9056
|
return this.getQuestionByIdInSchema(keyValReferencedForms[referenceData.form], referenceData.questionId);
|
|
9059
9057
|
}
|
|
9060
|
-
if (!
|
|
9058
|
+
if (!isEmpty(referenceData.page) && !isEmpty(referenceData.section)) {
|
|
9061
9059
|
return this.getSectionInSchemaByPageLabelBySectionLabel(keyValReferencedForms[referenceData.form], referenceData.page, referenceData.section);
|
|
9062
9060
|
}
|
|
9063
|
-
if (!
|
|
9061
|
+
if (!isEmpty(referenceData.page)) {
|
|
9064
9062
|
return this.getPageInSchemaByLabel(keyValReferencedForms[referenceData.form], referenceData.page);
|
|
9065
9063
|
}
|
|
9066
9064
|
console.error('Form compile: Unsupported reference type', referenceData.reference);
|
|
9067
9065
|
}
|
|
9068
9066
|
getReferencedForms(formSchema, formSchemasLookupArray) {
|
|
9069
9067
|
const referencedForms = formSchema.referencedForms;
|
|
9070
|
-
if (
|
|
9068
|
+
if (isEmpty(referencedForms)) {
|
|
9071
9069
|
return;
|
|
9072
9070
|
}
|
|
9073
9071
|
const keyValReferencedForms = {};
|
|
9074
|
-
|
|
9072
|
+
each(referencedForms, (reference) => {
|
|
9075
9073
|
keyValReferencedForms[reference.alias] = this.findSchemaByName(formSchemasLookupArray, reference.formName);
|
|
9076
9074
|
});
|
|
9077
9075
|
return keyValReferencedForms;
|
|
@@ -9229,7 +9227,7 @@ class DummyDataSource {
|
|
|
9229
9227
|
resolveSelectedValue(value) {
|
|
9230
9228
|
let selectOptions = this.sampleData();
|
|
9231
9229
|
selectOptions = selectOptions.map(function (obj) {
|
|
9232
|
-
const option = new Option
|
|
9230
|
+
const option = new Option({
|
|
9233
9231
|
label: obj.label,
|
|
9234
9232
|
value: obj.concept
|
|
9235
9233
|
});
|
|
@@ -9254,7 +9252,7 @@ class DummyDataSource {
|
|
|
9254
9252
|
searchOptions(searchText) {
|
|
9255
9253
|
let selectOptions = this.sampleData();
|
|
9256
9254
|
selectOptions = selectOptions.map(function (obj) {
|
|
9257
|
-
const option = new Option
|
|
9255
|
+
const option = new Option({
|
|
9258
9256
|
label: obj.label,
|
|
9259
9257
|
value: obj.concept
|
|
9260
9258
|
});
|
|
@@ -9345,13 +9343,13 @@ class HistoricalEncounterDataService {
|
|
|
9345
9343
|
return encStore.data[index];
|
|
9346
9344
|
}
|
|
9347
9345
|
};
|
|
9348
|
-
if (
|
|
9346
|
+
if (_.isArray(encounters)) {
|
|
9349
9347
|
const group = [];
|
|
9350
|
-
|
|
9348
|
+
_.each(encounters, (encounter) => {
|
|
9351
9349
|
group.push(this._transformEncounter(encounter));
|
|
9352
9350
|
});
|
|
9353
9351
|
// Sort them in reverse chronological order
|
|
9354
|
-
encStore.data =
|
|
9352
|
+
encStore.data = _.sortBy(group, 'encounterDatetime').reverse();
|
|
9355
9353
|
}
|
|
9356
9354
|
else {
|
|
9357
9355
|
// Assume a single openmrs rest encounter object.
|
|
@@ -9376,19 +9374,19 @@ class HistoricalEncounterDataService {
|
|
|
9376
9374
|
}
|
|
9377
9375
|
}
|
|
9378
9376
|
getAllValues(path, object, answers) {
|
|
9379
|
-
if (
|
|
9377
|
+
if (_.isNil(object)) {
|
|
9380
9378
|
return;
|
|
9381
9379
|
}
|
|
9382
9380
|
if (path.length <= 1) {
|
|
9383
|
-
if (!
|
|
9381
|
+
if (!_.isNil(object[path[0]])) {
|
|
9384
9382
|
answers.push(object[path[0]]);
|
|
9385
9383
|
}
|
|
9386
9384
|
return;
|
|
9387
9385
|
}
|
|
9388
9386
|
const newpath = path.splice(1);
|
|
9389
9387
|
const key = path[0];
|
|
9390
|
-
if (
|
|
9391
|
-
|
|
9388
|
+
if (_.isArray(object[key]) && object[key].length > 0) {
|
|
9389
|
+
_.each(object[key], (childObject) => {
|
|
9392
9390
|
this.getAllValues(newpath.slice(0), childObject, answers);
|
|
9393
9391
|
});
|
|
9394
9392
|
}
|
|
@@ -9397,7 +9395,7 @@ class HistoricalEncounterDataService {
|
|
|
9397
9395
|
}
|
|
9398
9396
|
}
|
|
9399
9397
|
_transformEncounter(encounter) {
|
|
9400
|
-
if (
|
|
9398
|
+
if (_.isNil(encounter)) {
|
|
9401
9399
|
return;
|
|
9402
9400
|
}
|
|
9403
9401
|
// Transform encounter Level details to key value pairs.
|
|
@@ -9424,7 +9422,7 @@ class HistoricalEncounterDataService {
|
|
|
9424
9422
|
if (encounter.obs) {
|
|
9425
9423
|
const processedObs = this._transformObs(encounter.obs);
|
|
9426
9424
|
// add in individual processed obs to prevEncounter
|
|
9427
|
-
|
|
9425
|
+
_.extend(prevEncounter, processedObs);
|
|
9428
9426
|
}
|
|
9429
9427
|
return prevEncounter;
|
|
9430
9428
|
}
|
|
@@ -9433,19 +9431,19 @@ class HistoricalEncounterDataService {
|
|
|
9433
9431
|
return null;
|
|
9434
9432
|
}
|
|
9435
9433
|
const obsRep = {};
|
|
9436
|
-
if (
|
|
9437
|
-
|
|
9434
|
+
if (_.isArray(obs)) {
|
|
9435
|
+
_.each(obs, (singleObs) => {
|
|
9438
9436
|
this._augumentObs(obsRep, this._transformObs(singleObs));
|
|
9439
9437
|
});
|
|
9440
9438
|
return obsRep;
|
|
9441
9439
|
}
|
|
9442
9440
|
else if (obs.groupMembers) {
|
|
9443
9441
|
const group = {};
|
|
9444
|
-
|
|
9442
|
+
_.each(obs.groupMembers, (member) => {
|
|
9445
9443
|
this._augumentObs(group, this._transformObs(member));
|
|
9446
9444
|
});
|
|
9447
9445
|
// Handle already existing data
|
|
9448
|
-
if (obsRep[obs.concept.uuid] &&
|
|
9446
|
+
if (obsRep[obs.concept.uuid] && _.isArray(obsRep[obs.concept.uuid])) {
|
|
9449
9447
|
obsRep[obs.concept.uuid].push(group);
|
|
9450
9448
|
}
|
|
9451
9449
|
else {
|
|
@@ -9465,14 +9463,14 @@ class HistoricalEncounterDataService {
|
|
|
9465
9463
|
}
|
|
9466
9464
|
_augumentObs(existing, toAdd) {
|
|
9467
9465
|
for (const key in toAdd) {
|
|
9468
|
-
if (
|
|
9466
|
+
if (_.has(existing, key)) {
|
|
9469
9467
|
// check if not an array yet
|
|
9470
|
-
if (!
|
|
9468
|
+
if (!_.isArray(existing[key])) {
|
|
9471
9469
|
const temp = existing[key];
|
|
9472
9470
|
existing[key] = [temp];
|
|
9473
9471
|
}
|
|
9474
9472
|
// Check whether the incoming is array (for group members)
|
|
9475
|
-
if (
|
|
9473
|
+
if (_.isArray(toAdd[key])) {
|
|
9476
9474
|
Array.prototype.push.apply(existing[key], toAdd[key]);
|
|
9477
9475
|
}
|
|
9478
9476
|
else {
|
|
@@ -9528,6 +9526,7 @@ class QuestionFactory {
|
|
|
9528
9526
|
constructor() {
|
|
9529
9527
|
this.dataSources = {};
|
|
9530
9528
|
this.historicalHelperService = new HistoricalHelperService();
|
|
9529
|
+
this.quetionIndex = 0;
|
|
9531
9530
|
}
|
|
9532
9531
|
createQuestionModel(formSchema, form) {
|
|
9533
9532
|
if (form) {
|
|
@@ -9538,6 +9537,7 @@ class QuestionFactory {
|
|
|
9538
9537
|
}
|
|
9539
9538
|
toSelectQuestion(schemaQuestion) {
|
|
9540
9539
|
const question = new SelectQuestion({ options: [], type: '', key: '' });
|
|
9540
|
+
question.questionIndex = this.quetionIndex;
|
|
9541
9541
|
question.label = schemaQuestion.label;
|
|
9542
9542
|
question.prefix = schemaQuestion.prefix;
|
|
9543
9543
|
question.key = schemaQuestion.id;
|
|
@@ -9574,6 +9574,7 @@ class QuestionFactory {
|
|
|
9574
9574
|
type: '',
|
|
9575
9575
|
key: ''
|
|
9576
9576
|
});
|
|
9577
|
+
question.questionIndex = this.quetionIndex;
|
|
9577
9578
|
question.label = schemaQuestion.label;
|
|
9578
9579
|
question.prefix = schemaQuestion.prefix;
|
|
9579
9580
|
question.key = schemaQuestion.id;
|
|
@@ -9601,6 +9602,7 @@ class QuestionFactory {
|
|
|
9601
9602
|
type: '',
|
|
9602
9603
|
key: ''
|
|
9603
9604
|
});
|
|
9605
|
+
question.questionIndex = this.quetionIndex;
|
|
9604
9606
|
question.label = schemaQuestion.label;
|
|
9605
9607
|
question.prefix = schemaQuestion.prefix;
|
|
9606
9608
|
question.key = schemaQuestion.id;
|
|
@@ -9626,6 +9628,7 @@ class QuestionFactory {
|
|
|
9626
9628
|
return this.toEncounterDatetimeQuestion(schemaQuestion);
|
|
9627
9629
|
}
|
|
9628
9630
|
const question = new DateQuestion({ type: '', key: '' });
|
|
9631
|
+
question.questionIndex = this.quetionIndex;
|
|
9629
9632
|
question.renderingType = 'date';
|
|
9630
9633
|
question.validators = this.addValidators(schemaQuestion);
|
|
9631
9634
|
question.extras = schemaQuestion;
|
|
@@ -9649,6 +9652,7 @@ class QuestionFactory {
|
|
|
9649
9652
|
toEncounterDatetimeQuestion(schemaQuestion) {
|
|
9650
9653
|
var _a;
|
|
9651
9654
|
const question = new DateQuestion({ type: '', key: '' });
|
|
9655
|
+
question.questionIndex = this.quetionIndex;
|
|
9652
9656
|
question.label = schemaQuestion.label;
|
|
9653
9657
|
question.prefix = schemaQuestion.prefix;
|
|
9654
9658
|
question.renderingType = 'date';
|
|
@@ -9675,6 +9679,7 @@ class QuestionFactory {
|
|
|
9675
9679
|
}
|
|
9676
9680
|
toCheckBoxQuestion(schemaQuestion) {
|
|
9677
9681
|
const question = new CheckBoxQuestion({ options: [], type: '', key: '' });
|
|
9682
|
+
question.questionIndex = this.quetionIndex;
|
|
9678
9683
|
question.label = schemaQuestion.label;
|
|
9679
9684
|
question.prefix = schemaQuestion.prefix;
|
|
9680
9685
|
question.key = schemaQuestion.id;
|
|
@@ -9708,6 +9713,7 @@ class QuestionFactory {
|
|
|
9708
9713
|
type: '',
|
|
9709
9714
|
key: ''
|
|
9710
9715
|
});
|
|
9716
|
+
question.questionIndex = this.quetionIndex;
|
|
9711
9717
|
question.label = schemaQuestion.label;
|
|
9712
9718
|
question.prefix = schemaQuestion.prefix;
|
|
9713
9719
|
question.key = schemaQuestion.id;
|
|
@@ -9741,6 +9747,7 @@ class QuestionFactory {
|
|
|
9741
9747
|
type: '',
|
|
9742
9748
|
key: ''
|
|
9743
9749
|
});
|
|
9750
|
+
question.questionIndex = this.quetionIndex;
|
|
9744
9751
|
question.label = schemaQuestion.label;
|
|
9745
9752
|
question.prefix = schemaQuestion.prefix;
|
|
9746
9753
|
question.key = schemaQuestion.id;
|
|
@@ -9769,6 +9776,7 @@ class QuestionFactory {
|
|
|
9769
9776
|
type: '',
|
|
9770
9777
|
key: ''
|
|
9771
9778
|
});
|
|
9779
|
+
question.questionIndex = this.quetionIndex;
|
|
9772
9780
|
question.label = schemaQuestion.label;
|
|
9773
9781
|
question.prefix = schemaQuestion.prefix;
|
|
9774
9782
|
question.key = schemaQuestion.id;
|
|
@@ -9792,6 +9800,7 @@ class QuestionFactory {
|
|
|
9792
9800
|
}
|
|
9793
9801
|
toFileUploadQuestion(schemaQuestion) {
|
|
9794
9802
|
const question = new FileUploadQuestion({ type: '', key: '' });
|
|
9803
|
+
question.questionIndex = this.quetionIndex;
|
|
9795
9804
|
question.label = schemaQuestion.label;
|
|
9796
9805
|
question.prefix = schemaQuestion.prefix;
|
|
9797
9806
|
question.key = schemaQuestion.id;
|
|
@@ -9814,6 +9823,7 @@ class QuestionFactory {
|
|
|
9814
9823
|
}
|
|
9815
9824
|
toDrugQuestion(schemaQuestion) {
|
|
9816
9825
|
const question = new SelectQuestion({ options: [], type: '', key: '' });
|
|
9826
|
+
question.questionIndex = this.quetionIndex;
|
|
9817
9827
|
question.label = schemaQuestion.label;
|
|
9818
9828
|
question.prefix = schemaQuestion.prefix;
|
|
9819
9829
|
question.key = schemaQuestion.id;
|
|
@@ -9836,6 +9846,7 @@ class QuestionFactory {
|
|
|
9836
9846
|
}
|
|
9837
9847
|
toProblemQuestion(schemaQuestion) {
|
|
9838
9848
|
const question = new SelectQuestion({ options: [], type: '', key: '' });
|
|
9849
|
+
question.questionIndex = this.quetionIndex;
|
|
9839
9850
|
question.label = schemaQuestion.label;
|
|
9840
9851
|
question.prefix = schemaQuestion.prefix;
|
|
9841
9852
|
question.key = schemaQuestion.id;
|
|
@@ -9858,6 +9869,7 @@ class QuestionFactory {
|
|
|
9858
9869
|
}
|
|
9859
9870
|
toConceptAnswerSelect(schemaQuestion) {
|
|
9860
9871
|
const question = new SelectQuestion({ options: [], type: '', key: '' });
|
|
9872
|
+
question.questionIndex = this.quetionIndex;
|
|
9861
9873
|
question.label = schemaQuestion.label;
|
|
9862
9874
|
question.prefix = schemaQuestion.prefix;
|
|
9863
9875
|
question.key = schemaQuestion.id;
|
|
@@ -9888,6 +9900,7 @@ class QuestionFactory {
|
|
|
9888
9900
|
type: '',
|
|
9889
9901
|
key: ''
|
|
9890
9902
|
});
|
|
9903
|
+
question.questionIndex = this.quetionIndex;
|
|
9891
9904
|
question.label = schemaQuestion.label;
|
|
9892
9905
|
question.prefix = schemaQuestion.prefix;
|
|
9893
9906
|
question.questions = this.getChildrenQuestionModels(schemaQuestion.questions);
|
|
@@ -9915,6 +9928,7 @@ class QuestionFactory {
|
|
|
9915
9928
|
}
|
|
9916
9929
|
toGroupQuestion(schemaQuestion) {
|
|
9917
9930
|
const question = new QuestionGroup({ questions: [], type: '', key: '' });
|
|
9931
|
+
question.questionIndex = this.quetionIndex;
|
|
9918
9932
|
question.label = schemaQuestion.label;
|
|
9919
9933
|
question.prefix = schemaQuestion.prefix;
|
|
9920
9934
|
question.questions = this.getChildrenQuestionModels(schemaQuestion.questions);
|
|
@@ -9983,6 +9997,7 @@ class QuestionFactory {
|
|
|
9983
9997
|
searchFunction: function () { },
|
|
9984
9998
|
resolveFunction: function () { }
|
|
9985
9999
|
});
|
|
10000
|
+
question.questionIndex = this.quetionIndex;
|
|
9986
10001
|
question.label = schemaQuestion.label;
|
|
9987
10002
|
question.prefix = schemaQuestion.prefix;
|
|
9988
10003
|
question.key = schemaQuestion.id;
|
|
@@ -10012,6 +10027,7 @@ class QuestionFactory {
|
|
|
10012
10027
|
searchFunction: function () { },
|
|
10013
10028
|
resolveFunction: function () { }
|
|
10014
10029
|
});
|
|
10030
|
+
question.questionIndex = this.quetionIndex;
|
|
10015
10031
|
question.label = schemaQuestion.label;
|
|
10016
10032
|
question.prefix = schemaQuestion.prefix;
|
|
10017
10033
|
question.key = schemaQuestion.id;
|
|
@@ -10046,6 +10062,7 @@ class QuestionFactory {
|
|
|
10046
10062
|
searchFunction: function () { },
|
|
10047
10063
|
resolveFunction: function () { }
|
|
10048
10064
|
});
|
|
10065
|
+
question.questionIndex = this.quetionIndex;
|
|
10049
10066
|
question.label = schemaQuestion.label;
|
|
10050
10067
|
question.prefix = schemaQuestion.prefix;
|
|
10051
10068
|
question.key = schemaQuestion.id;
|
|
@@ -10077,6 +10094,7 @@ class QuestionFactory {
|
|
|
10077
10094
|
label: '',
|
|
10078
10095
|
rendering: ''
|
|
10079
10096
|
});
|
|
10097
|
+
question.questionIndex = this.quetionIndex;
|
|
10080
10098
|
question.label = schemaQuestion.label;
|
|
10081
10099
|
question.prefix = schemaQuestion.prefix;
|
|
10082
10100
|
question.key = schemaQuestion.id;
|
|
@@ -10141,6 +10159,7 @@ class QuestionFactory {
|
|
|
10141
10159
|
return children;
|
|
10142
10160
|
}
|
|
10143
10161
|
toModel(schema, renderType) {
|
|
10162
|
+
this.quetionIndex++;
|
|
10144
10163
|
if (renderType === 'ui-select-extended') {
|
|
10145
10164
|
renderType = schema.type;
|
|
10146
10165
|
}
|
|
@@ -10252,7 +10271,7 @@ class QuestionFactory {
|
|
|
10252
10271
|
const validators = [];
|
|
10253
10272
|
if (schemaQuestion.validators) {
|
|
10254
10273
|
// TODO - add more validator types
|
|
10255
|
-
|
|
10274
|
+
_.forEach(schemaQuestion.validators, (validator) => {
|
|
10256
10275
|
switch (validator.type) {
|
|
10257
10276
|
case 'date':
|
|
10258
10277
|
validators.push(new DateValidationModel(validator));
|
|
@@ -10395,6 +10414,7 @@ class FormFactory {
|
|
|
10395
10414
|
this.controlService = controlService;
|
|
10396
10415
|
this.questionFactroy = questionFactroy;
|
|
10397
10416
|
this.controlRelationsFactory = controlRelationsFactory;
|
|
10417
|
+
this.nodeIndex = 0;
|
|
10398
10418
|
this.hd = {
|
|
10399
10419
|
getValue: () => {
|
|
10400
10420
|
return 20;
|
|
@@ -10436,6 +10456,8 @@ class FormFactory {
|
|
|
10436
10456
|
else {
|
|
10437
10457
|
node = this.createLeafNode(question, parentNode, parentControl, form);
|
|
10438
10458
|
}
|
|
10459
|
+
node.nodeIndex = this.nodeIndex;
|
|
10460
|
+
this.nodeIndex++;
|
|
10439
10461
|
return node;
|
|
10440
10462
|
}
|
|
10441
10463
|
createLeafNode(question, parentNode, parentControl, form) {
|
|
@@ -10513,15 +10535,19 @@ FormFactory.ctorParameters = () => [
|
|
|
10513
10535
|
];
|
|
10514
10536
|
|
|
10515
10537
|
class ObsAdapterHelper {
|
|
10516
|
-
constructor() {
|
|
10538
|
+
constructor() {
|
|
10539
|
+
this.formFieldNamespace = 'O3';
|
|
10540
|
+
this.obsIndex = 0;
|
|
10541
|
+
}
|
|
10517
10542
|
findObsAnswerToQuestion(node, obsArray) {
|
|
10543
|
+
// Find and Order the obs based on form_namespace_and_path
|
|
10518
10544
|
const found = [];
|
|
10519
10545
|
if (!this.isObsNode(node)) {
|
|
10520
10546
|
return found;
|
|
10521
10547
|
}
|
|
10522
10548
|
if (node instanceof LeafNode ||
|
|
10523
10549
|
(node instanceof GroupNode && node.question.extras.type === 'complex-obs')) {
|
|
10524
|
-
|
|
10550
|
+
_.each(obsArray, (item) => {
|
|
10525
10551
|
if (item.concept &&
|
|
10526
10552
|
item.concept.uuid === node.question.extras.questionOptions.concept) {
|
|
10527
10553
|
found.push(item);
|
|
@@ -10532,7 +10558,7 @@ class ObsAdapterHelper {
|
|
|
10532
10558
|
// At this point the node is either a group or a repeating node
|
|
10533
10559
|
const childQuestionsUuids = this.getChildQuestionsConceptUuids(node);
|
|
10534
10560
|
if (childQuestionsUuids.length > 0) {
|
|
10535
|
-
|
|
10561
|
+
_.each(obsArray, (obs) => {
|
|
10536
10562
|
if (obs.concept &&
|
|
10537
10563
|
obs.concept.uuid === node.question.extras.questionOptions.concept &&
|
|
10538
10564
|
Array.isArray(obs.groupMembers) &&
|
|
@@ -10546,7 +10572,7 @@ class ObsAdapterHelper {
|
|
|
10546
10572
|
getChildQuestionsConceptUuids(node) {
|
|
10547
10573
|
const found = [];
|
|
10548
10574
|
if (node.question.extras && node.question.extras.questions) {
|
|
10549
|
-
|
|
10575
|
+
_.each(node.question.extras.questions, (question) => {
|
|
10550
10576
|
if (question.questionOptions && question.questionOptions.concept) {
|
|
10551
10577
|
found.push(question.questionOptions.concept);
|
|
10552
10578
|
}
|
|
@@ -10557,7 +10583,7 @@ class ObsAdapterHelper {
|
|
|
10557
10583
|
getGroupMembersConceptUuids(obsWithGroupMembers) {
|
|
10558
10584
|
const found = [];
|
|
10559
10585
|
if (Array.isArray(obsWithGroupMembers.groupMembers)) {
|
|
10560
|
-
|
|
10586
|
+
_.each(obsWithGroupMembers.groupMembers, (member) => {
|
|
10561
10587
|
found.push(member.concept.uuid);
|
|
10562
10588
|
});
|
|
10563
10589
|
}
|
|
@@ -10594,6 +10620,7 @@ class ObsAdapterHelper {
|
|
|
10594
10620
|
}
|
|
10595
10621
|
setMultiselectObsNodeValue(node, obs) {
|
|
10596
10622
|
if (node && obs.length > 0) {
|
|
10623
|
+
obs = obs.sort(this.comparePath);
|
|
10597
10624
|
node.initialValue = obs;
|
|
10598
10625
|
const obsUuids = [];
|
|
10599
10626
|
for (const m of obs) {
|
|
@@ -10639,6 +10666,7 @@ class ObsAdapterHelper {
|
|
|
10639
10666
|
setRepeatingGroupObsNodeValue(node, obs) {
|
|
10640
10667
|
if (node && obs.length > 0) {
|
|
10641
10668
|
const arrayNode = node;
|
|
10669
|
+
obs = obs.sort(this.comparePath);
|
|
10642
10670
|
arrayNode.initialValue = obs;
|
|
10643
10671
|
for (let i = 0; i < obs.length; i++) {
|
|
10644
10672
|
const createdNode = arrayNode.createChildNode();
|
|
@@ -10646,6 +10674,12 @@ class ObsAdapterHelper {
|
|
|
10646
10674
|
}
|
|
10647
10675
|
}
|
|
10648
10676
|
}
|
|
10677
|
+
comparePath(first, second) {
|
|
10678
|
+
if (!first || !second) {
|
|
10679
|
+
return -1;
|
|
10680
|
+
}
|
|
10681
|
+
return Number(first.formFieldPath) - Number(second.formFieldPath);
|
|
10682
|
+
}
|
|
10649
10683
|
setNodeValue(node, obs) {
|
|
10650
10684
|
switch (this.getObsNodeType(node)) {
|
|
10651
10685
|
case 'unknown':
|
|
@@ -10770,6 +10804,13 @@ class ObsAdapterHelper {
|
|
|
10770
10804
|
delete obs.concept;
|
|
10771
10805
|
obs.uuid = node.initialValue.uuid;
|
|
10772
10806
|
}
|
|
10807
|
+
return this.addFieldNameSpaceandPath(node, obs);
|
|
10808
|
+
}
|
|
10809
|
+
addFieldNameSpaceandPath(node, obs) {
|
|
10810
|
+
var _a;
|
|
10811
|
+
obs.formFieldNamespace = this.formFieldNamespace;
|
|
10812
|
+
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}`;
|
|
10813
|
+
this.obsIndex++;
|
|
10773
10814
|
return obs;
|
|
10774
10815
|
}
|
|
10775
10816
|
getComplexObsPayload(node) {
|
|
@@ -10810,7 +10851,7 @@ class ObsAdapterHelper {
|
|
|
10810
10851
|
const existingUuids = [];
|
|
10811
10852
|
// add voided obs i.e. deleted options
|
|
10812
10853
|
if (Array.isArray(node.initialValue)) {
|
|
10813
|
-
|
|
10854
|
+
_.each(node.initialValue, (item) => {
|
|
10814
10855
|
existingUuids.push(item.value.uuid);
|
|
10815
10856
|
if (Array.isArray(node.control.value)) {
|
|
10816
10857
|
if (node.control.value.indexOf(item.value.uuid) < 0) {
|
|
@@ -10831,12 +10872,12 @@ class ObsAdapterHelper {
|
|
|
10831
10872
|
}
|
|
10832
10873
|
// add new obs i.e they didn't exisit originally
|
|
10833
10874
|
if (Array.isArray(node.control.value)) {
|
|
10834
|
-
|
|
10875
|
+
_.each(node.control.value, (item) => {
|
|
10835
10876
|
if (existingUuids.indexOf(item) < 0) {
|
|
10836
|
-
payload.push({
|
|
10877
|
+
payload.push(this.addFieldNameSpaceandPath(node, {
|
|
10837
10878
|
concept: node.question.extras.questionOptions.concept,
|
|
10838
10879
|
value: item
|
|
10839
|
-
});
|
|
10880
|
+
}));
|
|
10840
10881
|
}
|
|
10841
10882
|
});
|
|
10842
10883
|
}
|
|
@@ -10845,7 +10886,7 @@ class ObsAdapterHelper {
|
|
|
10845
10886
|
getGroupPayload(node) {
|
|
10846
10887
|
const nodeAsGroup = node;
|
|
10847
10888
|
let childrenPayload = [];
|
|
10848
|
-
|
|
10889
|
+
_.each(nodeAsGroup.children, (child) => {
|
|
10849
10890
|
const payload = this.getObsNodePayload(child);
|
|
10850
10891
|
if (payload.length > 0) {
|
|
10851
10892
|
childrenPayload = childrenPayload.concat(payload);
|
|
@@ -10864,13 +10905,14 @@ class ObsAdapterHelper {
|
|
|
10864
10905
|
groupPayload.concept =
|
|
10865
10906
|
nodeAsGroup.question.extras.questionOptions.concept;
|
|
10866
10907
|
}
|
|
10908
|
+
this.addFieldNameSpaceandPath(node, groupPayload);
|
|
10867
10909
|
return groupPayload;
|
|
10868
10910
|
}
|
|
10869
10911
|
getRepeatingGroupPayload(node) {
|
|
10870
10912
|
const nodeAsArray = node;
|
|
10871
10913
|
let childrenPayload = [];
|
|
10872
10914
|
const groupsUuidsAfterEditting = [];
|
|
10873
|
-
|
|
10915
|
+
_.each(nodeAsArray.children, (child) => {
|
|
10874
10916
|
const payload = this.getObsNodePayload(child);
|
|
10875
10917
|
if (payload.length > 0) {
|
|
10876
10918
|
childrenPayload = childrenPayload.concat(payload);
|
|
@@ -10882,7 +10924,7 @@ class ObsAdapterHelper {
|
|
|
10882
10924
|
// void deleted groups
|
|
10883
10925
|
// console.log('groupsUuidsAfterEditting', groupsUuidsAfterEditting);
|
|
10884
10926
|
if (nodeAsArray.initialValue && Array.isArray(nodeAsArray.initialValue)) {
|
|
10885
|
-
|
|
10927
|
+
_.each(nodeAsArray.initialValue, (obs) => {
|
|
10886
10928
|
if (groupsUuidsAfterEditting.indexOf(obs.uuid) < 0) {
|
|
10887
10929
|
const voidedGroup = {
|
|
10888
10930
|
uuid: obs.uuid,
|
|
@@ -11044,7 +11086,7 @@ class ObsValueAdapter {
|
|
|
11044
11086
|
node.question.extras &&
|
|
11045
11087
|
node.question.renderingType === 'group') ||
|
|
11046
11088
|
forcegroup) {
|
|
11047
|
-
const groupObs =
|
|
11089
|
+
const groupObs = find(payload, (o) => {
|
|
11048
11090
|
return (o.concept.uuid === node.question.extras.questionOptions.concept &&
|
|
11049
11091
|
o.groupMembers);
|
|
11050
11092
|
});
|
|
@@ -11084,7 +11126,7 @@ class ObsValueAdapter {
|
|
|
11084
11126
|
node.question.extras.questionOptions.rendering !== 'multiCheckbox') ||
|
|
11085
11127
|
node.question.extras.questionOptions.rendering !== 'checkbox' ||
|
|
11086
11128
|
node.question.extras.questionOptions.rendering !== 'multi-select') {
|
|
11087
|
-
const obs =
|
|
11129
|
+
const obs = find(payload, (o) => {
|
|
11088
11130
|
return o.concept.uuid === node.question.extras.questionOptions.concept;
|
|
11089
11131
|
});
|
|
11090
11132
|
if (obs) {
|
|
@@ -11100,7 +11142,7 @@ class ObsValueAdapter {
|
|
|
11100
11142
|
}
|
|
11101
11143
|
}
|
|
11102
11144
|
else {
|
|
11103
|
-
const multiObs =
|
|
11145
|
+
const multiObs = filter(payload, (o) => {
|
|
11104
11146
|
return o.concept.uuid === node.question.extras.questionOptions.concept;
|
|
11105
11147
|
});
|
|
11106
11148
|
if (multiObs && multiObs.length > 0) {
|
|
@@ -11127,7 +11169,7 @@ class ObsValueAdapter {
|
|
|
11127
11169
|
// set the usual obs value
|
|
11128
11170
|
this.setObsValue(valueField, payload);
|
|
11129
11171
|
// set the obs date
|
|
11130
|
-
const obs =
|
|
11172
|
+
const obs = find(payload, (o) => {
|
|
11131
11173
|
return o.concept.uuid === node.question.extras.questionOptions.concept;
|
|
11132
11174
|
});
|
|
11133
11175
|
if (obs) {
|
|
@@ -11144,7 +11186,7 @@ class ObsValueAdapter {
|
|
|
11144
11186
|
return values;
|
|
11145
11187
|
}
|
|
11146
11188
|
setRepeatingGroupValues(node, payload) {
|
|
11147
|
-
const groupRepeatingObs =
|
|
11189
|
+
const groupRepeatingObs = filter(payload, (o) => {
|
|
11148
11190
|
const found = o.concept.uuid === node.question.extras.questionOptions.concept;
|
|
11149
11191
|
let intersect = false;
|
|
11150
11192
|
if (found && o.groupMembers) {
|
|
@@ -11154,7 +11196,7 @@ class ObsValueAdapter {
|
|
|
11154
11196
|
const schemaQuestions = node.question.questions.map((a) => {
|
|
11155
11197
|
return a.extras.questionOptions.concept;
|
|
11156
11198
|
});
|
|
11157
|
-
intersect =
|
|
11199
|
+
intersect = intersection(obs, schemaQuestions).length > 0;
|
|
11158
11200
|
}
|
|
11159
11201
|
return found && intersect;
|
|
11160
11202
|
});
|
|
@@ -11204,7 +11246,7 @@ class ObsValueAdapter {
|
|
|
11204
11246
|
if (obs.question &&
|
|
11205
11247
|
obs.question.extras &&
|
|
11206
11248
|
obs.question.extras.questionOptions.rendering === 'group') {
|
|
11207
|
-
const members =
|
|
11249
|
+
const members = filter(this.getObsPayload(obs.groupMembers), (o) => {
|
|
11208
11250
|
return o.value !== '';
|
|
11209
11251
|
});
|
|
11210
11252
|
const mappedMembers = members.map((a) => {
|
|
@@ -11253,7 +11295,7 @@ class ObsValueAdapter {
|
|
|
11253
11295
|
const current = {};
|
|
11254
11296
|
for (const key in value) {
|
|
11255
11297
|
if (value.hasOwnProperty(key)) {
|
|
11256
|
-
const groupQuestion =
|
|
11298
|
+
const groupQuestion = find(node.question.questions, {
|
|
11257
11299
|
key: key
|
|
11258
11300
|
});
|
|
11259
11301
|
const modelValue = value[key];
|
|
@@ -11305,7 +11347,7 @@ class ObsValueAdapter {
|
|
|
11305
11347
|
leftOuterJoinArrays(first, second) {
|
|
11306
11348
|
const unique = first.filter(function (obj) {
|
|
11307
11349
|
return !second.some(function (obj2) {
|
|
11308
|
-
return
|
|
11350
|
+
return isEqual(obj.value, obj2.value);
|
|
11309
11351
|
});
|
|
11310
11352
|
});
|
|
11311
11353
|
return unique;
|
|
@@ -11612,7 +11654,7 @@ class OrderValueAdapter {
|
|
|
11612
11654
|
dateVoided: o.auditInfo.dateVoided
|
|
11613
11655
|
};
|
|
11614
11656
|
});
|
|
11615
|
-
return (existingOrders =
|
|
11657
|
+
return (existingOrders = filter(existingOrders, (order) => {
|
|
11616
11658
|
if (order.voided === true || order.dateVoided) {
|
|
11617
11659
|
return false;
|
|
11618
11660
|
}
|
|
@@ -12745,18 +12787,18 @@ Select.propDecorators = {
|
|
|
12745
12787
|
};
|
|
12746
12788
|
|
|
12747
12789
|
/* eslint-disable @angular-eslint/component-class-suffix, @angular-eslint/directive-class-suffix */
|
|
12748
|
-
class Option {
|
|
12790
|
+
class Option$1 {
|
|
12749
12791
|
constructor() {
|
|
12750
12792
|
this.inputClass = 'cds--select-option';
|
|
12751
12793
|
}
|
|
12752
12794
|
}
|
|
12753
|
-
Option.decorators = [
|
|
12795
|
+
Option$1.decorators = [
|
|
12754
12796
|
{ type: Directive, args: [{
|
|
12755
12797
|
// eslint-disable-next-line
|
|
12756
12798
|
selector: 'option'
|
|
12757
12799
|
},] }
|
|
12758
12800
|
];
|
|
12759
|
-
Option.propDecorators = {
|
|
12801
|
+
Option$1.propDecorators = {
|
|
12760
12802
|
inputClass: [{ type: HostBinding, args: ['class',] }]
|
|
12761
12803
|
};
|
|
12762
12804
|
|
|
@@ -12781,8 +12823,8 @@ class SelectModule {
|
|
|
12781
12823
|
}
|
|
12782
12824
|
SelectModule.decorators = [
|
|
12783
12825
|
{ type: NgModule, args: [{
|
|
12784
|
-
declarations: [Select, Option, OptGroup],
|
|
12785
|
-
exports: [Select, Option, OptGroup],
|
|
12826
|
+
declarations: [Select, Option$1, OptGroup],
|
|
12827
|
+
exports: [Select, Option$1, OptGroup],
|
|
12786
12828
|
imports: [CommonModule, FormsModule]
|
|
12787
12829
|
},] }
|
|
12788
12830
|
];
|
|
@@ -13263,5 +13305,5 @@ var RenderingType;
|
|
|
13263
13305
|
* Generated bundle index. Do not edit.
|
|
13264
13306
|
*/
|
|
13265
13307
|
|
|
13266
|
-
export { AfeControlType, AfeFormArray, AfeFormControl, AfeFormGroup, CheckBoxQuestion, ConditionalValidationModel, ControlRelationsFactory, DataSources, DateQuestion, DateTimePickerModule, DateValidationModel, EncounterAdapter, FileUploadQuestion, Form, FormControlService, FormEntryModule, FormErrorsService, FormFactory, FormSchemaCompiler, HistoricalEncounterDataService, JsExpressionHelper, JsExpressionValidationModel, MaxValidationModel, MinValidationModel, MultiSelectQuestion, NestedQuestion, NgxDateTimePickerModule, ObsAdapterHelper, ObsValueAdapter, Option
|
|
13308
|
+
export { AfeControlType, AfeFormArray, AfeFormControl, AfeFormGroup, CheckBoxQuestion, ConditionalValidationModel, ControlRelationsFactory, DataSources, DateQuestion, DateTimePickerModule, DateValidationModel, EncounterAdapter, FileUploadQuestion, Form, FormControlService, FormEntryModule, FormErrorsService, FormFactory, FormSchemaCompiler, HistoricalEncounterDataService, JsExpressionHelper, JsExpressionValidationModel, MaxValidationModel, MinValidationModel, MultiSelectQuestion, NestedQuestion, NgxDateTimePickerModule, ObsAdapterHelper, ObsValueAdapter, Option, OrderValueAdapter, Pair, PersonAttribuAdapter, QuestionBase, QuestionFactory, QuestionGroup, RenderingType, RepeatingQuestion, SelectQuestion, TestOrderQuestion, TextAreaInputQuestion, TextInputQuestion, UiSelectQuestion, ValidationFactory, ValidationModel, SelectModule as ɵa, Select as ɵb, OWL_DIALOG_SCROLL_STRATEGY as ɵba, OWL_DIALOG_SCROLL_STRATEGY_PROVIDER_FACTORY as ɵbb, OWL_DIALOG_SCROLL_STRATEGY_PROVIDER as ɵbc, OWL_DIALOG_DEFAULT_OPTIONS as ɵbd, OwlDialogService as ɵbe, OwlDialogConfig as ɵbf, OwlCalendarComponent as ɵbg, OWL_DATE_TIME_FORMATS as ɵbi, OwlDateTimeIntl as ɵbj, OWL_DATE_TIME_LOCALE as ɵbk, OWL_DATE_TIME_LOCALE_FACTORY as ɵbl, DateTimeAdapter as ɵbm, OwlTimerComponent as ɵbn, OwlDateTimeTriggerDirective as ɵbo, OWL_DATETIME_VALUE_ACCESSOR as ɵbp, OWL_DATETIME_VALIDATORS as ɵbq, OwlDateTimeInputDirective as ɵbr, OWL_DTPICKER_SCROLL_STRATEGY as ɵbs, OWL_DTPICKER_SCROLL_STRATEGY_PROVIDER_FACTORY as ɵbt, OWL_DTPICKER_SCROLL_STRATEGY_PROVIDER as ɵbu, OwlDateTimeComponent as ɵbv, OwlDateTime as ɵbw, OWL_DATETIME_VALUE_ACCESSOR$1 as ɵbx, OwlDateTimeInlineComponent as ɵby, OwlDateTimeContainerComponent as ɵbz, Option$1 as ɵc, owlDateTimePickerAnimations as ɵca, OwlMultiYearViewComponent as ɵcb, OwlCalendarBodyComponent as ɵcc, OwlYearViewComponent as ɵcd, OwlMonthViewComponent as ɵce, OwlTimerBoxComponent as ɵcf, NumberFixedLenPipe as ɵcg, NativeDateTimeModule as ɵch, OwlNativeDateTimeModule as ɵci, NativeDateTimeAdapter as ɵcj, OWL_NATIVE_DATE_TIME_FORMATS as ɵck, NgxDatetimeComponent as ɵcl, CustomControlWrapperModule as ɵcm, CustomControlWrapperComponent as ɵcn, CustomComponentWrapperModule as ɵco, CustomComponentWrapperComponent as ɵcp, NgxTabSetModule as ɵcq, TabComponent as ɵcr, TabSetComponent as ɵcs, HoverClassDirective as ɵct, FormRendererComponent as ɵcu, AfeNgSelectComponent as ɵcv, AppointmentsOverviewComponent as ɵcw, HistoricalValueDirective as ɵcx, HistoricalFieldHelperService as ɵcy, ErrorRendererComponent as ɵcz, OptGroup as ɵd, TimeAgoPipe as ɵda, CollapseDirective as ɵdb, HidersDisablersFactory as ɵdc, ExpressionRunner as ɵdd, DebugModeService as ɵde, AlertsFactory as ɵdf, NumberInputModule as ɵe, NumberInputComponent as ɵf, InputModule as ɵg, Label as ɵh, TextArea as ɵi, TextInput as ɵj, DatePickerComponent as ɵk, TimePickerComponent as ɵl, ModalComponent as ɵm, MomentPipe as ɵn, DateTimePickerComponent as ɵo, NgxRemoteSelectModule as ɵp, RemoteSelectComponent as ɵq, RemoteFileUploadModule as ɵr, SharedModule as ɵs, SecurePipe as ɵt, FileUploadComponent as ɵu, CheckboxModule as ɵv, CheckboxControlComponent as ɵw, OwlDateTimeModule as ɵx, OwlDialogModule as ɵy, OwlDialogContainerComponent as ɵz };
|
|
13267
13309
|
//# sourceMappingURL=openmrs-ngx-formentry.js.map
|